9 bind -a '#'^$i /dev >/dev/null >[2=1]
11 # make variables settable by copying them from #ec
12 for(i in init service sysname user nvram rootdir cfs bootdisk bootargs \
13 nobootprompt debugfactotum fs fsaddr auth authaddr){
16 rm -f '#e'/$i '#ec'/$i /env/$i
27 $* || fatal $"*^': '^$status
38 $1=`{dd -bs 64 -count 1 >[2]/dev/null}
56 if(~ $#nobootprompt 0){
59 ask bootargs ' is (tcp, local!device)' $bootargs
61 if not bootargs=$nobootprompt
63 mn=`{echo $bootargs | awk -F! '{print $1}'}
64 ma=`{echo $bootargs | sed 's/[^!]*!?//'}
75 # authentication agent
76 if(! test -f /srv/factotum){
77 x=(/boot/factotum -sfactotum)
87 if(! ~ $#debugfactotum 0)
91 if not user=`{cat /dev/hostowner}
96 # insert cfs in the pipeline
98 if(~ $#bootdisk 1 && ~ $#cfs 0)
100 if(~ $#cfs 1 && ! ~ $cfs off && test -f $cfs){
101 x=(/bin/cfs -s -f $cfs)
104 {$x </srv/boot &} | echo 0 >/srv/cfs
106 mv /srv/cfs /srv/boot
110 # mount and change root in new enviroment and namespace
113 # mount root filesystem
116 must mount -c /srv/boot $rootdir
118 # compile init command
129 # remove enviroment variables
130 rm -f /env/^$mt /env/? /env/?? '/env/fn#'*
132 # remove part of our temporary root
133 /mnt/broot/$cputype/bin/unmount /$cputype/bin /bin
134 /mnt/broot/$cputype/bin/unmount /rc/bin /bin
135 /mnt/broot/$cputype/bin/unmount /
137 # create the name space, mount the root fs
138 /mnt/broot/$cputype/bin/bind / /
139 /mnt/broot/$cputype/bin/mount -ac '#s/boot' /
141 # remove the remaining temporary root
142 /mnt/broot/$cputype/bin/unmount /mnt/broot
147 if(test -e '#b' && test -x /bin/aux/kbdfs){
155 if(test -e '#u' && test -x /bin/usb/usbd){
160 # bind in an ip interface
161 for(i in I l^(0 1 2 3))
163 # add partitions and binds
166 # boot(8) command line arguments
177 user=`{echo $1 | sed 's,^-u,,g'}
197 if(! ~ $#aa 0 && ~ $#bootargs 0 && ~ $#nobootprompt 0){
205 # cleanup so it can be restarted
208 rm -f /srv/cfs /srv/boot /srv/slashn /srv/cs /srv/dns
209 } </dev/cons >/dev/cons >[2]/dev/cons