Skip to contentSkip to conversation

lspci: pci_id_lookup - add udev/hwdb support

PATCH In review Tom Gundersen 2 participants 3 messages Jul 20, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lspci: pci_id_lookup - add udev/hwdb support

This lets you select hwdb support at compile time.

hwdb is an efficient hardware database shipped with recent versions of systemd/udev. It contains among other sources pci.ids so querying hwdb rather than reading pci.ids directly should give the same result.

Ideally Linux distros using systemd would like to not ship pci.ids, but use hwdb as the only source of this information, which this patch allows.

---
 lib/configure    | 17 ++++++++++++++++
 lib/names-hash.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 74 insertions(+), 2 deletions(-)
lib/configure +17 -0
index 4ae20d4..674d3ea 100755
@@ -141,6 +141,23 @@ esac
 echo >>$c '#define PCI_HAVE_PM_DUMP'
 echo " dump"
 
+echo_n "Checking for udev hwdb support... "
+if [ "$HWDB" = yes -o "$HWDB" = no ] ; then
+	echo "$HWDB (set manually)"
+else
+	if [ -f /usr/include/libudev.h -o -f /usr/local/include/libudev.h ] ; then
+		HWDB=yes
+	else
+		HWDB=no
+	fi
+	echo "$HWDB (auto-detected)"
+fi
+if [ "$HWDB" = yes ] ; then
+	echo >>$c '#define PCI_HAVE_HWDB'
+	echo >>$m 'LIBUDEV=-ludev'
+	echo >>$m 'WITH_LIBS+=$(LIBUDEV)'
+fi
+
 echo_n "Checking for zlib support... "
 if [ "$ZLIB" = yes -o "$ZLIB" = no ] ; then
 	echo "$ZLIB (set manually)"
lib/names-hash.c +57 -2

71 lines not on this page · raw message

Signature · 1 line
1.8.3.3
#1 lore raw

2013/7/20 Tom Gundersen <[email protected]>:

Quoted 2 lines

Ideally Linux distros using systemd would like to not ship pci.ids, but use hwdb as the only source of this information, which this patch allows.

I don't think you strictly need to run systemd to make use of hwdb. You just need to run a recent enough version of udev [1].

Michael

[1] udev 196 or later

#2 lore raw
Quoted 6 lines · Michael Biebl

2013/7/20 Tom Gundersen <[email protected]>:

Quoted 2 lines

Ideally Linux distros using systemd would like to not ship pci.ids, but use hwdb as the only source of this information, which this patch allows.

I don't think you strictly need to run systemd to make use of hwdb. You just need to run a recent enough version of udev [1].

Yes, that is true, my mistake.

-t