diff options
author | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-05-02 01:21:55 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-05-02 01:21:55 +0000 |
commit | fa9a40027b8ced000ea1c3d2dc5ed8eb44c6ad90 (patch) | |
tree | bd92719db3cd95101730becdf2f7ef7612ea158e /rc | |
parent | 8f7cdfa5e27bf4c086657f505a8a91725915bb82 (diff) |
boot(8): merge usb boot method into local
Diffstat (limited to 'rc')
-rwxr-xr-x | rc/bin/diskparts | 8 | ||||
-rwxr-xr-x | rc/bin/fstype | 9 |
2 files changed, 16 insertions, 1 deletions
diff --git a/rc/bin/diskparts b/rc/bin/diskparts index 0088f5cc1..a7014ac44 100755 --- a/rc/bin/diskparts +++ b/rc/bin/diskparts @@ -1,9 +1,15 @@ #!/bin/rc # set up any disk partitions -rfork e if (! test -e /dev/sdctl) bind -b '#S' /dev +# attach partfs to usb disks +for(disk in /dev/sdU*[0-9]){ + pdev=`{echo $disk | sed 's,^/dev/(.*),\1p,'} + if(! test -d /dev/$pdev && test -f $disk/data) + disk/partfs -d $pdev $disk/data +} + # set up any /dev/sd partitions. # note that really big disks (e.g., aoe devices) may have no mbr # partition table because the mbr partition table can't cope with large diff --git a/rc/bin/fstype b/rc/bin/fstype index c2fd65d9c..e2a46922a 100755 --- a/rc/bin/fstype +++ b/rc/bin/fstype @@ -1,10 +1,19 @@ #!/bin/rc +rfork e m=`{dd -if $1 -bs 2048 -skip 16 >[2]/dev/null | xd -c | sed 1q | \ sed 's/.........(....................).*/\1/; s/ //g'} if(~ $"m 01CD00101){ echo 9660 exit } +fn fat { + m=`{dd -if $1 -bs 1 -count 3 -skip $2 >[2]/dev/null} + ~ $"m FAT +} +if(fat $1 54 || fat $1 82){ + echo dos + exit +} dd -if $1 -count 1 >[2]/dev/null | \ awk ' /^kfs/{fs["kfs"]++} |