From 5a33ee4b485a902051beeece531d1e70b1fa73c0 Mon Sep 17 00:00:00 2001 From: Peter Hjalmarsson Date: Tue, 22 Mar 2011 12:31:19 +0100 Subject: [PATCH] Fix handling of doslowusb/noslowusb 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 | 7 +++++++ defaults/initrd.defaults | 2 +- defaults/initrd.scripts | 11 ++++++----- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ed477d..e4127a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,13 @@ # Distributed under the GPL v2 # $Id$ + 22 Mar 2011; Peter Hjalmarsson 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 genkernel: Bump version to 3.4.14 diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults index 14a403f..fd6d9fc 100755 --- a/defaults/initrd.defaults +++ b/defaults/initrd.defaults @@ -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' diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 10fdb13..4a12b73 100755 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -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}" ] -- 2.26.2