]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/boot/nusbrc
usbxhci: commit work in progress xhci driver, no config yet
[plan9front.git] / sys / src / 9 / boot / nusbrc
index 28e467a71a866c2e6066ca04094b92aaba4a8694..6c8ee5715d1c4d7a5a4f51f5d51cdcab908ce119 100755 (executable)
@@ -33,20 +33,20 @@ if(! nusb/usbd)
                                # CDC ethernet
                                nusb/ether $etherargs $id
                        case *08
-                               if(nusb/disk $id) {@{
+                               if(nusb/disk $id) @{
                                        rfork ne
                                        cd '#σ/usb'
                                        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
                                                        exit
                                                }
                                        }
-                               }&}
+                               }
                        case *
                                # Raspberry Pi ethernet will always appear as /net/etherU0
                                if(~ $2 0424)
@@ -61,5 +61,9 @@ if(! nusb/usbd)
        rc < '#σ/usb/usbevent' &
 }
 
+# usbd removes this file once all devices have been enumerated
+while(test -e /env/usbbusy)
+       sleep 1
+
 bind -a '#σ/usb' /dev
 bind -a '#σ/usbnet' /net