summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@centraldogma>2011-08-28 20:37:20 +0200
committercinap_lenrek <cinap_lenrek@centraldogma>2011-08-28 20:37:20 +0200
commitcd47b3e9d4fb11eec4a17434291d3c70811c19ea (patch)
tree84e6fb20c23ee40fc8b2c9d73493f3bb627aaa7a
parent41a4cd88ebc57a05b03b18a13aeedfcc7b546a19 (diff)
downloadplan9front-cd47b3e9d4fb11eec4a17434291d3c70811c19ea.tar.xz
bootrc: prefer 9660 filesystem as default on cdboot, restart factotum, delay for usb
-rw-r--r--sys/src/9/boot/bootrc36
-rwxr-xr-xsys/src/9/boot/local.rc28
-rw-r--r--sys/src/9/boot/nusbrc4
-rw-r--r--sys/src/9/port/bootfs.proto1
4 files changed, 40 insertions, 29 deletions
diff --git a/sys/src/9/boot/bootrc b/sys/src/9/boot/bootrc
index 6a45b0470..d29fc6082 100644
--- a/sys/src/9/boot/bootrc
+++ b/sys/src/9/boot/bootrc
@@ -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}
+ }
+ x=(/boot/factotum -sfactotum)
+ if(~ $service cpu){
+ x=($x -S)
+ if(~ -k $ff)
+ x=($x -k)
}
- if not user=`{cat /dev/hostowner}
+ 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
diff --git a/sys/src/9/boot/local.rc b/sys/src/9/boot/local.rc
index e67550691..bca79c4ce 100755
--- a/sys/src/9/boot/local.rc
+++ b/sys/src/9/boot/local.rc
@@ -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
}
}
}
diff --git a/sys/src/9/boot/nusbrc b/sys/src/9/boot/nusbrc
index 8d4fc46f0..e2e98ee1e 100644
--- a/sys/src/9/boot/nusbrc
+++ b/sys/src/9/boot/nusbrc
@@ -36,3 +36,7 @@ if(! nusb/usbd)
}
bind -a '#σ/usb' /dev
+
+# wait for devices getting activated
+sleep 3
+
diff --git a/sys/src/9/port/bootfs.proto b/sys/src/9/port/bootfs.proto
index 933c4efb0..dba45bcdb 100644
--- a/sys/src/9/port/bootfs.proto
+++ b/sys/src/9/port/bootfs.proto
@@ -27,6 +27,7 @@ $objtype
rc
rm
sed
+ sleep
srv
test
unmount