plan9fox/sys/src/9/boot/local.rc

45 lines
760 B
Plaintext
Raw Normal View History

#!/bin/rc
2011-04-19 05:24:46 +00:00
fn showlocaldevs{
echo local devices found:
for(c in /dev/sd*/ctl){
if(test -r $c){
d=`{echo $c | sed 's,/ctl,,g'}
echo $d':' `{sed 's/inquiry[ ]+//g; q' $c}
for(i in `{ls -p $d | grep -v -e 'ctl|raw'}){
p=$d/$i
t=`{fstype $p}
if(~ $#bootargs 0 && ! ~ $t '')
bootargs=local!$p
echo $p $t
}
}
2011-04-19 05:24:46 +00:00
}
}
fn configlocal{
2011-04-19 05:24:46 +00:00
if(~ $pcload 1){
kern=`{echo $* | sed 's,.*!(.*)$,\1,g'}
if(~ $#kern 0 || ! ~ $#bootfile 0)
kern=`{echo $bootfile | sed 's,.*!(.*)$,\1,g'}
}
diskparts
2011-04-19 05:24:46 +00:00
}
fn connectlocal{
t=`{fstype $1}
if(~ $#t 0)
fatal unknown fstype $1
switch($t){
case 9660
t=9660srv
case kfs
t=disk/kfs
}
{$t -s -f $* &} <[0=1] | echo 0 >/srv/boot
}
mlocal=(configlocal connectlocal)
mt=(mlocal $mt)