plan9fox/rc/bin/nusbrc

36 lines
553 B
Text
Raw Normal View History

2011-08-01 02:55:39 +02:00
#!/bin/rc
if(! test -e '#σ/usb/usbevent')
exit
if(! bind -a '#u' /dev)
exit
@{
rfork ne
fn attach {
switch($4){
case *01
nusb/audio $1
case *02
# serial and ethernet
nusb/serial $1
2012-12-05 13:53:34 +01:00
# handled /sys/src/9/boot/nusbrc
# nusb/ether $1
2011-08-01 02:55:39 +02:00
case *03
# handled /sys/src/9/boot/nusbrc
# nusb/kb $1
case *08
# handled /sys/src/9/boot/nusbrc
# nusb/disk $1
2011-08-16 01:50:46 +02:00
case *10106
nusb/ptp $1
2011-08-01 02:55:39 +02:00
}
}
fn detach {
2012-12-05 13:53:34 +01:00
# handled /sys/src/9/boot/nusbrc
2011-08-01 02:55:39 +02:00
}
rc < '#σ/usb/usbevent' &
}
2012-12-05 13:53:34 +01:00
bind -qa '#σ/usb' /dev
bind -qa '#σ/usbnet' /net