diff options
author | jonas <jonas@8f53b18a-e215-0410-8885-9f593d34873e> | 2006-10-22 20:02:27 +0000 |
---|---|---|
committer | jonas <jonas@8f53b18a-e215-0410-8885-9f593d34873e> | 2006-10-22 20:02:27 +0000 |
commit | 1b719f236f33a00185103f3a1e3379e9ecc48cd9 (patch) | |
tree | 76ab82fe368f9fe4dcc79bbe23f9a44699523563 | |
parent | bd5fe89f34712cee3aaaa136db954e8000967b08 (diff) |
Rewrite usbreset.sh to load modules explicitly (hotplug is going away).
git-svn-id: svn+ssh://xayide/home/jonas/private_svn/fleshybrid/homebase@46 8f53b18a-e215-0410-8885-9f593d34873e
-rwxr-xr-x | usbreset.sh | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/usbreset.sh b/usbreset.sh index b481513..ef4529b 100755 --- a/usbreset.sh +++ b/usbreset.sh @@ -1,7 +1,14 @@ #!/bin/sh -invoke-rc.d hotplug stop -for mod in sd_mod usb-storage scsi_mod uhci ehci-hcd usbcore; do - modprobe -r $mod +# Unload andd then reload USB drivers, to reset to using sda for new stick + +# Try 2.4 and then 2.6 names: uhci/uhci_hcd +usbchain="usbcore ehci-hcd uhci uhci_hcd ohci_hcd scsi_mod usb_storage sd_mod" +usbchain_reverse="$(echo $usbchain | tr '[:space:]' '\n' | tac -)" + +for module in $usbchain_reverse; do + modprobe -q -r $module || true +done +for module in $usbchain; do + modprobe -q $module || true done -invoke-rc.d hotplug start |