aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/pciutils
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/pciutils
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
downloadopenembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.tar.gz
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/pciutils')
-rw-r--r--recipes/pciutils/pciutils-2.1.11/configure-uclibc.patch11
-rw-r--r--recipes/pciutils/pciutils-2.1.11/configure.patch35
-rw-r--r--recipes/pciutils/pciutils-2.1.11/pcimodules-pciutils-2.1.11.diff340
-rw-r--r--recipes/pciutils/pciutils-2.2.4/configure-uclibc.patch21
-rw-r--r--recipes/pciutils/pciutils-2.2.4/configure.patch40
-rw-r--r--recipes/pciutils/pciutils-2.2.4/pcimodules-pciutils.diff349
-rw-r--r--recipes/pciutils/pciutils-3.1.2/pciutils.patch362
-rw-r--r--recipes/pciutils/pciutils_2.1.11.bb34
-rw-r--r--recipes/pciutils/pciutils_2.2.4.bb60
-rw-r--r--recipes/pciutils/pciutils_3.1.2.bb59
10 files changed, 1311 insertions, 0 deletions
diff --git a/recipes/pciutils/pciutils-2.1.11/configure-uclibc.patch b/recipes/pciutils/pciutils-2.1.11/configure-uclibc.patch
new file mode 100644
index 0000000000..7ecf490f28
--- /dev/null
+++ b/recipes/pciutils/pciutils-2.1.11/configure-uclibc.patch
@@ -0,0 +1,11 @@
+--- pciutils/lib/configure.orig 2004-06-22 10:51:26.000000000 -0500
++++ pciutils/lib/configure 2004-06-22 11:19:48.000000000 -0500
+@@ -31,7 +31,7 @@
+ echo_n "Looking for access methods..."
+
+ case $sys in
+- [lL]inux)
++ [lL]inux*)
+ case $rel in
+ 2.[1-9]*|[3-9]*) echo_n " proc"
+ echo >>$c '#define HAVE_PM_LINUX_PROC'
diff --git a/recipes/pciutils/pciutils-2.1.11/configure.patch b/recipes/pciutils/pciutils-2.1.11/configure.patch
new file mode 100644
index 0000000000..224d2f44de
--- /dev/null
+++ b/recipes/pciutils/pciutils-2.1.11/configure.patch
@@ -0,0 +1,35 @@
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+--- pciutils-2.1.11/lib/configure~configure 2003-01-04 07:29:23.000000000 -0500
++++ pciutils-2.1.11/lib/configure 2004-01-19 12:33:45.000000000 -0500
+@@ -12,15 +12,15 @@
+ echo_n "Configuring libpci for your system..."
+ sharedir=${1:-/usr/share}
+ version=${2:-0.0}
+-sys=`uname -s`
+-rel=`uname -r`
++sys=${3:-`uname -s`}
++rel=${4:-`uname -r`}
+ if [ "$sys" = "AIX" -a -x /usr/bin/oslevel -a -x /usr/sbin/lsattr ]
+ then
+ rel=`/usr/bin/oslevel`
+ proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
+ cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
+ else
+- cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/'`
++ cpu=${5:-`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/'`}
+ fi
+ echo " $sys/$cpu $rel"
+
+@@ -31,7 +31,7 @@
+ echo_n "Looking for access methods..."
+
+ case $sys in
+- Linux)
++ [lL]inux)
+ case $rel in
+ 2.[1-9]*|[3-9]*) echo_n " proc"
+ echo >>$c '#define HAVE_PM_LINUX_PROC'
diff --git a/recipes/pciutils/pciutils-2.1.11/pcimodules-pciutils-2.1.11.diff b/recipes/pciutils/pciutils-2.1.11/pcimodules-pciutils-2.1.11.diff
new file mode 100644
index 0000000000..aeda072e87
--- /dev/null
+++ b/recipes/pciutils/pciutils-2.1.11/pcimodules-pciutils-2.1.11.diff
@@ -0,0 +1,340 @@
+--- ./Makefile.orig 2003-01-04 04:53:01.000000000 -0800
++++ ./Makefile 2003-02-20 23:22:56.000000000 -0800
+@@ -31,7 +31,7 @@
+
+ export
+
+-all: lib lspci setpci lspci.8 setpci.8 update-pciids update-pciids.8 pci.ids
++all: lib lspci setpci pcimodules lspci.8 setpci.8 update-pciids update-pciids.8 pcimodules.8 pci.ids
+
+ lib: lib/config.h
+ $(MAKE) -C lib all
+@@ -39,9 +39,11 @@
+ lib/config.h:
+ cd lib && ./configure $(SHAREDIR) $(VERSION)
+
++pcimodules: pcimodules.o common.o lib/$(PCILIB)
+ lspci: lspci.o common.o lib/$(PCILIB)
+ setpci: setpci.o common.o lib/$(PCILIB)
+
++pcimodules.o: pcimodules.c pciutils.h
+ lspci.o: lspci.c pciutils.h
+ setpci.o: setpci.c pciutils.h
+ common.o: common.c pciutils.h
+@@ -59,15 +61,15 @@
+ install: all
+ # -c is ignored on Linux, but required on FreeBSD
+ $(DIRINSTALL) -m 755 $(SBINDIR) $(SHAREDIR) $(MANDIR)/man8
+- $(INSTALL) -c -m 755 -s lspci setpci $(SBINDIR)
++ $(INSTALL) -c -m 755 lspci setpci pcimodules $(SBINDIR)
+ $(INSTALL) -c -m 755 update-pciids $(SBINDIR)
+ $(INSTALL) -c -m 644 pci.ids $(SHAREDIR)
+- $(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 $(MANDIR)/man8
++ $(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 pcimodules.8 $(MANDIR)/man8
+
+ uninstall: all
+- rm -f $(SBINDIR)/lspci $(SBINDIR)/setpci $(SBINDIR)/update-pciids
++ rm -f $(SBINDIR)/lspci $(SBINDIR)/setpci $(SBINDIR)/update-pciids $(SBINDIR)/pcimodules
+ rm -f $(SHAREDIR)/pci.ids
+- rm -f $(MANDIR)/man8/lspci.8 $(MANDIR)/man8/setpci.8 $(MANDIR)/man8/update-pciids.8
++ rm -f $(MANDIR)/man8/lspci.8 $(MANDIR)/man8/setpci.8 $(MANDIR)/man8/update-pciids.8 $(MANDIR)/man8/pcimodules.8
+
+ get-ids:
+ cp ~/tree/pciids/pci.ids pci.ids
+--- ./lspci.c.orig 2002-12-26 12:24:50.000000000 -0800
++++ ./lspci.c 2003-02-20 23:22:36.000000000 -0800
+@@ -107,8 +107,11 @@
+ d = xmalloc(sizeof(struct device));
+ bzero(d, sizeof(*d));
+ d->dev = p;
+- if (!pci_read_block(p, 0, d->config, how_much))
+- die("Unable to read %d bytes of configuration space.", how_much);
++ if (!pci_read_block(p, 0, d->config, how_much)) {
++ fprintf(stderr, "Unable to read %d bytes of configuration space.",
++ how_much);
++ return NULL;
++ }
+ if (how_much < 128 && (d->config[PCI_HEADER_TYPE] & 0x7f) == PCI_HEADER_TYPE_CARDBUS)
+ {
+ /* For cardbus bridges, we need to fetch 64 bytes more to get the full standard header... */
+--- ./pcimodules.c.orig 2003-02-20 23:22:36.000000000 -0800
++++ ./pcimodules.c 2003-02-20 23:22:36.000000000 -0800
+@@ -0,0 +1,183 @@
++/*
++ * pcimodules: Load all kernel modules for PCI device currently
++ * plugged into any PCI slot.
++ *
++ * Copyright 2000 Yggdrasil Computing, Incorporated
++ * This file may be copied under the terms and conditions of version
++ * two of the GNU General Public License, as published by the Free
++ * Software Foundation (Cambridge, Massachusetts, USA).
++ *
++ * This file is based on pciutils/lib/example.c, which has the following
++ * authorship and copyright statement:
++ *
++ * Written by Martin Mares and put to public domain. You can do
++ * with it anything you want, but I don't give you any warranty.
++ */
++
++#include <stdlib.h>
++#include <stdio.h>
++#include <malloc.h>
++#include <string.h>
++#include <unistd.h>
++#include <sys/utsname.h>
++#include <sys/param.h>
++#include <sys/types.h>
++
++#define _GNU_SOURCE
++#include <getopt.h>
++
++#include "pciutils.h"
++
++#define MODDIR "/lib/modules"
++#define PCIMAP "modules.pcimap"
++
++#define LINELENGTH 8000
++
++#define DEVICE_ANY 0xffffffff
++#define VENDOR_ANY 0xffffffff
++
++#include "lib/pci.h"
++
++struct pcimap_entry {
++ unsigned int vendor, subsys_vendor, dev, subsys_dev, class, class_mask;
++ char *module;
++ struct pcimap_entry *next;
++};
++
++static struct pcimap_entry *pcimap_list = NULL;
++
++#define OPT_STRING "h"
++static struct option long_options[] = {
++ {"class", required_argument, NULL, 'c'},
++ {"classmask", required_argument, NULL, 'm'},
++ {"help", no_argument, NULL, 'h'},
++ { 0, 0, 0, 0}
++};
++
++static unsigned long desired_class;
++static unsigned long desired_classmask; /* Default is 0: accept all classes.*/
++
++void
++read_pcimap(void)
++{
++ struct utsname utsname;
++ char filename[MAXPATHLEN];
++ FILE *pcimap_file;
++ char line[LINELENGTH];
++ struct pcimap_entry *entry;
++ unsigned int driver_data;
++ char *prevmodule = "";
++ char module[LINELENGTH];
++
++ if (uname(&utsname) < 0) {
++ perror("uname");
++ exit(1);
++ }
++ sprintf(filename, "%s/%s/%s", MODDIR, utsname.release, PCIMAP);
++ if ((pcimap_file = fopen(filename, "r")) == NULL) {
++ perror(filename);
++ exit(1);
++ }
++
++ while(fgets(line, LINELENGTH, pcimap_file) != NULL) {
++ if (line[0] == '#')
++ continue;
++
++ entry = xmalloc(sizeof(struct pcimap_entry));
++
++ if (sscanf(line, "%s 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x",
++ module,
++ &entry->vendor, &entry->dev,
++ &entry->subsys_vendor, &entry->subsys_dev,
++ &entry->class, &entry->class_mask,
++ &driver_data) != 8) {
++ fprintf (stderr,
++ "modules.pcimap unparsable line: %s.\n", line);
++ free(entry);
++ continue;
++ }
++
++ /* Optimize memory allocation a bit, in case someday we
++ have Linux systems with ~100,000 modules. It also
++ allows us to just compare pointers to avoid trying
++ to load a module twice. */
++ if (strcmp(module, prevmodule) != 0) {
++ prevmodule = xmalloc(strlen(module)+1);
++ strcpy(prevmodule, module);
++ }
++ entry->module = prevmodule;
++ entry->next = pcimap_list;
++ pcimap_list = entry;
++ }
++ fclose(pcimap_file);
++}
++
++/* Return a filled in pci_access->dev tree, with the device classes
++ stored in dev->aux.
++*/
++static void
++match_pci_modules(void)
++{
++ struct pci_access *pacc;
++ struct pci_dev *dev;
++ unsigned int class, subsys_dev, subsys_vendor;
++ struct pcimap_entry *map;
++ const char *prevmodule = "";
++
++ pacc = pci_alloc(); /* Get the pci_access structure */
++ /* Set all options you want -- here we stick with the defaults */
++ pci_init(pacc); /* Initialize the PCI library */
++ pci_scan_bus(pacc); /* We want to get the list of devices */
++ for(dev=pacc->devices; dev; dev=dev->next) {
++ pci_fill_info(dev, PCI_FILL_IDENT | PCI_FILL_BASES);
++ class = (pci_read_word(dev, PCI_CLASS_DEVICE) << 8)
++ | pci_read_byte(dev, PCI_CLASS_PROG);
++ subsys_dev = pci_read_word(dev, PCI_SUBSYSTEM_ID);
++ subsys_vendor = pci_read_word(dev,PCI_SUBSYSTEM_VENDOR_ID);
++ for(map = pcimap_list; map != NULL; map = map->next) {
++ if (((map->class ^ class) & map->class_mask) == 0 &&
++ ((desired_class ^ class) & desired_classmask)==0 &&
++ (map->dev == DEVICE_ANY ||
++ map->dev == dev->device_id) &&
++ (map->vendor == VENDOR_ANY ||
++ map->vendor == dev->vendor_id) &&
++ (map->subsys_dev == DEVICE_ANY ||
++ map->subsys_dev == subsys_dev) &&
++ (map->subsys_vendor == VENDOR_ANY ||
++ map->subsys_vendor == subsys_vendor) &&
++ prevmodule != map->module) {
++ printf("%s\n", map->module);
++ prevmodule = map->module;
++ }
++ }
++
++ }
++ pci_cleanup(pacc);
++}
++
++int
++main (int argc, char **argv)
++{
++ int opt_index = 0;
++ int opt;
++
++ while ((opt = getopt_long(argc, argv, OPT_STRING, long_options,
++ &opt_index)) != -1) {
++ switch(opt) {
++ case 'c':
++ desired_class = strtol(optarg, NULL, 0);
++ break;
++ case 'm':
++ desired_classmask = strtol(optarg, NULL, 0);
++ break;
++ case 'h':
++ printf ("Usage: pcimodules [--help]\n"
++ " Lists kernel modules corresponding to PCI devices currently plugged"
++ " into the computer.\n");
++ }
++ }
++
++ read_pcimap();
++ match_pci_modules();
++ return 0;
++}
+--- ./pcimodules.man.orig 2003-02-20 23:22:36.000000000 -0800
++++ ./pcimodules.man 2003-02-20 23:22:36.000000000 -0800
+@@ -0,0 +1,92 @@
++.TH pcimodules 8 "@TODAY@" "@VERSION@" "Linux PCI Utilities"
++.IX pcimodules
++.SH NAME
++pcimodules \- List kernel driver modules available for all currently plugged
++in PCI devices
++.SH SYNOPSIS
++.B pcimodules
++.RB [ --class class_id ]
++.RB [ --classmask mask ]
++.RB [ --help ]
++.SH DESCRIPTION
++.B pcimodules
++lists all driver modules for all currently plugged in PCI devices.
++.B pcimodules
++should be run at boot time, and whenever a PCI device is "hot plugged"
++into the system. This can be done by the following Bourne shell syntax:
++.IP
++ for module in $(pcimodules) ; do
++.IP
++ modprobe -s -k "$module"
++.IP
++ done
++.PP
++When a PCI device is removed from the system, the Linux kernel will
++decrement a usage count on PCI driver module. If this count drops
++to zero (i.e., there are no PCI drivers), then the
++.B modprobe -r
++process that is normally configured to run from cron every few minutes
++will eventually remove the unneeded module.
++.PP
++The --class and --classmask arguments can be used to limit the search
++to certain classes of PCI devices. This is useful, for example, to
++generate a list of ethernet card drivers to be loaded when the kernel
++has indicated that it is trying to resolve an unknown network interface.
++.PP
++Modules are listed in the order in which the PCI devices are physically
++arranged so that the computer owner can arrange things like having scsi
++device 0 be on a controller that is not alphabetically the first scsi
++controller.
++.SH OPTIONS
++.TP
++.B --class class --classmask mask
++.PP
++--class and --classmask limit the search to PCI
++cards in particular classes. These arguments are always used together.
++The arguments to --class and --classmask
++can be given as hexadecimal numbers by prefixing a leading "0x".
++Note that the classes used by pcimodules are in "Linux" format,
++meaning the class value that you see with lspci would be shifted
++left eight bits, with the new low eight bits programming interface ID.
++An examples of how to use class and classmask is provided below.
++.B --help, -h
++Print a help message and exit.
++.SH EXAMPLES
++.TP
++pcimodules
++lists all modules corresponding to currently plugged in PCI devices.
++.TP
++pcimodules --class 0x200000 --classmask 0xffff00
++lists all modules corresponding to currently plugged in ethernet PCI devices.
++.SH FILES
++.TP
++.B /lib/modules/<kernel-version>/modules.pcimap
++This file is automatically generated by
++.B depmod,
++and used by
++.B pcimodules
++to determine which modules correspond to which PCI ID's.
++.TP
++.B /proc/bus/pci
++An interface to PCI bus configuration space provided by the post-2.1.82 Linux
++kernels. Contains per-bus subdirectories with per-card config space files and a
++.I devices
++file containing a list of all PCI devices.
++
++.SH SEE ALSO
++.BR lspci (8)
++
++.SH MAINTAINER
++The Linux PCI Utilities are maintained by Martin Mares <mj@suse.cz>.
++
++.SH AUTHOR
++.B pcimodules
++was written by Adam J. Richter <adam@yggdrasil.com>, based on public
++domain example code by Martin Mares <mj@suse.cz>.
++
++.SH COPYRIGHT
++.B pcimodules
++is copyright 2000, Yggdrasil Computing, Incorporated, and may
++be copied under the terms and conditions of version 2 of the GNU
++General Public License as published by the Free Software Foundation
++(Cambrige, Massachusetts, United States of America).
diff --git a/recipes/pciutils/pciutils-2.2.4/configure-uclibc.patch b/recipes/pciutils/pciutils-2.2.4/configure-uclibc.patch
new file mode 100644
index 0000000000..bfde28c455
--- /dev/null
+++ b/recipes/pciutils/pciutils-2.2.4/configure-uclibc.patch
@@ -0,0 +1,21 @@
+Index: pciutils-2.2.4/lib/configure
+===================================================================
+--- pciutils-2.2.4.orig/lib/configure 2007-05-16 23:37:38.000000000 +0200
++++ pciutils-2.2.4/lib/configure 2007-05-17 16:35:24.000000000 +0200
+@@ -39,6 +39,16 @@
+ sys=linux
+ fi
+
++if [ "$host" = "linux--uclibc" ]
++then
++ sys=linux
++fi
++
++if [ "$host" = "linux--uclibcgnueabi" ]
++then
++ sys=linux
++fi
++
+ c=config.h
+ m=config.mk
+ echo >$c "#define PCI_ARCH_`echo $cpu | tr 'a-z' 'A-Z'`"
diff --git a/recipes/pciutils/pciutils-2.2.4/configure.patch b/recipes/pciutils/pciutils-2.2.4/configure.patch
new file mode 100644
index 0000000000..cfb5ef71d5
--- /dev/null
+++ b/recipes/pciutils/pciutils-2.2.4/configure.patch
@@ -0,0 +1,40 @@
+Index: pciutils-2.2.4/lib/configure
+===================================================================
+--- pciutils-2.2.4.orig/lib/configure 2006-09-09 13:06:10.000000000 +0200
++++ pciutils-2.2.4/lib/configure 2008-06-17 10:15:07.000000000 +0200
+@@ -12,15 +12,15 @@ echo_n() {
+ echo_n "Configuring libpci for your system..."
+ idsdir=${1:-/usr/share}
+ version=${2:-0.0}
+-sys=`uname -s`
+-rel=`uname -r`
++sys=${3:-`uname -s`}
++rel=${4:-`uname -r`}
+ if [ "$sys" = "AIX" -a -x /usr/bin/oslevel -a -x /usr/sbin/lsattr ]
+ then
+ rel=`/usr/bin/oslevel`
+ proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
+ cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
+ else
+- cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/'`
++ cpu=${5:-`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/'`}
+ fi
+ if [ "$sys" = "GNU/kFreeBSD" ]
+ then
+@@ -34,6 +34,16 @@ rel=${4:-$rel}
+ echo " $host $rel"
+ zlib=$5
+
++if [ "$host" = "linux--gnuspe" ]
++then
++ sys=linux
++fi
++
++if [ "$host" = "linux--gnueabi" ]
++then
++ sys=linux
++fi
++
+ c=config.h
+ m=config.mk
+ echo >$c "#define PCI_ARCH_`echo $cpu | tr 'a-z' 'A-Z'`"
diff --git a/recipes/pciutils/pciutils-2.2.4/pcimodules-pciutils.diff b/recipes/pciutils/pciutils-2.2.4/pcimodules-pciutils.diff
new file mode 100644
index 0000000000..a2f3621f40
--- /dev/null
+++ b/recipes/pciutils/pciutils-2.2.4/pcimodules-pciutils.diff
@@ -0,0 +1,349 @@
+Index: pciutils-2.2.4/Makefile
+===================================================================
+--- pciutils-2.2.4.orig/Makefile 2006-09-09 14:57:03.000000000 +0200
++++ pciutils-2.2.4/Makefile 2006-10-31 10:59:48.000000000 +0100
+@@ -24,7 +24,7 @@
+
+ export
+
+-all: $(PCILIB) lspci setpci lspci.8 setpci.8 update-pciids update-pciids.8 $(PCI_IDS)
++all: $(PCILIB) lspci setpci lspci.8 setpci.8 update-pciids update-pciids.8 $(PCI_IDS) pcimodules pcimodules.8
+
+ $(PCILIB): $(PCIINC) force
+ $(MAKE) -C lib all
+@@ -34,9 +34,11 @@
+ lib/config.h lib/config.mk:
+ cd lib && ./configure "$(IDSDIR)" "$(VERSION)" "$(HOST)" "$(RELEASE)" "$(ZLIB)"
+
++pcimodules: pcimodules.o common.o $(PCILIB)
+ lspci: lspci.o common.o $(PCILIB)
+ setpci: setpci.o common.o $(PCILIB)
+
++pcimodules.o: pcimodules.c pciutils.h
+ lspci.o: lspci.c pciutils.h $(PCIINC)
+ setpci.o: setpci.c pciutils.h $(PCIINC)
+ common.o: common.c pciutils.h $(PCIINC)
+@@ -58,15 +60,15 @@
+ install: all
+ # -c is ignored on Linux, but required on FreeBSD
+ $(DIRINSTALL) -m 755 $(DESTDIR)$(SBINDIR) $(DESTDIR)$(IDSDIR) $(DESTDIR)$(MANDIR)/man8
+- $(INSTALL) -c -m 755 -s lspci setpci $(DESTDIR)$(SBINDIR)
++ $(INSTALL) -c -m 755 lspci setpci pcimodules $(DESTDIR)$(SBINDIR)
+ $(INSTALL) -c -m 755 update-pciids $(DESTDIR)$(SBINDIR)
+ $(INSTALL) -c -m 644 $(PCI_IDS) $(DESTDIR)$(IDSDIR)
+- $(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 $(DESTDIR)$(MANDIR)/man8
++ $(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 pcimodules.8 $(DESTDIR)$(MANDIR)/man8
+
+ uninstall: all
+- rm -f $(DESTDIR)$(SBINDIR)/lspci $(DESTDIR)$(SBINDIR)/setpci $(DESTDIR)$(SBINDIR)/update-pciids
++ rm -f $(DESTDIR)$(SBINDIR)/lspci $(DESTDIR)$(SBINDIR)/setpci $(DESTDIR)$(SBINDIR)/update-pciids $(SBINDIR)/pcimodules
+ rm -f $(DESTDIR)$(IDSDIR)/$(PCI_IDS)
+- rm -f $(DESTDIR)$(MANDIR)/man8/lspci.8 $(DESTDIR)$(MANDIR)/man8/setpci.8 $(DESTDIR)$(MANDIR)/man8/update-pciids.8
++ rm -f $(DESTDIR)$(MANDIR)/man8/lspci.8 $(DESTDIR)$(MANDIR)/man8/setpci.8 $(DESTDIR)$(MANDIR)/man8/update-pciids.8 $(MANDIR)/man8/pcimodules.8
+
+ pci.ids.gz: pci.ids
+ gzip -9 <$< >$@
+Index: pciutils-2.2.4/lspci.c
+===================================================================
+--- pciutils-2.2.4.orig/lspci.c 2006-09-09 14:32:29.000000000 +0200
++++ pciutils-2.2.4/lspci.c 2006-10-31 10:56:57.000000000 +0100
+@@ -120,8 +120,10 @@
+ d->config = xmalloc(64);
+ d->present = xmalloc(64);
+ memset(d->present, 1, 64);
+- if (!pci_read_block(p, 0, d->config, 64))
+- die("Unable to read the standard configuration space header");
++ if (!pci_read_block(p, 0, d->config, 64)) {
++ fprintf(stderr, "Unable to read the standard configuration space header");
++ return NULL;
++ }
+ if ((d->config[PCI_HEADER_TYPE] & 0x7f) == PCI_HEADER_TYPE_CARDBUS)
+ {
+ /* For cardbus bridges, we need to fetch 64 bytes more to get the
+Index: pciutils-2.2.4/pcimodules.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ pciutils-2.2.4/pcimodules.c 2006-10-31 10:51:09.000000000 +0100
+@@ -0,0 +1,185 @@
++/*
++ * pcimodules: Load all kernel modules for PCI device currently
++ * plugged into any PCI slot.
++ *
++ * Copyright 2000 Yggdrasil Computing, Incorporated
++ * This file may be copied under the terms and conditions of version
++ * two of the GNU General Public License, as published by the Free
++ * Software Foundation (Cambridge, Massachusetts, USA).
++ *
++ * This file is based on pciutils/lib/example.c, which has the following
++ * authorship and copyright statement:
++ *
++ * Written by Martin Mares and put to public domain. You can do
++ * with it anything you want, but I don't give you any warranty.
++ */
++
++#include <stdlib.h>
++#include <stdio.h>
++#include <malloc.h>
++#include <string.h>
++#include <unistd.h>
++#include <sys/utsname.h>
++#include <sys/param.h>
++#include <sys/types.h>
++
++#define _GNU_SOURCE
++#include <getopt.h>
++
++#include "pciutils.h"
++
++#define MODDIR "/lib/modules"
++#define PCIMAP "modules.pcimap"
++
++#define LINELENGTH 8000
++
++#define DEVICE_ANY 0xffffffff
++#define VENDOR_ANY 0xffffffff
++
++#include "lib/pci.h"
++
++ const char program_name[] = "lspci";
++
++struct pcimap_entry {
++ unsigned int vendor, subsys_vendor, dev, subsys_dev, class, class_mask;
++ char *module;
++ struct pcimap_entry *next;
++};
++
++static struct pcimap_entry *pcimap_list = NULL;
++
++#define OPT_STRING "h"
++static struct option long_options[] = {
++ {"class", required_argument, NULL, 'c'},
++ {"classmask", required_argument, NULL, 'm'},
++ {"help", no_argument, NULL, 'h'},
++ { 0, 0, 0, 0}
++};
++
++static unsigned long desired_class;
++static unsigned long desired_classmask; /* Default is 0: accept all classes.*/
++
++void
++read_pcimap(void)
++{
++ struct utsname utsname;
++ char filename[MAXPATHLEN];
++ FILE *pcimap_file;
++ char line[LINELENGTH];
++ struct pcimap_entry *entry;
++ unsigned int driver_data;
++ char *prevmodule = "";
++ char module[LINELENGTH];
++
++ if (uname(&utsname) < 0) {
++ perror("uname");
++ exit(1);
++ }
++ sprintf(filename, "%s/%s/%s", MODDIR, utsname.release, PCIMAP);
++ if ((pcimap_file = fopen(filename, "r")) == NULL) {
++ perror(filename);
++ exit(1);
++ }
++
++ while(fgets(line, LINELENGTH, pcimap_file) != NULL) {
++ if (line[0] == '#')
++ continue;
++
++ entry = xmalloc(sizeof(struct pcimap_entry));
++
++ if (sscanf(line, "%s 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x",
++ module,
++ &entry->vendor, &entry->dev,
++ &entry->subsys_vendor, &entry->subsys_dev,
++ &entry->class, &entry->class_mask,
++ &driver_data) != 8) {
++ fprintf (stderr,
++ "modules.pcimap unparsable line: %s.\n", line);
++ free(entry);
++ continue;
++ }
++
++ /* Optimize memory allocation a bit, in case someday we
++ have Linux systems with ~100,000 modules. It also
++ allows us to just compare pointers to avoid trying
++ to load a module twice. */
++ if (strcmp(module, prevmodule) != 0) {
++ prevmodule = xmalloc(strlen(module)+1);
++ strcpy(prevmodule, module);
++ }
++ entry->module = prevmodule;
++ entry->next = pcimap_list;
++ pcimap_list = entry;
++ }
++ fclose(pcimap_file);
++}
++
++/* Return a filled in pci_access->dev tree, with the device classes
++ stored in dev->aux.
++*/
++static void
++match_pci_modules(void)
++{
++ struct pci_access *pacc;
++ struct pci_dev *dev;
++ unsigned int class, subsys_dev, subsys_vendor;
++ struct pcimap_entry *map;
++ const char *prevmodule = "";
++
++ pacc = pci_alloc(); /* Get the pci_access structure */
++ /* Set all options you want -- here we stick with the defaults */
++ pci_init(pacc); /* Initialize the PCI library */
++ pci_scan_bus(pacc); /* We want to get the list of devices */
++ for(dev=pacc->devices; dev; dev=dev->next) {
++ pci_fill_info(dev, PCI_FILL_IDENT | PCI_FILL_BASES);
++ class = (pci_read_word(dev, PCI_CLASS_DEVICE) << 8)
++ | pci_read_byte(dev, PCI_CLASS_PROG);
++ subsys_dev = pci_read_word(dev, PCI_SUBSYSTEM_ID);
++ subsys_vendor = pci_read_word(dev,PCI_SUBSYSTEM_VENDOR_ID);
++ for(map = pcimap_list; map != NULL; map = map->next) {
++ if (((map->class ^ class) & map->class_mask) == 0 &&
++ ((desired_class ^ class) & desired_classmask)==0 &&
++ (map->dev == DEVICE_ANY ||
++ map->dev == dev->device_id) &&
++ (map->vendor == VENDOR_ANY ||
++ map->vendor == dev->vendor_id) &&
++ (map->subsys_dev == DEVICE_ANY ||
++ map->subsys_dev == subsys_dev) &&
++ (map->subsys_vendor == VENDOR_ANY ||
++ map->subsys_vendor == subsys_vendor) &&
++ prevmodule != map->module) {
++ printf("%s\n", map->module);
++ prevmodule = map->module;
++ }
++ }
++
++ }
++ pci_cleanup(pacc);
++}
++
++int
++main (int argc, char **argv)
++{
++ int opt_index = 0;
++ int opt;
++
++ while ((opt = getopt_long(argc, argv, OPT_STRING, long_options,
++ &opt_index)) != -1) {
++ switch(opt) {
++ case 'c':
++ desired_class = strtol(optarg, NULL, 0);
++ break;
++ case 'm':
++ desired_classmask = strtol(optarg, NULL, 0);
++ break;
++ case 'h':
++ printf ("Usage: pcimodules [--help]\n"
++ " Lists kernel modules corresponding to PCI devices currently plugged"
++ " into the computer.\n");
++ }
++ }
++
++ read_pcimap();
++ match_pci_modules();
++ return 0;
++}
+Index: pciutils-2.2.4/pcimodules.man
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ pciutils-2.2.4/pcimodules.man 2006-10-31 10:51:09.000000000 +0100
+@@ -0,0 +1,92 @@
++.TH pcimodules 8 "@TODAY@" "@VERSION@" "Linux PCI Utilities"
++.IX pcimodules
++.SH NAME
++pcimodules \- List kernel driver modules available for all currently plugged
++in PCI devices
++.SH SYNOPSIS
++.B pcimodules
++.RB [ --class class_id ]
++.RB [ --classmask mask ]
++.RB [ --help ]
++.SH DESCRIPTION
++.B pcimodules
++lists all driver modules for all currently plugged in PCI devices.
++.B pcimodules
++should be run at boot time, and whenever a PCI device is "hot plugged"
++into the system. This can be done by the following Bourne shell syntax:
++.IP
++ for module in $(pcimodules) ; do
++.IP
++ modprobe -s -k "$module"
++.IP
++ done
++.PP
++When a PCI device is removed from the system, the Linux kernel will
++decrement a usage count on PCI driver module. If this count drops
++to zero (i.e., there are no PCI drivers), then the
++.B modprobe -r
++process that is normally configured to run from cron every few minutes
++will eventually remove the unneeded module.
++.PP
++The --class and --classmask arguments can be used to limit the search
++to certain classes of PCI devices. This is useful, for example, to
++generate a list of ethernet card drivers to be loaded when the kernel
++has indicated that it is trying to resolve an unknown network interface.
++.PP
++Modules are listed in the order in which the PCI devices are physically
++arranged so that the computer owner can arrange things like having scsi
++device 0 be on a controller that is not alphabetically the first scsi
++controller.
++.SH OPTIONS
++.TP
++.B --class class --classmask mask
++.PP
++--class and --classmask limit the search to PCI
++cards in particular classes. These arguments are always used together.
++The arguments to --class and --classmask
++can be given as hexadecimal numbers by prefixing a leading "0x".
++Note that the classes used by pcimodules are in "Linux" format,
++meaning the class value that you see with lspci would be shifted
++left eight bits, with the new low eight bits programming interface ID.
++An examples of how to use class and classmask is provided below.
++.B --help, -h
++Print a help message and exit.
++.SH EXAMPLES
++.TP
++pcimodules
++lists all modules corresponding to currently plugged in PCI devices.
++.TP
++pcimodules --class 0x200000 --classmask 0xffff00
++lists all modules corresponding to currently plugged in ethernet PCI devices.
++.SH FILES
++.TP
++.B /lib/modules/<kernel-version>/modules.pcimap
++This file is automatically generated by
++.B depmod,
++and used by
++.B pcimodules
++to determine which modules correspond to which PCI ID's.
++.TP
++.B /proc/bus/pci
++An interface to PCI bus configuration space provided by the post-2.1.82 Linux
++kernels. Contains per-bus subdirectories with per-card config space files and a
++.I devices
++file containing a list of all PCI devices.
++
++.SH SEE ALSO
++.BR lspci (8)
++
++.SH MAINTAINER
++The Linux PCI Utilities are maintained by Martin Mares <mj@suse.cz>.
++
++.SH AUTHOR
++.B pcimodules
++was written by Adam J. Richter <adam@yggdrasil.com>, based on public
++domain example code by Martin Mares <mj@suse.cz>.
++
++.SH COPYRIGHT
++.B pcimodules
++is copyright 2000, Yggdrasil Computing, Incorporated, and may
++be copied under the terms and conditions of version 2 of the GNU
++General Public License as published by the Free Software Foundation
++(Cambrige, Massachusetts, United States of America).
diff --git a/recipes/pciutils/pciutils-3.1.2/pciutils.patch b/recipes/pciutils/pciutils-3.1.2/pciutils.patch
new file mode 100644
index 0000000000..c058d6ef99
--- /dev/null
+++ b/recipes/pciutils/pciutils-3.1.2/pciutils.patch
@@ -0,0 +1,362 @@
+diff -urN pciutils-3.1.2.orig/lib/configure pciutils-3.1.2.new/lib/configure
+--- pciutils-3.1.2.orig/lib/configure 2009-01-30 14:06:25.000000000 +0100
++++ pciutils-3.1.2.new/lib/configure 2009-02-04 18:45:31.000000000 +0100
+@@ -14,11 +14,6 @@
+ fi
+ }
+
+-if [ -z "$VERSION" -o -z "$IDSDIR" ] ; then
+- echo >&2 "Please run the configure script from the top-level Makefile"
+- exit 1
+-fi
+-
+ echo_n "Configuring libpci for your system..."
+ if [ -z "$HOST" ] ; then
+ sys=`uname -s`
+@@ -44,8 +39,8 @@
+ [ -n "$RELEASE" ] && rel="${RELEASE}"
+ # CAVEAT: tr on Solaris is a bit weird and the extra [] is otherwise harmless.
+ host=`echo $HOST | sed -e 's/^\([^-]*\)-\([^-]*\)-\([^-]*\)-\([^-]*\)$/\1-\3/' -e 's/^\([^-]*\)-\([^-]*\)$/\1--\2/' | tr '[A-Z]' '[a-z]'`
+-cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+-sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
++sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
++cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ echo " $host $rel $cpu $sys"
+
+ c=config.h
+diff -urN pciutils-3.1.2.orig/Makefile pciutils-3.1.2.new/Makefile
+--- pciutils-3.1.2.orig/Makefile 2009-02-01 17:49:22.000000000 +0100
++++ pciutils-3.1.2.new/Makefile 2009-02-04 13:32:50.000000000 +0100
+@@ -52,7 +52,8 @@
+
+ export
+
+-all: lib/$(PCILIB) lspci setpci example lspci.8 setpci.8 pcilib.7 update-pciids update-pciids.8 $(PCI_IDS)
++all: lib/$(PCILIB) lspci setpci example lspci.8 setpci.8 pcilib.7 update-pciids update-pciids.8 $(PCI_IDS) \
++ pcimodules pcimodules.8
+
+ lib/$(PCILIB): $(PCIINC) force
+ $(MAKE) -C lib all
+@@ -62,9 +63,11 @@
+ lib/config.h lib/config.mk:
+ cd lib && ./configure
+
++pcimodules: pcimodules.o common.o lib/$(PCILIB)
+ lspci: lspci.o ls-vpd.o ls-caps.o ls-ecaps.o ls-kernel.o ls-tree.o ls-map.o common.o lib/$(PCILIB)
+ setpci: setpci.o common.o lib/$(PCILIB)
+
++pcimodules.o: pcimodules.c pciutils.h
+ LSPCIINC=lspci.h pciutils.h $(PCIINC)
+ lspci.o: lspci.c $(LSPCIINC)
+ ls-vpd.o: ls-vpd.c $(LSPCIINC)
+@@ -101,10 +104,10 @@
+ install: all
+ # -c is ignored on Linux, but required on FreeBSD
+ $(DIRINSTALL) -m 755 $(DESTDIR)$(SBINDIR) $(DESTDIR)$(IDSDIR) $(DESTDIR)$(MANDIR)/man8 $(DESTDIR)$(MANDIR)/man7
+- $(INSTALL) -c -m 755 $(STRIP) lspci setpci $(DESTDIR)$(SBINDIR)
++ $(INSTALL) -c -m 755 $(STRIP) lspci setpci pcimodules $(DESTDIR)$(SBINDIR)
+ $(INSTALL) -c -m 755 update-pciids $(DESTDIR)$(SBINDIR)
+ $(INSTALL) -c -m 644 $(PCI_IDS) $(DESTDIR)$(IDSDIR)
+- $(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 $(DESTDIR)$(MANDIR)/man8
++ $(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 pcimodules.8 $(DESTDIR)$(MANDIR)/man8
+ $(INSTALL) -c -m 644 pcilib.7 $(DESTDIR)$(MANDIR)/man7
+ ifeq ($(SHARED),yes)
+ $(DIRINSTALL) -m 755 $(DESTDIR)$(LIBDIR)
+@@ -122,9 +125,10 @@
+ endif
+
+ uninstall: all
+- rm -f $(DESTDIR)$(SBINDIR)/lspci $(DESTDIR)$(SBINDIR)/setpci $(DESTDIR)$(SBINDIR)/update-pciids
++ rm -f $(DESTDIR)$(SBINDIR)/lspci $(DESTDIR)$(SBINDIR)/setpci $(DESTDIR)$(SBINDIR)/update-pciids $(DESTDIR)$(SBINDIR)/pcimodules
++
+ rm -f $(DESTDIR)$(IDSDIR)/$(PCI_IDS)
+- rm -f $(DESTDIR)$(MANDIR)/man8/lspci.8 $(DESTDIR)$(MANDIR)/man8/setpci.8 $(DESTDIR)$(MANDIR)/man8/update-pciids.8
++ rm -f $(DESTDIR)$(MANDIR)/man8/lspci.8 $(DESTDIR)$(MANDIR)/man8/setpci.8 $(DESTDIR)$(MANDIR)/man8/update-pciids.8 $(DESTDIR)$(MANDIR)/man8/pcimodules.8
+ rm -f $(DESTDIR)$(MANDIR)/man7/pcilib.7
+ ifeq ($(SHARED),yes)
+ rm -f $(DESTDIR)$(LIBDIR)/$(PCILIB) $(DESTDIR)$(LIBDIR)/$(LIBNAME).so$(ABI_VERSION)
+diff -urN pciutils-3.1.2.orig/pcimodules.c pciutils-3.1.2.new/pcimodules.c
+--- pciutils-3.1.2.orig/pcimodules.c 1970-01-01 01:00:00.000000000 +0100
++++ pciutils-3.1.2.new/pcimodules.c 2009-02-04 12:19:47.000000000 +0100
+@@ -0,0 +1,185 @@
++/*
++ * pcimodules: Load all kernel modules for PCI device currently
++ * plugged into any PCI slot.
++ *
++ * Copyright 2000 Yggdrasil Computing, Incorporated
++ * This file may be copied under the terms and conditions of version
++ * two of the GNU General Public License, as published by the Free
++ * Software Foundation (Cambridge, Massachusetts, USA).
++ *
++ * This file is based on pciutils/lib/example.c, which has the following
++ * authorship and copyright statement:
++ *
++ * Written by Martin Mares and put to public domain. You can do
++ * with it anything you want, but I don't give you any warranty.
++ */
++
++#include <stdlib.h>
++#include <stdio.h>
++#include <malloc.h>
++#include <string.h>
++#include <unistd.h>
++#include <sys/utsname.h>
++#include <sys/param.h>
++#include <sys/types.h>
++
++#define _GNU_SOURCE
++#include <getopt.h>
++
++#include "pciutils.h"
++
++#define MODDIR "/lib/modules"
++#define PCIMAP "modules.pcimap"
++
++#define LINELENGTH 8000
++
++#define DEVICE_ANY 0xffffffff
++#define VENDOR_ANY 0xffffffff
++
++#include "lib/pci.h"
++
++ const char program_name[] = "lspci";
++
++struct pcimap_entry {
++ unsigned int vendor, subsys_vendor, dev, subsys_dev, class, class_mask;
++ char *module;
++ struct pcimap_entry *next;
++};
++
++static struct pcimap_entry *pcimap_list = NULL;
++
++#define OPT_STRING "h"
++static struct option long_options[] = {
++ {"class", required_argument, NULL, 'c'},
++ {"classmask", required_argument, NULL, 'm'},
++ {"help", no_argument, NULL, 'h'},
++ { 0, 0, 0, 0}
++};
++
++static unsigned long desired_class;
++static unsigned long desired_classmask; /* Default is 0: accept all classes.*/
++
++void
++read_pcimap(void)
++{
++ struct utsname utsname;
++ char filename[MAXPATHLEN];
++ FILE *pcimap_file;
++ char line[LINELENGTH];
++ struct pcimap_entry *entry;
++ unsigned int driver_data;
++ char *prevmodule = "";
++ char module[LINELENGTH];
++
++ if (uname(&utsname) < 0) {
++ perror("uname");
++ exit(1);
++ }
++ sprintf(filename, "%s/%s/%s", MODDIR, utsname.release, PCIMAP);
++ if ((pcimap_file = fopen(filename, "r")) == NULL) {
++ perror(filename);
++ exit(1);
++ }
++
++ while(fgets(line, LINELENGTH, pcimap_file) != NULL) {
++ if (line[0] == '#')
++ continue;
++
++ entry = xmalloc(sizeof(struct pcimap_entry));
++
++ if (sscanf(line, "%s 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x",
++ module,
++ &entry->vendor, &entry->dev,
++ &entry->subsys_vendor, &entry->subsys_dev,
++ &entry->class, &entry->class_mask,
++ &driver_data) != 8) {
++ fprintf (stderr,
++ "modules.pcimap unparsable line: %s.\n", line);
++ free(entry);
++ continue;
++ }
++
++ /* Optimize memory allocation a bit, in case someday we
++ have Linux systems with ~100,000 modules. It also
++ allows us to just compare pointers to avoid trying
++ to load a module twice. */
++ if (strcmp(module, prevmodule) != 0) {
++ prevmodule = xmalloc(strlen(module)+1);
++ strcpy(prevmodule, module);
++ }
++ entry->module = prevmodule;
++ entry->next = pcimap_list;
++ pcimap_list = entry;
++ }
++ fclose(pcimap_file);
++}
++
++/* Return a filled in pci_access->dev tree, with the device classes
++ stored in dev->aux.
++*/
++static void
++match_pci_modules(void)
++{
++ struct pci_access *pacc;
++ struct pci_dev *dev;
++ unsigned int class, subsys_dev, subsys_vendor;
++ struct pcimap_entry *map;
++ const char *prevmodule = "";
++
++ pacc = pci_alloc(); /* Get the pci_access structure */
++ /* Set all options you want -- here we stick with the defaults */
++ pci_init(pacc); /* Initialize the PCI library */
++ pci_scan_bus(pacc); /* We want to get the list of devices */
++ for(dev=pacc->devices; dev; dev=dev->next) {
++ pci_fill_info(dev, PCI_FILL_IDENT | PCI_FILL_BASES);
++ class = (pci_read_word(dev, PCI_CLASS_DEVICE) << 8)
++ | pci_read_byte(dev, PCI_CLASS_PROG);
++ subsys_dev = pci_read_word(dev, PCI_SUBSYSTEM_ID);
++ subsys_vendor = pci_read_word(dev,PCI_SUBSYSTEM_VENDOR_ID);
++ for(map = pcimap_list; map != NULL; map = map->next) {
++ if (((map->class ^ class) & map->class_mask) == 0 &&
++ ((desired_class ^ class) & desired_classmask)==0 &&
++ (map->dev == DEVICE_ANY ||
++ map->dev == dev->device_id) &&
++ (map->vendor == VENDOR_ANY ||
++ map->vendor == dev->vendor_id) &&
++ (map->subsys_dev == DEVICE_ANY ||
++ map->subsys_dev == subsys_dev) &&
++ (map->subsys_vendor == VENDOR_ANY ||
++ map->subsys_vendor == subsys_vendor) &&
++ prevmodule != map->module) {
++ printf("%s\n", map->module);
++ prevmodule = map->module;
++ }
++ }
++
++ }
++ pci_cleanup(pacc);
++}
++
++int
++main (int argc, char **argv)
++{
++ int opt_index = 0;
++ int opt;
++
++ while ((opt = getopt_long(argc, argv, OPT_STRING, long_options,
++ &opt_index)) != -1) {
++ switch(opt) {
++ case 'c':
++ desired_class = strtol(optarg, NULL, 0);
++ break;
++ case 'm':
++ desired_classmask = strtol(optarg, NULL, 0);
++ break;
++ case 'h':
++ printf ("Usage: pcimodules [--help]\n"
++ " Lists kernel modules corresponding to PCI devices currently plugged"
++ " into the computer.\n");
++ }
++ }
++
++ read_pcimap();
++ match_pci_modules();
++ return 0;
++}
+diff -urN pciutils-3.1.2.orig/pcimodules.man pciutils-3.1.2.new/pcimodules.man
+--- pciutils-3.1.2.orig/pcimodules.man 1970-01-01 01:00:00.000000000 +0100
++++ pciutils-3.1.2.new/pcimodules.man 2009-02-04 12:19:53.000000000 +0100
+@@ -0,0 +1,92 @@
++.TH pcimodules 8 "@TODAY@" "@VERSION@" "Linux PCI Utilities"
++.IX pcimodules
++.SH NAME
++pcimodules \- List kernel driver modules available for all currently plugged
++in PCI devices
++.SH SYNOPSIS
++.B pcimodules
++.RB [ --class class_id ]
++.RB [ --classmask mask ]
++.RB [ --help ]
++.SH DESCRIPTION
++.B pcimodules
++lists all driver modules for all currently plugged in PCI devices.
++.B pcimodules
++should be run at boot time, and whenever a PCI device is "hot plugged"
++into the system. This can be done by the following Bourne shell syntax:
++.IP
++ for module in $(pcimodules) ; do
++.IP
++ modprobe -s -k "$module"
++.IP
++ done
++.PP
++When a PCI device is removed from the system, the Linux kernel will
++decrement a usage count on PCI driver module. If this count drops
++to zero (i.e., there are no PCI drivers), then the
++.B modprobe -r
++process that is normally configured to run from cron every few minutes
++will eventually remove the unneeded module.
++.PP
++The --class and --classmask arguments can be used to limit the search
++to certain classes of PCI devices. This is useful, for example, to
++generate a list of ethernet card drivers to be loaded when the kernel
++has indicated that it is trying to resolve an unknown network interface.
++.PP
++Modules are listed in the order in which the PCI devices are physically
++arranged so that the computer owner can arrange things like having scsi
++device 0 be on a controller that is not alphabetically the first scsi
++controller.
++.SH OPTIONS
++.TP
++.B --class class --classmask mask
++.PP
++--class and --classmask limit the search to PCI
++cards in particular classes. These arguments are always used together.
++The arguments to --class and --classmask
++can be given as hexadecimal numbers by prefixing a leading "0x".
++Note that the classes used by pcimodules are in "Linux" format,
++meaning the class value that you see with lspci would be shifted
++left eight bits, with the new low eight bits programming interface ID.
++An examples of how to use class and classmask is provided below.
++.B --help, -h
++Print a help message and exit.
++.SH EXAMPLES
++.TP
++pcimodules
++lists all modules corresponding to currently plugged in PCI devices.
++.TP
++pcimodules --class 0x200000 --classmask 0xffff00
++lists all modules corresponding to currently plugged in ethernet PCI devices.
++.SH FILES
++.TP
++.B /lib/modules/<kernel-version>/modules.pcimap
++This file is automatically generated by
++.B depmod,
++and used by
++.B pcimodules
++to determine which modules correspond to which PCI ID's.
++.TP
++.B /proc/bus/pci
++An interface to PCI bus configuration space provided by the post-2.1.82 Linux
++kernels. Contains per-bus subdirectories with per-card config space files and a
++.I devices
++file containing a list of all PCI devices.
++
++.SH SEE ALSO
++.BR lspci (8)
++
++.SH MAINTAINER
++The Linux PCI Utilities are maintained by Martin Mares <mj@suse.cz>.
++
++.SH AUTHOR
++.B pcimodules
++was written by Adam J. Richter <adam@yggdrasil.com>, based on public
++domain example code by Martin Mares <mj@suse.cz>.
++
++.SH COPYRIGHT
++.B pcimodules
++is copyright 2000, Yggdrasil Computing, Incorporated, and may
++be copied under the terms and conditions of version 2 of the GNU
++General Public License as published by the Free Software Foundation
++(Cambrige, Massachusetts, United States of America).
diff --git a/recipes/pciutils/pciutils_2.1.11.bb b/recipes/pciutils/pciutils_2.1.11.bb
new file mode 100644
index 0000000000..44a0bd1ff5
--- /dev/null
+++ b/recipes/pciutils/pciutils_2.1.11.bb
@@ -0,0 +1,34 @@
+SECTION = "console/utils"
+DESCRIPTION = 'The PCI Utilities package contains a library for portable access \
+to PCI bus configuration space and several utilities based on this library.'
+DESCRIPTION_pciutils-ids = 'The list of PCI IDs for pciutils'
+HOMEPAGE = "http://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml"
+LICENSE = "GPLv2"
+
+PR ="r3"
+
+PARALLEL_MAKE = ""
+FILES_pciutils-ids="${prefix}/share/pci.ids"
+PACKAGES =+ "pciutils-ids"
+SRC_URI = "${KERNELORG_MIRROR}/pub/software/utils/pciutils/pciutils-${PV}.tar.bz2 \
+ file://configure.patch;patch=1 \
+ file://configure-uclibc.patch;patch=1 \
+ file://pcimodules-pciutils-2.1.11.diff;patch=1"
+
+do_configure () {
+ (cd lib && ./configure ${datadir} ${PV} ${TARGET_OS} 2.4.21 ${TARGET_ARCH})
+}
+
+export PREFIX = "${D}${prefix}"
+export SBINDIR = "${D}${sbindir}"
+export SHAREDIR = "${D}${datadir}"
+export MANDIR = "${D}${mandir}"
+
+do_install () {
+ oe_runmake install
+}
+do_install_append () {
+ install -d ${D}/${prefix}/share
+ install -m 6440 ${WORKDIR}/${PN}-${PV}/pci.ids ${D}/${prefix}/share
+}
+
diff --git a/recipes/pciutils/pciutils_2.2.4.bb b/recipes/pciutils/pciutils_2.2.4.bb
new file mode 100644
index 0000000000..70a95ca11e
--- /dev/null
+++ b/recipes/pciutils/pciutils_2.2.4.bb
@@ -0,0 +1,60 @@
+DESCRIPTION = 'The PCI Utilities package contains a library for portable access \
+to PCI bus configuration space and several utilities based on this library.'
+DESCRIPTION_pciutils-ids = 'The list of PCI IDs for pciutils'
+SECTION = "console/utils"
+HOMEPAGE = "http://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml"
+LICENSE = "GPLv2"
+DEPENDS = "zlib"
+
+SRC_URI = "ftp://ftp.kernel.org/pub/software/utils/pciutils/pciutils-${PV}.tar.bz2 \
+ file://configure.patch;patch=1 \
+ file://configure-uclibc.patch;patch=1 \
+ file://pcimodules-pciutils.diff;patch=1"
+
+PARALLEL_MAKE = ""
+
+PR ="r3"
+
+do_configure () {
+ (cd lib && ./configure ${datadir} ${PV} ${TARGET_OS} 2.4.21 ${TARGET_ARCH})
+}
+
+export PREFIX = "${D}${prefix}"
+export SBINDIR = "${D}${sbindir}"
+export SHAREDIR = "${D}${datadir}"
+export MANDIR = "${D}${mandir}"
+
+LDFLAGS += "-lz"
+
+do_install () {
+ oe_runmake install
+}
+
+do_install_append () {
+ install -d ${D}/${prefix}/share
+ install -m 6440 ${WORKDIR}/${PN}-${PV}/pci.ids ${D}/${prefix}/share
+
+ # The makefile does not install the development files:
+ # libpci.a pci.h header.h config.h types.s
+ install -d ${D}/${libdir}
+ install -d ${D}/${includedir}/pci
+
+ oe_libinstall -a -C lib libpci ${D}/${libdir}
+ install -m 0644 ${S}/lib/pci.h ${D}/${includedir}/pci/
+ install -m 0644 ${S}/lib/header.h ${D}/${includedir}/pci/
+ install -m 0644 ${S}/lib/config.h ${D}/${includedir}/pci/
+ install -m 0644 ${S}/lib/types.h ${D}/${includedir}/pci/
+}
+
+do_stage () {
+ oe_libinstall -a -C lib libpci ${STAGING_LIBDIR}
+ install -m 0755 -d ${STAGING_INCDIR}/pci
+ install -m 0644 ${S}/lib/pci.h ${STAGING_INCDIR}/pci/
+ install -m 0644 ${S}/lib/header.h ${STAGING_INCDIR}/pci/
+ install -m 0644 ${S}/lib/config.h ${STAGING_INCDIR}/pci/
+ install -m 0644 ${S}/lib/types.h ${STAGING_INCDIR}/pci/
+}
+
+
+PACKAGES =+ "pciutils-ids"
+FILES_pciutils-ids="${prefix}/share/pci.ids"
diff --git a/recipes/pciutils/pciutils_3.1.2.bb b/recipes/pciutils/pciutils_3.1.2.bb
new file mode 100644
index 0000000000..25782a5549
--- /dev/null
+++ b/recipes/pciutils/pciutils_3.1.2.bb
@@ -0,0 +1,59 @@
+DESCRIPTION = 'The PCI Utilities package contains a library for portable access \
+to PCI bus configuration space and several utilities based on this library.'
+DESCRIPTION_pciutils-ids = 'The list of PCI IDs for pciutils'
+SECTION = "console/utils"
+HOMEPAGE = "http://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml"
+LICENSE = "GPLv2"
+DEPENDS = "zlib"
+
+SRC_URI = "ftp://ftp.kernel.org/pub/software/utils/pciutils/pciutils-${PV}.tar.bz2 \
+ file://pciutils.patch;patch=1 "
+
+PARALLEL_MAKE = ""
+
+PR ="r2"
+
+EXTRA_OEMAKE += "'STRIP = '"
+export SHARED=yes
+
+do_configure () {
+ (cd lib && ./configure ${datadir} ${PV} ${TARGET_OS} 2.4.21 ${TARGET_ARCH})
+}
+
+export PREFIX = "${D}${prefix}"
+export SBINDIR = "${D}${sbindir}"
+export SHAREDIR = "${D}${datadir}"
+export MANDIR = "${D}${mandir}"
+
+do_install () {
+ oe_runmake install
+}
+
+do_install_append () {
+ install -d ${D}/${prefix}/share
+ install -m 6440 ${WORKDIR}/${PN}-${PV}/pci.ids ${D}/${prefix}/share
+
+ # The makefile does not install the development files:
+ # libpci.so pci.h header.h config.h types.h
+ install -d ${D}/${libdir}
+ install -d ${D}/${includedir}/pci
+
+ oe_libinstall -so -C lib libpci ${D}/${libdir}
+ install -m 0644 ${S}/lib/pci.h ${D}/${includedir}/pci/
+ install -m 0644 ${S}/lib/header.h ${D}/${includedir}/pci/
+ install -m 0644 ${S}/lib/config.h ${D}/${includedir}/pci/
+ install -m 0644 ${S}/lib/types.h ${D}/${includedir}/pci/
+}
+
+do_stage () {
+ oe_libinstall -so -C lib libpci ${STAGING_LIBDIR}
+ install -m 0755 -d ${STAGING_INCDIR}/pci
+ install -m 0644 ${S}/lib/pci.h ${STAGING_INCDIR}/pci/
+ install -m 0644 ${S}/lib/header.h ${STAGING_INCDIR}/pci/
+ install -m 0644 ${S}/lib/config.h ${STAGING_INCDIR}/pci/
+ install -m 0644 ${S}/lib/types.h ${STAGING_INCDIR}/pci/
+}
+
+
+PACKAGES =+ "pciutils-ids"
+FILES_pciutils-ids="${prefix}/share/pci.ids"