From e151596a03089e9863cbe99ff06e411d32f5a3bb Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Tue, 4 Jan 2011 23:33:07 +0100 Subject: Fix "doslowusb" and automatic "slowusb" behaviour. check_slowusb set FORCE_slowusb even when not strictly necessary, in newer linux kernels, there are more files inside /sys/bus/usb/drivers/usb-storage that have nothing to do with available devices. Moreover, start_dev_mgr was triggering 3 times the sleep() required, calling sdelay more than once. --- defaults/initrd.scripts | 12 ++++++++---- defaults/linuxrc | 4 ---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 3cc1de8..447d632 100755 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -411,10 +411,16 @@ setup_hotplug() { } check_slowusb() { + local usb_storage_dir="/sys/bus/usb/drivers/usb-storage" + if [ ! -d "${usb_storage_dir}" ] + then + return + fi [ "${DO_slowusb}" ] || \ - for dir in /sys/bus/usb/drivers/usb-storage/* + for x in "${usb_storage_dir}"/* do - [ -d "${dir}" ] && FORCE_slowusb="1" + [ -d "${x}" ] && [ "${x}" != "${usb_storage_dir}/module" ] \ + && FORCE_slowusb="1" done } @@ -422,9 +428,7 @@ start_dev_mgr() { if [ "${KV_2_6_OR_GREATER}" ] then cd /sys - [ "${DO_slowusb}" ] && sdelay check_slowusb - [ "${FORCE_slowusb}" ] && sdelay good_msg 'Activating mdev' runmdev [ "${DO_slowusb}" ] || \ diff --git a/defaults/linuxrc b/defaults/linuxrc index 3cc1ca2..59f1ea5 100755 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -699,10 +699,6 @@ then export CDBOOT CDBOOT=1 check_slowusb - if [ "${DO_slowusb}" ] || [ "${FORCE_slowusb}" ] - then - sleep 10 - fi else if [ "${USE_UNIONFS_NORMAL}" = '1' ] then -- cgit v1.2.3-18-g5258