9 for(i in S f k æ t b m)
12 # bind in an ip interface
13 for(i in I l^(0 1 2 3))
16 # usualy better than 1970
17 cat '#r/rtc' >/dev/time >[2]/dev/null
20 for(i in `{ls -Qp /env}){
22 case '*'* 'fn#'* e820 apm0 apid ifs path pid prompt status ?
39 $* || fatal $"*^': '^$status
50 $1=`{dd -bs 64 -count 1 >[2]/dev/null}
66 if(~ $#nobootprompt 0){
69 ask bootargs ' is (tcp, il, local!device)' $"bootargs
71 if not bootargs=$nobootprompt
73 mn=`{echo $bootargs | sed 's,!, ,'}
83 # authentication agent
84 if(! test -f /srv/factotum){
85 x=(/boot/factotum -n -sfactotum)
93 if(! ~ $#debugfactotum 0)
101 # load keys from secstore if $auth or $secstore is not empty
104 if(! ~ $#$x 0 && test -x /bin/auth/secstore && test -f /mnt/factotum/ctl){
105 x=(auth/secstore -G factotum -s^$$x)
107 $x -n >/mnt/factotum/ctl
108 if(~ $status *readnvram* || ! ~ $service cpu)
109 $x >/mnt/factotum/ctl
115 # insert cfs in the pipeline
116 if(test -x /bin/cfs){
117 if(~ $#bootdisk 1 && ~ $#cfs 0)
119 if(~ $#cfs 1 && ! ~ $cfs off && test -f $cfs){
120 x=(/bin/cfs -s -f $cfs)
123 {$x </srv/boot &} | echo 0 >/srv/cfs
125 mv /srv/cfs /srv/boot
129 # mount and change root in new enviroment and namespace
132 # mount root filesystem
135 must mount -c /srv/boot $rootdir
137 # compile init command
148 # remove enviroment variables
149 rm -f '#e/'^$mt '#e/'? '#e/'?? '#e/fn#'*
151 # remove part of our temporary root
152 /mnt/broot/$cputype/bin/unmount /$cputype/bin /bin
153 /mnt/broot/$cputype/bin/unmount /rc/bin /bin
154 /mnt/broot/$cputype/bin/unmount /
156 # create the name space, mount the root fs
157 /mnt/broot/$cputype/bin/bind / /
158 /mnt/broot/$cputype/bin/mount -ac '#s/boot' /
160 # remove the remaining temporary root
161 /mnt/broot/$cputype/bin/unmount /mnt/broot
166 # keyboard and serial console
167 if(test -x /bin/aux/kbdfs){
171 aux/kbdfs -q -s cons $a
175 if(test -x /bin/nusbrc && ! test -e /env/nousbrc)
178 # wait for devices to settle down
187 for(i in /rc/lib/*.rc){
191 # add partitions and binds
194 # boot(8) command line arguments
205 user=`{echo $1 | sed 's,^-u,,g'}
225 if(! ~ $#aa 0 && ~ $#bootargs 0 && ~ $#nobootprompt 0){
233 # subshell doesnt wait on interrupts
234 while(~ $status interrupted){wait}
236 # cleanup so it can be restarted
238 rm -f /srv/^(cfs boot slashn cs dns)