Assigning IP address at boot

I’m sure someone will have an easy solution for this but I’ve been batting it around for a few weeks now…

I’ve got a stripped down version of QNX 6.3 running in my embedded system. During the boot process I do this:

io-net -ptcpip -drtl -pqnet bind=en0,host=cpu1,mount=/net:mynet.com
waitfor /net 6
ifconfig en0 192.168.0.201

This works fine, but the problem is that in order to change the boot system’s IP address I have to edit this script and rebuild. Tedious at best. Is there a simple way to have the IP address be in a text file on the drive that I can edit instead of inserted physically into the .boot image? Bear in mind that I unfortunately don’t have DHCP, scripting languages or editors available to me on my target.

Thanks,

Jason

why don’t you write your own script file that will run at every boot time which sets the ip address. Then this script file is not in .boot and you can change the ip address easily by modifying the script file. When you build your .boot image have it to run this script file if it exist.

Here’s what I use (called from a script at startup):

if [[ -e /etc/IPADDRESS ]]; then
    ifconfig en0 $(head -l -n1 /etc/IPADDRESS) up
else
    ifconfig en0 192.168.0.201 up
fi

looks ok to me…