linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Borzenkov <arvidjaar@mail.ru>
To: linux-hotplug@vger.kernel.org
Subject: [PATCH] usb.rc - fix coldplug on 2.6 (no lister defined)
Date: Wed, 06 Aug 2003 19:12:26 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-106019729816672@msgid-missing> (raw)

[-- Attachment #1: Type: text/plain, Size: 200 bytes --]

On 2.6 lister is not used, but coldplug does not pass any information 
sufficient to find module. The patch makes it use sysfs and pass DEVPATH so 
usb.agent can get them from sysfs.

regards

-andrey

[-- Attachment #2: hotplug-2003_05_01-usb.rc-coldplug26.patch --]
[-- Type: text/x-diff, Size: 986 bytes --]

--- hotplug-2003_05_01/etc/hotplug/usb.rc.coldplug26	2003-07-31 14:39:01.000000000 +0400
+++ hotplug-2003_05_01/etc/hotplug/usb.rc	2003-07-31 23:40:17.000000000 +0400
@@ -125,6 +125,9 @@
 	DEVICE=
 	export DEVFS DEVICE
 
+	DEVPATH=
+	export DEVPATH
+
 	# these notifications will be handled by usbmodules
 	# NOTE: we're not providing a full set of hotplug
 	# parameters for USB.  that's why "usbmodules" is a
@@ -134,10 +137,21 @@
 	# FIXME usbmodules, or something, should set real
 	# PRODUCT and DEVICE strings so /etc/hotplug/usb/*
 	# scripts can rely on them ...
-	for DEVICE in /proc/bus/usb/*/*
-	do
+	#
+	# for 2.6 lister is disabled so either this should be fixed
+	# or we just use sysfs
+	if [ -d /sys/bus/usb/devices ]; then
+	    declare device
+	    for device in /sys/bus/usb/devices/*; do
+		DEVPATH=${device#/sys/}
 		/etc/hotplug/usb.agent
-	done
+	    done
+	else
+	    for DEVICE in /proc/bus/usb/*/*
+	    do
+		    /etc/hotplug/usb.agent
+	    done
+	fi
 }
 
 

             reply	other threads:[~2003-08-06 19:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-06 19:12 Andrey Borzenkov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-02-22  9:59 [PATCH] usb.rc - fix coldplug on 2.6 (no lister defined) Andrey Borzenkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-hotplug-106019729816672@msgid-missing \
    --to=arvidjaar@mail.ru \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).