The patch resulting from bug 38645 in pciutils to enable sysfs support is applied to all kernels. sysfs is only present in kernels 2.5 upwards. The first part of the patch (alteration to configure) needs to be changed to only define HAVE_PM_LINUX_SYSFS if $rel >= 2.5* (it needs a new case) The effect of this patch on 2.4 kernels is to produce lots of pcilib: Cannot open /sys/bus/pci/devices warnings from various parts of the system that use pcilib (including lspci etc). Reproducible: Always Steps to Reproduce: 1. Install latest pciutils on a kernel 2.4 2. Run lspci 3. Notice warning (pcilib: Cannot open /sys/bus/pci/devices) Actual Results: Saw warning before pci listing pcilib: Cannot open /sys/bus/pci/devices Expected Results: Just displayed pci listing $ uname -a Linux alex 2.4.22-gentoo-r5-acb1 #1 Wed Jan 21 19:49:23 GMT 2004 i686 Pentium III (Coppermine) GenuineIntel GNU/Linux $ epm -qi gentoo-sources pciutils Name : gentoo-sources Version : 2.4.22 Release : 5 Slot: 2.4.22-gentoo-r5 Install date: Fri Jan 16 03:20:47 2004 Build Host: i686-pc-linux-gnu Group : sys-kernel License: GPL-2 Size : TBD Packager : iggy URL : (none) Description : Full sources for the Gentoo Kernel. Name : pciutils Version : 2.1.11 Release : 1 Slot: 0 Install date: Thu Jan 22 00:51:12 2004 Build Host: i686-pc-linux-gnu Group : sys-apps License: GPL-2 Size : TBD Packager : vapier URL : http://atrey.karlin.mff.cuni.cz/~mj/pciutils.html Description : Various utilities dealing with the PCI bus
that warning should be disabled on 2.4 kernels what does `grep SYSFS_PATH /usr/portage/sys-apps/pciutils/2.1.11-sysfs.patch` show ? disabling this patch because you're running 2.4 atm is kind of dumb for people who dual boot ...
$grep SYSFS_PATH /usr/portage/sys-apps/pciutils/files/2.1.11-sysfs.patch +#define SYSFS_PATH_ROOT "/sys" +#define SYSFS_PATH SYSFS_PATH_ROOT "/bus/pci/devices" + if (access(SYSFS_PATH_ROOT, R_OK)) + if (access(SYSFS_PATH, R_OK)) { + a->warning("Cannot open %s", SYSFS_PATH); + a->debug("...using %s", SYSFS_PATH); + sprintf(buf, "%s/%s/%s", SYSFS_PATH, name, object); + sprintf(buf, "%s/%s/%s", SYSFS_PATH, name, "resource"); + dir = opendir(SYSFS_PATH); + a->error("Cannot open %s", SYSFS_PATH); + SYSFS_PATH, d->domain, d->bus, d->dev, + SYSFS_PATH, I wasn't suggesting disabling the patch entirely, just altering the first chunk so that the changes to configure cause HAVE_PM_LINUX_SYSFS to only be defined where the linux version >=2.5.
i know, but disabling the patch when running a 2.4.x kernel is kind of dumb when people want to dual boot with 2.6.x they have to re-emerge pciutils everytime they reboot ? do you have a /sys folder ? if so, why ? :)
Or maybe we could just disable the warning in general, although it might have debugging impact - simpler though.
Aaahh! Grok! Indeed. My /sys was created when I tried out kernel 2.6 a few weeks ago. Removing it results in the warning going away. If I do try out 2.6 again, and want to boot back into 2.4 then I'm going to see the warnings again though. Perusing the patch I see there is a sysfs_detect function that merely looks to see if /sys exists, and assumes you must be using sysfs if it does. Perhaps we should beef this function up to do more than that (check it is a mounted sysfs fs or if it is empty?).
OK; I've fixed the sysctl patch and that now checks your kernel version before doing any funky stuff - if it's 2.4 it works as it should [ quietly ] without sysfs and if it's 2.6 it uses sysfs. ``emerge sync'' and remerge pciutils and things should work.