diff options
author | cinap_lenrek <cinap_lenrek@localhost> | 2011-08-01 02:55:39 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@localhost> | 2011-08-01 02:55:39 +0200 |
commit | 6f3039351a35eb4310cfa1fc5dec802e74ad73f8 (patch) | |
tree | 8fffdc056a5b071099c1ec3fe06f9b3334dfe757 /rc/bin/nusbrc | |
parent | b43de8eb1fb64d545b12b987646a5823d2e42caf (diff) | |
download | plan9front-6f3039351a35eb4310cfa1fc5dec802e74ad73f8.tar.xz |
nusb: add /rc/bin/nusbrc
Diffstat (limited to 'rc/bin/nusbrc')
-rw-r--r-- | rc/bin/nusbrc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/rc/bin/nusbrc b/rc/bin/nusbrc new file mode 100644 index 000000000..624ec527e --- /dev/null +++ b/rc/bin/nusbrc @@ -0,0 +1,31 @@ +#!/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 + case *03 + # handled /sys/src/9/boot/nusbrc + # nusb/kb $1 + case *08 + # handled /sys/src/9/boot/nusbrc + # nusb/disk $1 + } + } + fn detach { + # handled /sys/src/9/boot/nusbrc + } + rc < '#σ/usb/usbevent' & +} + +bind -a '#σ/usb' /dev |