nusbrc: handle fat formated usb drives without partition table

on some usb drives, there is no dos partition table, so check
the filesystem type and consider the whole drive.
This commit is contained in:
cinap_lenrek 2015-06-28 21:50:30 +02:00
parent 37156fb0b2
commit 4aee2b803e

View file

@ -39,7 +39,7 @@ if(! nusb/usbd)
devs=sdU^($1 $5)
for(dev in $devs $devs.*) if(test -d $dev) {
diskparts $dev
for(part in $dev/dos* $dev/9fat) if(test -r $part) {
for(part in $dev/dos* $dev/9fat* $dev/data) if(test -r $part && ~ `{fstype $part} dos) {
mkdir -m 0700 '#σc/'^$dev || exit
{dossrv -s -f $part &} <[0=1] |
echo 0 >'#σc/'^$dev/dos