Skip to contentSkip to conversation

Hot/Cold plug patch to fix USB Scanner/etc on boot issues

PATCH Kelly Price 1 participant 2 messages Jun 4, 2005 – Jun 5, 2005

lore
Share & tools
lore
#0 lore raw

I had posted this patch on Gentoo's bugzilla, but apparently the maintainer didn't apply it yet. This one fixes the incorrect DEVICE path reported on USB devices plugged in before the system is booted, and "coldplugged" -- most notibly scanners.

Gentoo's Bug entry is:
http://bugs.gentoo.org/show_bug.cgi?id=83738

Signature · 2 lines
Kelly "STrRedWolf" Price
http://strredwolf.furrynet.com
usb.rc renamed from usb.rc-old +1 -1
@@ -94,7 +94,7 @@
 			PRODUCT="$(cat $devlink/../idVendor)/$(cat $devlink/../idProduct)/$(cat $devlink/../bcdDevice)"
 		        if [ -f $devlink/../../devnum ]
 			then
-			    devbus=$( ( echo -n 000 ; cat $devlink/../../devnum ) | grep -o ...\$ )
+			    devbus=$( ( echo -n 000`echo $devlink| sed 's/^.*usb\([0-9]\+\)\/.*$/\1/'` ) | grep -o ...\$ )
 			    devdev=$( ( echo -n 000 ; cat $devlink/../devnum ) | grep -o ...\$ )
 			    DEVICE="/proc/bus/usb/$devbus/$devdev"
 			else
#1 lore raw
Quoted 7 lines · Kelly Price

I had posted this patch on Gentoo's bugzilla, but apparently the maintainer didn't apply it yet. This one fixes the incorrect DEVICE path reported on USB devices plugged in before the system is booted, and "coldplugged" -- most notibly scanners.

Gentoo's Bug entry is:
http://bugs.gentoo.org/show_bug.cgi?idƒ738

--
Kelly "STrRedWolf" Price
http://strredwolf.furrynet.com

usb.rc renamed from usb.rc-old +0 -0
@@ -94,7 +94,7 @@
 			PRODUCT="$(cat $devlink/../idVendor)/$(cat

$devlink/../idProduct)/$(cat $devlink/../bcdDevice)"
if [ -f $devlink/../../devnum ]
then
- devbus=$( ( echo -n 000 ; cat $devlink/../../devnum ) | grep -o ...\$ )
+ devbus=$( ( echo -n 000`echo $devlink| sed
's/^.*usb\([0-9]\+\)\/.*$/\1/'` ) | grep -o ...\$ )
devdev=$( ( echo -n 000 ; cat $devlink/../devnum ) | grep -o ...\$ ) DEVICE="/proc/bus/usb/$devbus/$devdev"
else

-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel