* pci.rc : coldplug fix
@ 2003-12-23 15:52 MALET JL
2003-12-23 16:38 ` MALET JL
0 siblings, 1 reply; 2+ messages in thread
From: MALET JL @ 2003-12-23 15:52 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 419 bytes --]
hello,
this is the first time I write here :)
I discovered hotplog recently because devfs is no longer a "standard"
the first thing I tried is coldplug and..... nothing worked..... I
looked into the sources and find the problem in pci.rc
the pci.rc snapshot included here solve this issue and now coldplug work
on my pc.
It has the advantage of using only /proc and awk to generate the
pciID/vendorID
best regards
[-- Attachment #2: pci.rc --]
[-- Type: text/plain, Size: 775 bytes --]
[....]
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
echo $"** can't synthesize pci hotplug events"
return
fi
# make sure the pci agent will run
export ACTION=add
export PCI_CLASS=0
export PCI_ID=0:0
export PCI_SLOT=0:0.0
export PCI_SUBSYS_ID=0:0
# these notifications will be handled by pcimodules
gawk -F' ' '{printf("%s:%s\n",toupper(substr($2,0,4)), toupper(substr($2,5,4)) )}' /proc/bus/pci/devices |
while read PCI_ID; do
/sbin/hotplug pci
done
}
[....]
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: pci.rc : coldplug fix
2003-12-23 15:52 pci.rc : coldplug fix MALET JL
@ 2003-12-23 16:38 ` MALET JL
0 siblings, 0 replies; 2+ messages in thread
From: MALET JL @ 2003-12-23 16:38 UTC (permalink / raw)
To: linux-hotplug
MALET JL a écrit :
> hello,
> this is the first time I write here :)
> I discovered hotplog recently because devfs is no longer a "standard"
> the first thing I tried is coldplug and..... nothing worked..... I
> looked into the sources and find the problem in pci.rc
> the pci.rc snapshot included here solve this issue and now coldplug
> work on my pc.
> It has the advantage of using only /proc and awk to generate the
> pciID/vendorID
> best regards
>
>------------------------------------------------------------------------
>
>[....]
>
>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
> echo $"** can't synthesize pci hotplug events"
> return
> fi
>
> # make sure the pci agent will run
> export ACTIONd
> export PCI_CLASS=0
> export PCI_ID=0:0
> export PCI_SLOT=0:0.0
> export PCI_SUBSYS_ID=0:0
>
> # these notifications will be handled by pcimodules
> gawk -F' ' '{printf("%s:%s\n",toupper(substr($2,0,4)), toupper(substr($2,5,4)) )}' /proc/bus/pci/devices |
> while read PCI_ID; do
> /sbin/hotplug pci
> done
>}
>
>[....]
>
>
now I see another modification that can reduce the code :
pci_boot_events ()
{
# make sure the pci agent will run
export ACTIONd
export PCI_CLASS=0
export PCI_ID=0:0
export PCI_SLOT=0:0.0
export PCI_SUBSYS_ID=0:0
# these notifications will be handled by pcimodules
gawk -F' ' '{printf("%s:%s\n",toupper(substr($2,0,4)), toupper(substr($2,5,4)) )}' /proc/bus/pci/devices |
while read PCI_ID; do
/sbin/hotplug pci
done
}
notice the fact that
1) sysfs isn't needed : use of /proc/bus/*
2) lspci isn't needed too : same information can be gathered in /proc/bus/pci/devices
3) pcimodules is furthermore not required
-------------------------------------------------------
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\x1278&alloc_id371&opÌk
_______________________________________________
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-12-23 16:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-23 15:52 pci.rc : coldplug fix MALET JL
2003-12-23 16:38 ` MALET JL
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).