From: mru@kth.se (Måns Rullgård)
To: linux-kernel@vger.kernel.org
Cc: linux-hotplug-devel@lists.sourceforge.net,
linux-usb-devel@lists.sourceforge.net,
linux-usb-users@lists.sourceforge.net
Subject: Re: [ANNOUNCE] 2004-01-05 release of hotplug scripts
Date: Mon, 05 Jan 2004 18:43:58 +0000 [thread overview]
Message-ID: <yw1x8ykm2q35.fsf@ford.guide> (raw)
In-Reply-To: 20040105183058.GA22066@kroah.com
[-- Attachment #1: Type: text/plain, Size: 380 bytes --]
Greg KH <greg@kroah.com> writes:
> This release is recommended for _anyone_ using the 2.6.0 and beyond
> kernels who is still using hotplug scripts older than 2003_08_05, as a
> number of changes have been made in order to support the 2.6 kernel
> properly.
This patch makes things work better on my laptop running linux
2.6.1-rc1. Most likely it can be done in a better way.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: hotplug-linux2.6.diff --]
[-- Type: text/x-patch, Size: 2680 bytes --]
Index: etc/hotplug/hotplug.functions
===================================================================
RCS file: /cvsroot/linux-hotplug/admin/etc/hotplug/hotplug.functions,v
retrieving revision 1.22
diff -u -r1.22 hotplug.functions
--- etc/hotplug/hotplug.functions 7 Oct 2003 21:15:38 -0000 1.22
+++ etc/hotplug/hotplug.functions 5 Jan 2004 18:33:33 -0000
@@ -139,7 +139,7 @@
do
# maybe driver modules need loading
LOADED=false
- if ! lsmod | grep -q "^$MODULE " > /dev/null 2>&1; then
+ if ! lsmod | grep -q "^${MODULE//-/_} " > /dev/null 2>&1; then
if grep -q "^$MODULE\$" $HOTPLUG_DIR/blacklist \
>/dev/null 2>&1; then
debug_mesg "... blacklisted module: $MODULE"
Index: etc/hotplug/pci.agent
===================================================================
RCS file: /cvsroot/linux-hotplug/admin/etc/hotplug/pci.agent,v
retrieving revision 1.13
diff -u -r1.13 pci.agent
--- etc/hotplug/pci.agent 16 Sep 2003 19:42:17 -0000 1.13
+++ etc/hotplug/pci.agent 5 Jan 2004 18:33:33 -0000
@@ -147,7 +147,7 @@
add)
pci_convert_vars
- LABEL="PCI slot $PCI_SLOT_NAME"
+ LABEL="PCI slot $PCI_SLOT"
# on 2.4 systems, modutils maintains MAP_CURRENT
if [ -r $MAP_CURRENT ]; then
Index: etc/hotplug/pci.rc
===================================================================
RCS file: /cvsroot/linux-hotplug/admin/etc/hotplug/pci.rc,v
retrieving revision 1.7
diff -u -r1.7 pci.rc
--- etc/hotplug/pci.rc 6 Jun 2003 18:27:23 -0000 1.7
+++ etc/hotplug/pci.rc 5 Jan 2004 18:33:33 -0000
@@ -25,6 +25,11 @@
# . /etc/sysconfig/pci
# fi
+sys_file ()
+{
+ cut -f2 -dx $DEVICE/$1
+}
+
pci_boot_events ()
{
#
@@ -46,14 +51,27 @@
PCI_SUBSYS_ID=0:0
export ACTION PCI_CLASS PCI_ID PCI_SLOT PCI_SUBSYS_ID
- # these notifications will be handled by pcimodules
- for BUS in `cd /proc/bus/pci;find * -type d -print`; do
- for SLOT_FUNC in `cd /proc/bus/pci/$BUS; echo *`; do
- PCI_SLOT=$BUS:$SLOT_FUNC
- : hotplug pci for $PCI_SLOT
- /sbin/hotplug pci
+ case $KERNEL in
+ 2.5*|2.6*)
+ for DEVICE in /sys/bus/pci/devices/*; do
+ PCI_CLASS=`sys_file class`
+ PCI_ID=`sys_file vendor`:`sys_file device`
+ PCI_SLOT=`echo $DEVICE | cut -d: -f2-`
+ PCI_SUBSYS_ID=`sys_file subsystem_vendor`:`sys_file subsystem_device`
+ /sbin/hotplug pci
+ done
+ ;;
+ 2.4*)
+ # these notifications will be handled by pcimodules
+ for BUS in `cd /proc/bus/pci;find * -type d -print`; do
+ for SLOT_FUNC in `cd /proc/bus/pci/$BUS; echo *`; do
+ PCI_SLOT=$BUS:$SLOT_FUNC
+ : hotplug pci for $PCI_SLOT
+ /sbin/hotplug pci
+ done
done
- done
+ ;;
+ esac
}
# See how we were called.
[-- Attachment #3: Type: text/plain, Size: 34 bytes --]
--
Måns Rullgård
mru@kth.se
next prev parent reply other threads:[~2004-01-05 18:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-05 18:30 [ANNOUNCE] 2004-01-05 release of hotplug scripts Greg KH
2004-01-05 18:43 ` Måns Rullgård [this message]
2004-01-05 20:26 ` Marco d'Itri
2004-01-05 21:39 ` wwp
2004-01-05 22:24 ` Greg KH
2004-01-05 22:24 ` Greg KH
2004-01-05 23:27 ` David Brownell
2004-03-29 15:45 ` Måns Rullgård
2004-03-29 15:45 ` Måns Rullgård
2004-03-29 15:45 ` Martin Schlemmer
2004-03-29 15:45 ` Martin Schlemmer
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=yw1x8ykm2q35.fsf@ford.guide \
--to=mru@kth.se \
--cc=linux-hotplug-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
--cc=linux-usb-users@lists.sourceforge.net \
/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).