From mboxrd@z Thu Jan 1 00:00:00 1970 From: mjl Date: Wed, 04 Feb 2004 19:46:18 +0000 Subject: PATCH pci.rc with lspci instead of deprecated /proc/pci Message-Id: <40214C0A.5070307@laposte.net> MIME-Version: 1 Content-Type: multipart/mixed; boundary="------------080102090905070906000403" List-Id: To: linux-hotplug@vger.kernel.org This is a multi-part message in MIME format. --------------080102090905070906000403 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit greetings this patch is for using lspci to generate pci semi coldplug events (ie load the modules...) regards --------------080102090905070906000403 Content-Type: text/plain; name="hotplug.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="hotplug.patch" diff -ru hotplug-2004_01_05/etc/hotplug/pci.rc hotplug-jlm/etc/hotplug/pci.rc --- hotplug-2004_01_05/etc/hotplug/pci.rc 2003-06-28 02:13:10.000000000 +0200 +++ hotplug-jlm/etc/hotplug/pci.rc 2004-02-04 20:37:52.840130176 +0100 @@ -27,13 +27,9 @@ pci_boot_events () { - # - # FIXME on 2.5, /sys/bus/pci/devices gives some of this - # information, and more can be gotten with 'lspci'. - # don't expect pcimodules to exist!! - # - LISTER=`type -p pcimodules` - if [ "$LISTER" = "" -o ! -f /proc/bus/pci/devices -o ! -x pci.agent ]; then + + LISTER=`type -p lspci` + if [ "$LISTER" = "" -o ! -x pci.agent ]; then echo $"** can't synthesize pci hotplug events" return fi @@ -47,13 +43,11 @@ 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 + lspci -n | gawk -F ' ' '{printf"%s\n",toupper($4)}' | + while read PCI_ID; do : hotplug pci for $PCI_SLOT /sbin/hotplug pci - done - done + done } # See how we were called. --------------080102090905070906000403-- ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ 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