bootrc: prefer 9660 filesystem as default on cdboot, restart factotum, delay for usb

front
cinap_lenrek 2011-08-28 20:37:20 +02:00
parent 41a4cd88eb
commit cd47b3e9d4
4 changed files with 40 additions and 29 deletions

View File

@ -15,13 +15,12 @@ for(i in I l^(0 1 2 3))
# usualy better than 1970
cat '#r/rtc' >/dev/time >[2]/dev/null
# reparse #ec variables, move to #e
# reparse variables
for(i in `{ls -Qp '#ec'}){
switch($i){
case '*'* e820
case '*'*
# ignore these
case *
cat '#ec/'^$i >'#e/'^$i
$i=`{echo $$i}
}
}
@ -81,22 +80,23 @@ fn main{
$mp(1) $ma
# authentication agent
if(! test -f /srv/factotum){
x=(/boot/factotum -sfactotum)
if(~ $service cpu){
x=($x -S)
if(~ -k $ff)
x=($x -k)
}
if not
x=($x -u)
if(! ~ $#authaddr 0)
x=($x -a $authaddr)
if(! ~ $#debugfactotum 0)
x=($x -p)
must $x
if(test -f /srv/factotum){
rm -f /srv/factotum
user=`{cat /dev/hostowner}
}
if not user=`{cat /dev/hostowner}
x=(/boot/factotum -sfactotum)
if(~ $service cpu){
x=($x -S)
if(~ -k $ff)
x=($x -k)
}
if not
x=($x -u)
if(! ~ $#authaddr 0)
x=($x -a $authaddr)
if(! ~ $#debugfactotum 0)
x=($x -p)
must $x
# connect method
$mp(2) $ma

View File

@ -1,7 +1,20 @@
#!/bin/rc
fn showlocaldev {
echo $1' ' $2
if(~ $#bootargs 0){
if(! ~ $#cdboot 0){
if(~ $2 9660)
bootargs=local!$1
}
if not {
if(! ~ $2 '' dos)
bootargs=local!$1
}
}
}
fn showlocaldevs{
echo local devices found:
for(d in /dev/sd*) if(test -r $d/ctl){
q=`{sed 's,(inquiry|geometry),\
\1,g' $d/ctl | grep inquiry}
@ -11,13 +24,10 @@ fn showlocaldevs{
switch($i){
case ctl raw log
;
case 9fat plan9 nvram
case plan9 nvram swap
echo $p
case *
t=`{fstype $p}
if(~ $#bootargs 0 && ! ~ $t '')
bootargs=local!$p
echo $p $t
showlocaldev $p `{fstype $p}
}
}
}
@ -25,11 +35,7 @@ fn showlocaldevs{
echo $d':'
for(p in $d/*.^(iso kfs paq)) if(test -f $p){
t=`{fstype $p}
if(! ~ $t ''){
if(~ $#bootargs 0)
bootargs=local!$p
echo $p $t
}
~ $#t 0 || showlocaldev $p $t
}
}
}

View File

@ -36,3 +36,7 @@ if(! nusb/usbd)
}
bind -a '#σ/usb' /dev
# wait for devices getting activated
sleep 3

View File

@ -27,6 +27,7 @@ $objtype
rc
rm
sed
sleep
srv
test
unmount