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(~ $autolog true || ~ $autolog yes || ~ $autolog 1)
96 if(! ~ $#debugfactotum 0)
104 # load keys from secstore if $auth or $secstore is not empty
107 if(! ~ $#$x 0 && test -x /bin/auth/secstore && test -f /mnt/factotum/ctl){
108 x=(auth/secstore -G factotum -s^$$x)
109 if(~ $autolog true || ~ $autolog yes || ~ $autolog 1)
113 $x -n >/mnt/factotum/ctl
114 if(~ $status *readnvram* || ! ~ $service cpu)
115 $x >/mnt/factotum/ctl
121 # insert cfs in the pipeline
122 if(test -x /bin/cfs){
123 if(~ $#bootdisk 1 && ~ $#cfs 0)
125 if(~ $#cfs 1 && ! ~ $cfs off && test -f $cfs){
126 x=(/bin/cfs -S -s -f $cfs)
129 {$x </srv/boot &} | echo 0 >/srv/cfs
131 mv /srv/cfs /srv/boot
135 # mount and change root in new enviroment and namespace
138 # mount root filesystem
141 must mount -c /srv/boot $rootdir
143 # compile init command
154 # remove enviroment variables
155 rm -f '#e/'^$mt '#e/'? '#e/'?? '#e/fn#'*
157 # remove part of our temporary root
158 /mnt/broot/$cputype/bin/unmount /$cputype/bin /bin
159 /mnt/broot/$cputype/bin/unmount /rc/bin /bin
160 /mnt/broot/$cputype/bin/unmount /
162 # create the name space, mount the root fs
163 /mnt/broot/$cputype/bin/bind / /
164 /mnt/broot/$cputype/bin/mount -ac '#s/boot' /
166 # remove the remaining temporary root
167 /mnt/broot/$cputype/bin/unmount /mnt/broot
172 # keyboard and serial console
173 if(test -x /bin/aux/kbdfs){
177 aux/kbdfs -q -s cons $a
181 if(test -x /bin/nusbrc && ! test -e /env/nousbrc)
184 # wait for devices to settle down
193 for(i in /rc/lib/*.rc){
197 # add partitions and binds
200 # boot(8) command line arguments
211 user=`{echo $1 | sed 's,^-u,,g'}
231 if(! ~ $#aa 0 && ~ $#bootargs 0 && ~ $#nobootprompt 0){
239 # subshell doesnt wait on interrupts
240 while(~ $status interrupted){wait}
242 # cleanup so it can be restarted
244 rm -f /srv/^(cfs boot slashn cs dns)