From mboxrd@z Thu Jan 1 00:00:00 1970 From: mru@kth.se (=?iso-8859-1?q?M=E5ns_Rullg=E5rd?=) Date: Mon, 05 Jan 2004 18:43:58 +0000 Subject: Re: [ANNOUNCE] 2004-01-05 release of hotplug scripts Message-Id: MIME-Version: 1 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: References: <20040105183058.GA22066@kroah.com> 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 --=-=-= Greg KH 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. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=hotplug-linux2.6.diff 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. --=-=-= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable --=20 M=E5ns Rullg=E5rd mru@kth.se --=-=-=-- ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel