]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/boot/local.rc
boot(8): fix it
[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                 d=`{echo $c | sed 's,/ctl,,g'}
7                 echo $d':' `{sed 's/inquiry[ ]+//g; q' $c}
8                 for(i in `{awk '/^part/{print $2}' $c})
9                         echo $d'/'$i
10                 echo
11         }
12 }
13
14 fn configlocal{
15         if(~ $pcload 1){
16                 kern=`{echo $* | sed 's,.*!(.*)$,\1,g'}
17
18                 # for now we only allow kernels in the same dev/part of $methodargs
19                 if(~ $#kern 0 || ! ~ $#bootfile 0)
20                         kern=`{echo $bootfile | sed 's,.*!(.*)$,\1,g'}
21         }
22         diskparts
23
24 }
25
26 fn connectlocal{
27         part=`{echo $* | sed 's,.*/([^ ]+),\1,g'}
28         part=$part(1)
29         switch($part){
30         case kfs fs
31                 must disk/kfs -n boot -f $*
32         case cwfs fscache fsworm w0 w1 w2 w3
33                 must cwfs64x -n boot -f $*
34         case data
35                 must 9660srv -f $* boot
36         case *
37                 fatal unknown partition $part
38         }
39 }