echo and read shell script functions in post install script doesn't display messages


sanjaycvr35412@...
 

Hi All,

 

I am trying to execute a script in “pkg_postinst_ontarget_${PN}” to configure the static IP address of the embedded board. The script executes at first boot, but it doesn’t display echo or read messages. These messages are required to improve user experience with the setup process.

 

Script is as below:

pkg_postinst_ontarget_${PN} () {

    #!/bin/sh -e

    # This will run on first boot

    echo "Starting setup script..."

 

    read -p "Enter the IP address: " ipAddress

    read -p "Enter the netmask: " netmask

    read -p "Enter network gateway: " gateway

 

    cat >> /etc/network/interfaces << EOF

 

iface eth0 inet static

    address $ipAddress

    netmask $netmask

    gateway $gateway

EOF

}

 

Please help me to fix the problem in displaying echo and read messages to improve user experience with the setup process.

 

Thanks,

Sanjay Kumar

 

Join yocto@lists.yoctoproject.org to automatically receive all group messages.