move usb ethernet in bootfs.paq

This commit is contained in:
cinap_lenrek 2012-12-05 13:53:34 +01:00
parent 96cc3eb2ee
commit 0750687012
4 changed files with 39 additions and 28 deletions

View file

@ -4,9 +4,6 @@ if(! test -e '#σ/usb/usbevent')
exit exit
if(! bind -a '#u' /dev) if(! bind -a '#u' /dev)
exit exit
mkdir -p -m 700 '#σc/usbnet'
@{ @{
rfork ne rfork ne
fn attach { fn attach {
@ -16,7 +13,8 @@ mkdir -p -m 700 '#σc/usbnet'
case *02 case *02
# serial and ethernet # serial and ethernet
nusb/serial $1 nusb/serial $1
nusb/ether $1 # handled /sys/src/9/boot/nusbrc
# nusb/ether $1
case *03 case *03
# handled /sys/src/9/boot/nusbrc # handled /sys/src/9/boot/nusbrc
# nusb/kb $1 # nusb/kb $1
@ -28,13 +26,10 @@ mkdir -p -m 700 '#σc/usbnet'
} }
} }
fn detach { fn detach {
switch($4){ # handled /sys/src/9/boot/nusbrc
case *02
rm -f '#σ/usbnet/'^$1.*
}
} }
rc < '#σ/usb/usbevent' & rc < '#σ/usb/usbevent' &
} }
bind -a '#σ/usb' /dev bind -qa '#σ/usb' /dev
bind -a '#σ/usbnet' /net bind -qa '#σ/usbnet' /net

View file

@ -49,22 +49,27 @@ fn bootfs{
} }
fn connectlocal{ fn connectlocal{
if(test -f $1) if(~ $#* 0){
t=`{fstype $1} echo local method needs an argument
if not {
t=$1; shift
} }
switch($t){ if not {
case '' if(test -f $1)
fatal unknown fstype $1 t=`{fstype $1}
case 9660 if not {
bootfs 9660srv $* t=$1; shift
case dos }
bootfs dossrv $* switch($t){
case kfs case ''
bootfs disk/kfs $* fatal unknown fstype $1
case * case 9660
bootfs $t $* bootfs 9660srv $*
case dos
bootfs dossrv $*
case kfs
bootfs disk/kfs $*
case *
bootfs $t $*
}
} }
} }

View file

@ -1,7 +1,10 @@
#!/bin/rc #!/bin/rc
if(! bind -a '#u' /dev) if(! bind -a '#u' /dev)
exit exit
mkdir -m 0700 '#σc/usb'
mkdir -p -m 700 '#σc/usb'
mkdir -p -m 700 '#σc/usbnet'
if(! nusb/usbd) if(! nusb/usbd)
exit exit
@ -11,6 +14,8 @@ if(! nusb/usbd)
switch($4){ switch($4){
case *03 case *03
nusb/kb $1 & nusb/kb $1 &
case *02
nusb/ether $1 &
case *08 case *08
@{ @{
rfork ne rfork ne
@ -26,13 +31,18 @@ if(! nusb/usbd)
} }
} }
} & } &
case *
if(~ $2 0424 && ~ $3 ec00){
# raspberry pi ethernet
nusb/ether $1 &
}
} }
} }
fn detach { fn detach {
rm -rf '#σc/usb/'^$1.* '#σc/sdU'^$1.* rm -rf '#σc/usb/'^$1.* '#σc/sdU'^$1.* '#σc/usbnet/'^$1.*
} }
rc < '#σ/usb/usbevent' & rc < '#σ/usb/usbevent' &
} }
bind -a '#σ/usb' /dev bind -a '#σ/usb' /dev
bind -a '#σ/usbnet' /net

View file

@ -34,6 +34,7 @@ $objtype
unmount unmount
nusb nusb
usbd usbd
ether
disk disk
kb kb
xd xd