The postinst scriptlets are script fragments and not standalone scripts. Putting an interpreter to their first line will not work. Also, they are not running on an interactive console, but by a helper executor, so they have to be entirely automated.
What is the problem that you would like to solve? Alex On Tue, 14 Dec 2021 at 13:01, <[email protected]> wrote: > 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 > > > > > >
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#55583): https://lists.yoctoproject.org/g/yocto/message/55583 Mute This Topic: https://lists.yoctoproject.org/mt/87719351/21656 Group Owner: [email protected] Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
