]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/boot/local.rc
add fstype command to detect 9660, kfs and cwfs filesystems
[plan9front.git] / sys / src / 9 / boot / local.rc
1 #!/bin/rc
2
3 fn showlocaldevs{
4         echo local devices found:
5         for(c in /dev/sd*/ctl){
6                 if(test -r $c){
7                         d=`{echo $c | sed 's,/ctl,,g'}
8                         echo $d':' `{sed 's/inquiry[ ]+//g; q' $c}
9                         for(i in `{ls -p $d | grep -v -e 'ctl|raw'})
10                                 echo $d'/'$i `{fstype $d'/'$i}
11                         echo
12                 }
13         }
14 }
15
16 fn configlocal{
17         if(~ $pcload 1){
18                 kern=`{echo $* | sed 's,.*!(.*)$,\1,g'}
19
20                 # for now we only allow kernels in the same dev/part of $methodargs
21                 if(~ $#kern 0 || ! ~ $#bootfile 0)
22                         kern=`{echo $bootfile | sed 's,.*!(.*)$,\1,g'}
23         }
24         diskparts
25
26 }
27
28 fn connectlocal{
29         t=`{fstype $1}
30         if(~ $#t 0)
31                 fatal unknown fstype $1
32         switch($t){
33         case 9660
34                 must 9660srv -f $* boot
35         case kfs
36                 must disk/kfs -n boot -f $*
37         case *
38                 must $t -n boot -f $*
39         }
40 }