From 1b719f236f33a00185103f3a1e3379e9ecc48cd9 Mon Sep 17 00:00:00 2001 From: jonas Date: Sun, 22 Oct 2006 20:02:27 +0000 Subject: 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 --- usbreset.sh | 15 +++++++++++---- 1 file 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 -- cgit v1.2.3