Subject: boot sequence problems
To: None <netbsd-users@NetBSD.ORG>
From: Dan McMahill <mcmahill@mtl.mit.edu>
List: netbsd-users
Date: 05/24/1998 17:02:25
I just replaced the drive on my machine and at the same time went
to seperate / and /usr partitions.  After that the machine would
not boot properly due to the order in which /etc/rc does things.

The relevent stuff from /etc/rc is:

umount -a >/dev/null 2>&1
mount /

{snip}
# set hostname, turn on network
echo 'starting network'
sh /etc/netstart
if [ $? -ne 0 ]; then
        exit 1
fi

for fs in /usr /var $critical_filesystems; do
        mount | (
                        ismounted=no
                        while read what _on on _type type; do
                         if [ $on = $fs ]; then
                                                ismounted=yes
                         fi
                        done
                if [ $ismounted = no ]; then
                        mount $fs >/dev/null 2>&1
                fi
        )
done

# "Critical" file systems are now mounted.


The problem is this.  The last line of /etc/netstart has
if [ -s /etc/netstart.local ]; then
        . /etc/netstart.local
fi

and in /etc/netstart.local I have:

dhclient ae1

CONFLINE="map ae1 10.0.0.0/8 -> `ifconfig ae1 | grep "inet.*netmask" | cut -d " " -f 2 `/32 portmap 
tcp/udp 10000:20000"
#CONFLINE="map ppp0 10.0.0.0/8 -> 18.62.4.149/32 portmap tcp/udp 10000:20000"
echo $CONFLINE > /etc/ipnat.conf
ipnat -f /etc/ipnat.conf


Anyway the problem is that 'grep', and 'cut' live in /usr/bin and 'ipnat' lives
in '/usr/sbin' but at this point /usr has not been mounted yet.  For now I've
simply put 
mount /usr >/dev/null 2>&1
in /etc/rc just before the netstart stuff.

Is this the "right way" to make it work?  Should the mounting of critical
file systems come before the network (or is this a problem for machines
who nfs mount /usr).  Perhaps there's a better way to start ipnat and dhcp?

Comments?

Thanks

-- Dan