8 for(i in S f k æ t b m)
11 # bind in an ip interface
12 for(i in I l^(0 1 2 3))
15 # reparse #ec variables, move to #e
16 for(i in init service sysname user nvram rootdir cfs bootdisk bootargs \
17 nobootprompt debugfactotum fs fsaddr auth authaddr console){
20 rm -f '#e'/$i '#ec'/$i
31 $* || fatal $"*^': '^$status
42 $1=`{dd -bs 64 -count 1 >[2]/dev/null}
60 if(~ $#nobootprompt 0){
63 ask bootargs ' is (tcp, local!device)' $"bootargs
65 if not bootargs=$nobootprompt
67 mn=`{echo $bootargs | awk -F! '{print $1}'}
68 ma=`{echo $bootargs | sed 's/[^!]*!?//'}
79 # authentication agent
80 if(! test -f /srv/factotum){
81 x=(/boot/factotum -sfactotum)
91 if(! ~ $#debugfactotum 0)
95 if not user=`{cat /dev/hostowner}
100 # insert cfs in the pipeline
101 if(test -x /bin/cfs){
102 if(~ $#bootdisk 1 && ~ $#cfs 0)
104 if(~ $#cfs 1 && ! ~ $cfs off && test -f $cfs){
105 x=(/bin/cfs -s -f $cfs)
108 {$x </srv/boot &} | echo 0 >/srv/cfs
110 mv /srv/cfs /srv/boot
114 # mount and change root in new enviroment and namespace
117 # mount root filesystem
120 must mount -c /srv/boot $rootdir
122 # compile init command
133 # remove enviroment variables
134 rm -f /env/^$mt /env/? /env/?? '/env/fn#'*
136 # remove part of our temporary root
137 /mnt/broot/$cputype/bin/unmount /$cputype/bin /bin
138 /mnt/broot/$cputype/bin/unmount /rc/bin /bin
139 /mnt/broot/$cputype/bin/unmount /
141 # create the name space, mount the root fs
142 /mnt/broot/$cputype/bin/bind / /
143 /mnt/broot/$cputype/bin/mount -ac '#s/boot' /
145 # remove the remaining temporary root
146 /mnt/broot/$cputype/bin/unmount /mnt/broot
151 # keyboard and serial console
152 if(test -x /bin/aux/kbdfs){
162 # add partitions and binds
165 # boot(8) command line arguments
176 user=`{echo $1 | sed 's,^-u,,g'}
196 if(! ~ $#aa 0 && ~ $#bootargs 0 && ~ $#nobootprompt 0){
204 # cleanup so it can be restarted
207 rm -f /srv/^(cfs boot slashn cs dns)
208 } </dev/cons >/dev/cons >[2]/dev/cons