bootrc: prefer 9660 filesystem as default on cdboot, restart factotum, delay for usb
This commit is contained in:
parent
41a4cd88eb
commit
cd47b3e9d4
|
@ -15,13 +15,12 @@ for(i in I l^(0 1 2 3))
|
||||||
# usualy better than 1970
|
# usualy better than 1970
|
||||||
cat '#r/rtc' >/dev/time >[2]/dev/null
|
cat '#r/rtc' >/dev/time >[2]/dev/null
|
||||||
|
|
||||||
# reparse #ec variables, move to #e
|
# reparse variables
|
||||||
for(i in `{ls -Qp '#ec'}){
|
for(i in `{ls -Qp '#ec'}){
|
||||||
switch($i){
|
switch($i){
|
||||||
case '*'* e820
|
case '*'*
|
||||||
# ignore these
|
# ignore these
|
||||||
case *
|
case *
|
||||||
cat '#ec/'^$i >'#e/'^$i
|
|
||||||
$i=`{echo $$i}
|
$i=`{echo $$i}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,22 +80,23 @@ fn main{
|
||||||
$mp(1) $ma
|
$mp(1) $ma
|
||||||
|
|
||||||
# authentication agent
|
# authentication agent
|
||||||
if(! test -f /srv/factotum){
|
if(test -f /srv/factotum){
|
||||||
x=(/boot/factotum -sfactotum)
|
rm -f /srv/factotum
|
||||||
if(~ $service cpu){
|
user=`{cat /dev/hostowner}
|
||||||
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 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
|
# connect method
|
||||||
$mp(2) $ma
|
$mp(2) $ma
|
||||||
|
|
|
@ -1,7 +1,20 @@
|
||||||
#!/bin/rc
|
#!/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{
|
fn showlocaldevs{
|
||||||
echo local devices found:
|
|
||||||
for(d in /dev/sd*) if(test -r $d/ctl){
|
for(d in /dev/sd*) if(test -r $d/ctl){
|
||||||
q=`{sed 's,(inquiry|geometry),\
|
q=`{sed 's,(inquiry|geometry),\
|
||||||
\1,g' $d/ctl | grep inquiry}
|
\1,g' $d/ctl | grep inquiry}
|
||||||
|
@ -11,13 +24,10 @@ fn showlocaldevs{
|
||||||
switch($i){
|
switch($i){
|
||||||
case ctl raw log
|
case ctl raw log
|
||||||
;
|
;
|
||||||
case 9fat plan9 nvram
|
case plan9 nvram swap
|
||||||
echo $p
|
echo $p
|
||||||
case *
|
case *
|
||||||
t=`{fstype $p}
|
showlocaldev $p `{fstype $p}
|
||||||
if(~ $#bootargs 0 && ! ~ $t '')
|
|
||||||
bootargs=local!$p
|
|
||||||
echo $p $t
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,11 +35,7 @@ fn showlocaldevs{
|
||||||
echo $d':'
|
echo $d':'
|
||||||
for(p in $d/*.^(iso kfs paq)) if(test -f $p){
|
for(p in $d/*.^(iso kfs paq)) if(test -f $p){
|
||||||
t=`{fstype $p}
|
t=`{fstype $p}
|
||||||
if(! ~ $t ''){
|
~ $#t 0 || showlocaldev $p $t
|
||||||
if(~ $#bootargs 0)
|
|
||||||
bootargs=local!$p
|
|
||||||
echo $p $t
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,3 +36,7 @@ if(! nusb/usbd)
|
||||||
}
|
}
|
||||||
|
|
||||||
bind -a '#σ/usb' /dev
|
bind -a '#σ/usb' /dev
|
||||||
|
|
||||||
|
# wait for devices getting activated
|
||||||
|
sleep 3
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ $objtype
|
||||||
rc
|
rc
|
||||||
rm
|
rm
|
||||||
sed
|
sed
|
||||||
|
sleep
|
||||||
srv
|
srv
|
||||||
test
|
test
|
||||||
unmount
|
unmount
|
||||||
|
|
Loading…
Reference in a new issue