diff options
author | cinap_lenrek <cinap_lenrek@localhost> | 2011-04-21 10:40:03 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@localhost> | 2011-04-21 10:40:03 +0000 |
commit | 19a82a265411a5f5e9eae9d315279befd001a47d (patch) | |
tree | 52f49d72e4707264db3319ceb492bf701e7865a0 /sys/src | |
parent | a7db29c663f797e2b5e417909f81e6df78dc992c (diff) |
add fstype command to detect 9660, kfs and cwfs filesystems
Diffstat (limited to 'sys/src')
-rw-r--r-- | sys/src/9/boot/local.rc | 29 | ||||
-rw-r--r-- | sys/src/9/port/bootfs.proto | 1 |
2 files changed, 16 insertions, 14 deletions
diff --git a/sys/src/9/boot/local.rc b/sys/src/9/boot/local.rc index de205b86d..9d7a51959 100644 --- a/sys/src/9/boot/local.rc +++ b/sys/src/9/boot/local.rc @@ -3,11 +3,13 @@ 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'}) - echo $d'/'$i - echo + 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'}) + echo $d'/'$i `{fstype $d'/'$i} + echo + } } } @@ -24,16 +26,15 @@ fn configlocal{ } fn connectlocal{ - part=`{echo $* | sed 's,.*/([^ ]+),\1,g'} - part=$part(1) - switch($part){ - case kfs fs - must disk/kfs -n boot -f $* - case cwfs fscache fsworm w0 w1 w2 w3 - must cwfs64x -n boot -f $* - case data + t=`{fstype $1} + if(~ $#t 0) + fatal unknown fstype $1 + switch($t){ + case 9660 must 9660srv -f $* boot + case kfs + must disk/kfs -n boot -f $* case * - fatal unknown partition $part + must $t -n boot -f $* } } diff --git a/sys/src/9/port/bootfs.proto b/sys/src/9/port/bootfs.proto index 9bbb98d1b..548493d3a 100644 --- a/sys/src/9/port/bootfs.proto +++ b/sys/src/9/port/bootfs.proto @@ -39,6 +39,7 @@ rc local.rc 555 sys sys ../boot/local.rc tcp.rc 555 sys sys ../boot/tcp.rc bin + fstype diskparts bootrc 555 sys sys ../boot/bootrc tmp |