Subject: boot sequence problems
To: None <netbsd-users@NetBSD.ORG>
From: Dan McMahill <email@example.com>
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
# set hostname, turn on network
echo 'starting network'
if [ $? -ne 0 ]; then
for fs in /usr /var $critical_filesystems; do
mount | (
while read what _on on _type type; do
if [ $on = $fs ]; then
if [ $ismounted = no ]; then
mount $fs >/dev/null 2>&1
# "Critical" file systems are now mounted.
The problem is this. The last line of /etc/netstart has
if [ -s /etc/netstart.local ]; then
and in /etc/netstart.local I have:
CONFLINE="map ae1 10.0.0.0/8 -> `ifconfig ae1 | grep "inet.*netmask" | cut -d " " -f 2 `/32 portmap
#CONFLINE="map ppp0 10.0.0.0/8 -> 126.96.36.199/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
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?