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 # usualy better than 1970
16 cat '#r/rtc' >/dev/time >[2]/dev/null
19 for(i in `{ls -Qp /env}){
21 case '*'* 'fn#'* e820 apm0 apid ifs path pid prompt status ?
38 $* || fatal $"*^': '^$status
49 $1=`{dd -bs 64 -count 1 >[2]/dev/null}
67 if(~ $#nobootprompt 0){
70 ask bootargs ' is (tcp, il, local!device)' $"bootargs
72 if not bootargs=$nobootprompt
74 mn=`{echo $bootargs | awk -F! '{print $1}'}
75 ma=`{echo $bootargs | sed 's/[^!]*!?//'}
86 # authentication agent
87 if(test -f /srv/factotum){
89 user=`{cat /dev/hostowner}
91 x=(/boot/factotum -sfactotum)
101 if(! ~ $#debugfactotum 0)
108 # insert cfs in the pipeline
109 if(test -x /bin/cfs){
110 if(~ $#bootdisk 1 && ~ $#cfs 0)
112 if(~ $#cfs 1 && ! ~ $cfs off && test -f $cfs){
113 x=(/bin/cfs -s -f $cfs)
116 {$x </srv/boot &} | echo 0 >/srv/cfs
118 mv /srv/cfs /srv/boot
122 # mount and change root in new enviroment and namespace
125 # mount root filesystem
128 must mount -c /srv/boot $rootdir
130 # compile init command
141 # remove enviroment variables
142 rm -f /env/^$mt /env/? /env/?? '/env/fn#'*
144 # remove part of our temporary root
145 /mnt/broot/$cputype/bin/unmount /$cputype/bin /bin
146 /mnt/broot/$cputype/bin/unmount /rc/bin /bin
147 /mnt/broot/$cputype/bin/unmount /
149 # create the name space, mount the root fs
150 /mnt/broot/$cputype/bin/bind / /
151 /mnt/broot/$cputype/bin/mount -ac '#s/boot' /
153 # remove the remaining temporary root
154 /mnt/broot/$cputype/bin/unmount /mnt/broot
159 # keyboard and serial console
160 if(test -x /bin/aux/kbdfs){
164 aux/kbdfs -q -s cons $a
168 if(test -x /bin/nusbrc && ! test -e /env/nousbrc)
171 # wait for devices to settle down
174 # add partitions and binds
177 # boot(8) command line arguments
188 user=`{echo $1 | sed 's,^-u,,g'}
208 if(! ~ $#aa 0 && ~ $#bootargs 0 && ~ $#nobootprompt 0){
216 # subshell doesnt wait on interrupts
217 while(~ $status interrupted){wait}
219 # cleanup so it can be restarted
221 rm -f /srv/^(cfs boot slashn cs dns)