Update pci-utils and pci.ids


Forum: DSL Ideas and Suggestions
Topic: Update pci-utils and pci.ids
started by: curaga

Posted by curaga on Nov. 18 2007,14:32
The newer versions of pci-utils support a gzipped pci.ids.
The pci.ids in DSL doesn't recognize many of the newer devices.

The solution:
update pci-utils, so we can have a gzipped pci.ids, so instead of the ~100kb grow we actually save space & get newer devices recognized.

Posted by ^thehatsrule^ on Nov. 18 2007,18:26
Doesn't the cloop module already have it compressed? :P

But having a newer one might be useful...

Posted by curaga on Nov. 18 2007,18:32
Yeah, but having it compressed beforehand with a different algo might save some space..

And HD-installs are uncompressed, so this should at least affect them

Posted by Juanito on Nov. 22 2007,10:29
I needed to compile pciutils to get the pci headers recently, so out of interest I tried the new version with dsl.

Usually I get an error when booting dsl about a pcmcia/pccard being unrecognised - it's a smart card reader - and lspci shows four devices as being unrecognised:
Code Sample
0000:01:01.0 CardBus bridge: Texas Instruments: Unknown device ac47 (rev 01) [PCI7510]
0000:01:01.1 CardBus bridge: Texas Instruments: Unknown device ac4a (rev 01)
0000:01:01.2 FireWire (IEEE 1394): Texas Instruments: Unknown device 802b [PCI7510]
0000:01:01.3 System peripheral: Texas Instruments: Unknown device 8204

When I tried with the latest version of pciutils (and thus the latest pci.ids) I got this:
Code Sample
01:01.0 CardBus bridge: Texas Instruments PCI7510 PC card Cardbus Controller (rev 01)
01:01.1 CardBus bridge: Texas Instruments PCI7510,7610 PC card Cardbus Controller (rev 01)
01:01.2 FireWire (IEEE 1394): Texas Instruments PCI7410,7510,7610 OHCI-Lynx Controller
01:01.3 System peripheral: Texas Instruments PCI7410,7510,7610 PCI Firmware Loading Function

Updating the pci.ids in dsl may or may not make more devices usuable out of the box, but it certainly looks like it will help track down the correct module for your hardware. Since pciutils is designed to accept pci.ids updates, it could be as simple as changing the file?

Posted by roberts on Nov. 22 2007,15:36
Since DSL is base on Debian Woody, it would make sense to at least upgrade pciutils to woody level. That should not cause an issue with non-existent modules.
Posted by curaga on Nov. 22 2007,16:18
I doubt updating to current level would cause any issues. Only updating the .ids would work, but I suggested updating pci-utils also b/c additional space savings.

lspci does not recognize the devices by modules, they will be listed without a module even existing based on their manufacturer/product id's from the proc filesystem. So, how could it cause module issues?

Posted by roberts on Nov. 22 2007,16:24
It is not just a file.

sbin/setpci
usr/share/misc/pci.ids
usr/share/lintian/overrides/pciutils
bin/lspci
sbin/lspci

What repository are you suggesting or did you compile?

Posted by curaga on Nov. 22 2007,16:42
Yes, I'm aware of those (except that "lintian" - what is it?).

The one I'm talking about is the official one, < http://www.kernel.org/pub/software/utils/pciutils/ >
Seems 2.2.9 is the latest stable version.

Quote
The configure script will automatically enable support for a compressed
pci.ids if you have zlib installed.
This is why to update :)

Posted by Juanito on Nov. 22 2007,17:31
I compiled a couple of versions of pciutils including 2.2.9. As Curaga mentions, the later versions use zlib to compress/uncompress pci.ids.

As far as I can tell, all of the versions include a utility to update pci.ids over the Internet. This would seem to confirm that dsl can use a more recent version of pci.ids without changing any of the other pciutils-related files or, alternatively, everything could be changed to 2.2.9.

I can post pciutils-2.2.9 if needed.

Posted by roberts on Nov. 22 2007,17:44
Quote
I can post pciutils-2.2.9 if needed.

Sure or email to me  Anything that can save me time or from being distracted on what I have to do is appreciated. Why re-step through the process.

Posted by Juanito on Nov. 22 2007,18:23
OK, I'll do that.

In the meantime, the "update-pciids" script looks like this:
Code Sample
#!/bin/sh

set -e
SRC="http://pciids.sourceforge.net/v2.2/pci.ids"
DEST=/opt/pci-utils/share/pci.ids
PCI_COMPRESSED_IDS=
GREP=grep

if [ -n "$PCI_COMPRESSED_IDS" ]; then
DECOMP="cat"
SRC="$SRC.gz"
GREP=zgrep
elif which bzip2 >/dev/null; then
DECOMP="bzip2 -d"
SRC="$SRC.bz2"
elif which gzip >/dev/null; then
DECOMP="gzip -d"
SRC="$SRC.gz"
else
DECOMP="cat"
fi

if which curl >/dev/null; then
DL="curl -o $DEST.new $SRC"
elif which wget >/dev/null; then
DL="wget -O $DEST.new $SRC"
elif which lynx >/dev/null; then
DL="eval lynx -source $SRC >$DEST.new"
else
echo >&2 "update-pciids: cannot find curl, wget or lynx"
exit 1
fi

if ! $DL; then
echo >&2 "update-pciids: download failed"
rm -f $DEST.new
exit 1
fi

if ! $DECOMP <$DEST.new >$DEST.neww; then
echo >&2 "update-pciids: decompression failed, probably truncated file"
exit 1
fi

if ! $GREP >/dev/null "^C " $DEST.neww; then
echo >&2 "update-pciids: missing class info, probably truncated file"
exit 1
fi

if [ -f $DEST ]; then
mv $DEST $DEST.old
# --reference is supported only by chmod from GNU file, so let's ignore any errors
chmod -f --reference=$DEST.old $DEST.neww 2>/dev/null || true
fi
mv $DEST.neww $DEST
rm $DEST.new

echo "Done."

pci.ids=487K, pci.ids.gz=137k, pci.ids.bz2=126k (current dsl=154k) but dsl lspci=23.7k and this lspci=63.6k (stripped)

Setting PCI_COMPRESSED_IDS=1 downloads pci.ids.gz but gives the following error:
Quote
/opt/pci-utils/sbin/update-pciids: line 45: zgrep: command not found
update-pciids: missing class info, probably truncated file

I guess dsl is missing zgrep?

Posted by roberts on Nov. 23 2007,02:03
So what you gain in size you lose by requiring extra binary.

Also, for the slowest machines, uncompressing that which was not before is just an extra burden. Especially for bzip2. Bzip2 has been rejected in the past over the slower machine issue.

Perhaps best to update but without compressing.

Posted by roberts on Nov. 23 2007,04:39
Ok. I took a look at this and have modified the update-pciids script to work with DSL, i.e., not use zgrep. Seems to be working fine and still being compressed just using gzip -d.

Thanks for the suggestion.



Posted by Juanito on Nov. 23 2007,05:18
If you could let me know how you modified the script I'll test lspci (from pciutils-2.29) out to be sure it works with dsl
Posted by roberts on Nov. 23 2007,05:30
Modded the first if statement to:

Code Sample

if [ -n "$PCI_COMPRESSED_IDS" ] && [ -x zgrep ]; then
       DECOMP="cat"
       SRC="$SRC.gz"
       GREP=zgrep
#elif which bzip2 >/dev/null; then
#       DECOMP="bzip2 -d"
#       SRC="$SRC.bz2"
elif which gzip >/dev/null; then
       DECOMP="gzip -d"
       SRC="$SRC.gz"
else
       DECOMP="cat"
fi

Posted by Juanito on Nov. 23 2007,06:15
Seems to work now:
Code Sample
$ ls -l /opt/pci-utils/share
-rw-r--r--    1 root     staff      131684 Nov 23 08:56 pci.ids.gz
$ /opt/pci-utils/sbin/lspci
00:00.0 Host bridge: Intel Corporation 440LX/EX - 82443LX/EX Host bridge (rev 03)
00:01.0 PCI bridge: Intel Corporation 440LX/EX - 82443LX/EX AGP bridge (rev 03)
00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 01)
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:07.2 USB Controller: Intel Corporation 82371AB/EB/MB PIIX4 USB (rev 01)
00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 01)
00:08.0 SCSI storage controller: Adaptec AIC-7880U (rev 01)
00:09.0 SCSI storage controller: Adaptec AIC-7860 (rev 03)
00:11.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 25)
00:13.0 Multimedia audio controller: Ensoniq ES1370 [AudioPCI] (rev 01)
01:00.0 VGA compatible controller: Matrox Graphics, Inc. MGA 2164W [Millennium II] AGP
$ /opt/pci-utils/sbin/lspci -h
...
-i <file>       Use specified ID database instead of /opt/pci-utils/share/pci.ids.gz
...

Since the location of pci.ids.gz is hardcoded, I'll take it that you would like it to stay in /usr/share/misc and lspci in /usr/bin and recompile.

Posted by roberts on Nov. 23 2007,06:18
No need to recomplle. I have it working fine here.
Making a new iso as I write this.

Posted by Juanito on Nov. 23 2007,06:39
[new lspci (64k) + new pci.ids.gz (137k)]-[old lspci (24k) + old pci.ids (154k)] - that makes 23k less to play with  :(

...but I guess the new pci.ids are worth it.

Posted by roberts on Nov. 23 2007,06:59
Needing to support legacy mode and allow update-pciids, I guess I will need to place pci.ids.gz in /opt/
Posted by Juanito on Nov. 23 2007,07:12
...or you could leave pci.ids(.gz) where it is and update it each time you release a new version of dsl - I don't think it changes that often does it?
Posted by curaga on Nov. 23 2007,07:52
I agree with Juanito about updating it with DSL, other distros do that too - and the ids can be updated manually, too, if the user has an older DSL.
Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.