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

40 lines
770 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){
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'})
2011-04-19 05:24:46 +00:00
echo $d'/'$i
echo
}
}
fn configlocal{
2011-04-19 05:24:46 +00:00
if(~ $pcload 1){
kern=`{echo $* | sed 's,.*!(.*)$,\1,g'}
2011-04-19 05:24:46 +00:00
# for now we only allow kernels in the same dev/part of $methodargs
if(~ $#kern 0 || ! ~ $#bootfile 0)
kern=`{echo $bootfile | sed 's,.*!(.*)$,\1,g'}
}
diskparts
2011-04-19 05:24:46 +00:00
}
fn connectlocal{
2011-04-19 05:24:46 +00:00
part=`{echo $* | sed 's,.*/([^ ]+),\1,g'}
part=$part(1)
switch($part){
2011-04-18 06:33:38 +00:00
case kfs fs
2011-04-19 05:24:46 +00:00
must disk/kfs -n boot -f $*
2011-04-18 06:33:38 +00:00
case cwfs fscache fsworm w0 w1 w2 w3
2011-04-19 05:24:46 +00:00
must cwfs64x -n boot -f $*
case data
2011-04-19 05:24:46 +00:00
must 9660srv -f $* boot
case *
2011-04-19 05:24:46 +00:00
fatal unknown partition $part
}
}