Fix handling of doslowusb/noslowusb
authorPeter Hjalmarsson <xake@rymdraket.net>
Tue, 22 Mar 2011 11:31:19 +0000 (12:31 +0100)
committerPeter Hjalmarsson <xake@rymdraket.net>
Tue, 22 Mar 2011 11:31:19 +0000 (12:31 +0100)
Set DO_slowusb as default, and make setup_slowusb unset it if it cannot find
a usb-storage attached. This makes genkernel ramdisk adhere to "noslowusb",
makes the ramdisk only wait if there is a usb-storage attached and should fix
gentoo bug #359619.

ChangeLog
defaults/initrd.defaults
defaults/initrd.scripts

index 0ed477d2e76e28f796e232b6a97e5ff5c9ee2acb..e4127a22f561ffb0ce04993af7dba9eaa9f24ab9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,13 @@
 # Distributed under the GPL v2
 # $Id$
 
+  22 Mar 2011; Peter Hjalmarsson <xake@rymdraket.net> defaults/initrd.defaults,
+  defaults/initrd.scripts:
+  Set DO_slowusb as default, and make setup_slowusb unset it if it cannot find
+  a usb-storage attached. This makes genkernel ramdisk adhere to "noslowusb",
+  makes the ramdisk only wait if there is a usb-storage attached and should fix
+  gentoo bug #359619.
+
   16 Mar 2011; Sebastian Pipping <sping@gentoo.org> genkernel:
   Bump version to 3.4.14
 
index 14a403ff1176578f5b48b06fa8e5efe8a3c3fbaf..fd6d9fc72183141009d4e0c62ed1006867e9e8f1 100755 (executable)
@@ -80,4 +80,4 @@ DEFAULT_NFSOPTIONS="ro,nolock,rsize=1024,wsize=1024"
 # Only sections that are in by default or those that
 # are not module groups need to be defined here...
 HWOPTS='keymap cache modules pata sata scsi usb firewire waitscan slowusb evms lvm dmraid mdadm fs net'
-MY_HWOPTS='modules pata sata scsi usb firewire waitscan dmraid mdadm fs net iscsi'
+MY_HWOPTS='modules pata sata scsi slowusb usb firewire waitscan dmraid mdadm fs net iscsi'
index 10fdb137f4458dc11c4cd6950f904f83608f2c5d..4a12b73ed44abd4a5c45e435ea7bb158d1c574ea 100755 (executable)
@@ -419,11 +419,12 @@ setup_hotplug() {
 }
 
 setup_slowusb() {
-       # slowusb already set?
-       if [ "${DO_slowusb}" = "1" ]
-       then
-               return
-       fi
+       # This function removes unset DO_slowusb if there is no usb-storage attached.
+       # If noslowusb is set, skip this function
+       [ "${DO_slowusb}" ] || return
+
+       # Unset DO_slowusb, so we can set it again if usb-storage has something attached
+       unset DO_slowusb
 
        local usb_storage_dir="/sys/bus/usb/drivers/usb-storage"
        if [ ! -d "${usb_storage_dir}" ]