Skip to content

Commit

Permalink
udev: add hardware database support
Browse files Browse the repository at this point in the history
  • Loading branch information
kaysievers committed Oct 23, 2012
1 parent 59bb9d9 commit 796b06c
Show file tree
Hide file tree
Showing 18 changed files with 111,757 additions and 225 deletions.
18 changes: 16 additions & 2 deletions Makefile.am
Expand Up @@ -80,6 +80,7 @@ systempresetdir=$(rootprefix)/lib/systemd/system-preset
udevlibexecdir=$(rootprefix)/lib/udev
udevhomedir = $(udevlibexecdir)
udevrulesdir = $(udevlibexecdir)/rules.d
udevhwdbdir = $(udevlibexecdir)/hwdb.d

# And these are the special ones for /
rootprefix=@rootprefix@
Expand Down Expand Up @@ -1758,6 +1759,7 @@ man/systemd-udevd-kernel.socket.8: man/systemd-udevd.service.8

udev-confdirs:
-$(MKDIR_P) $(DESTDIR)$(sysconfdir)/udev/rules.d
-$(MKDIR_P) $(DESTDIR)$(sysconfdir)/udev/hwdb.d

INSTALL_DATA_HOOKS += udev-confdirs

Expand All @@ -1777,6 +1779,10 @@ dist_udevrules_DATA += \
rules/80-drivers.rules \
rules/95-udev-late.rules

dist_udevhwdb_DATA = \
hwdb/20-pci-vendor-product.hwdb \
hwdb/20-usb-vendor-product.hwdb

udevconfdir = $(sysconfdir)/udev
dist_udevconf_DATA = \
src/udev/udev.conf
Expand Down Expand Up @@ -1824,6 +1830,7 @@ noinst_LTLIBRARIES += \

libudev_core_la_SOURCES = \
src/udev/udev.h \
src/udev/udev-hwdb.h \
src/udev/udev-event.c \
src/udev/udev-watch.c \
src/udev/udev-node.c \
Expand Down Expand Up @@ -1854,8 +1861,7 @@ libudev_core_la_LIBADD = \

libudev_core_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DFIRMWARE_PATH="$(FIRMWARE_PATH)" \
-DUSB_DATABASE=\"$(USB_DATABASE)\" -DPCI_DATABASE=\"$(PCI_DATABASE)\"
-DFIRMWARE_PATH="$(FIRMWARE_PATH)"

if HAVE_ACL
libudev_core_la_SOURCES += \
Expand All @@ -1878,6 +1884,7 @@ udevadm_SOURCES = \
src/udev/udevadm-info.c \
src/udev/udevadm-control.c \
src/udev/udevadm-monitor.c \
src/udev/udevadm-hwdb.c \
src/udev/udevadm-settle.c \
src/udev/udevadm-trigger.c \
src/udev/udevadm-test.c \
Expand Down Expand Up @@ -3951,6 +3958,7 @@ distclean-local: $(DISTCLEAN_LOCAL_HOOKS)

clean-local:
rm -rf $(abs_srcdir)/install-tree
rm -f $(abs_srcdir)/hwdb/usb.ids $(abs_srcdir)/hwdb/pci.ids

DISTCHECK_CONFIGURE_FLAGS = \
--with-sysvinit-path=$$dc_install_base/$(sysvinitdir) \
Expand All @@ -3967,6 +3975,12 @@ DISTCHECK_CONFIGURE_FLAGS += \
--enable-gtk-doc
endif

hwdb-update:
( cd hwdb && \
wget -N http://www.linux-usb.org/usb.ids && \
wget -N http://pciids.sourceforge.net/v2.2/pci.ids && \
./ids-update.pl )

upload: all distcheck
cp -v systemd-$(VERSION).tar.xz /home/lennart/git.fedora/systemd/
scp systemd-$(VERSION).tar.xz fdo:/srv/www.freedesktop.org/www/software/systemd/
Expand Down
1 change: 1 addition & 0 deletions TODO
Expand Up @@ -448,6 +448,7 @@ Features:
* GC unreferenced jobs (such as .device jobs)

* write blog stories about:
- hwdb: what belongs into it, lsusb
- enabling dbus services
- status update
- how to make changes to sysctl and sysfs attributes
Expand Down
29 changes: 0 additions & 29 deletions configure.ac
Expand Up @@ -567,33 +567,6 @@ if test "x$enable_coredump" != "xno"; then
fi
AM_CONDITIONAL(ENABLE_COREDUMP, [test "$have_coredump" = "yes"])

# ------------------------------------------------------------------------------
AC_ARG_WITH(usb-ids-path,
[AS_HELP_STRING([--with-usb-ids-path=DIR], [Path to usb.ids file])],
[USB_DATABASE=${withval}],
[if test -n "$usbids" ; then
USB_DATABASE="$usbids"
else
PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
fi])
AC_MSG_CHECKING([for USB database location])
AC_MSG_RESULT([$USB_DATABASE])
AC_SUBST(USB_DATABASE)

AC_ARG_WITH(pci-ids-path,
[AS_HELP_STRING([--with-pci-ids-path=DIR], [Path to pci.ids file])],
[PCI_DATABASE=${withval}],
[if test -n "$pciids" ; then
PCI_DATABASE="$pciids"
else
PKG_CHECK_MODULES(LIBPCI, libpci >= 3)
AC_SUBST([PCI_DATABASE], [$($PKG_CONFIG --variable=idsdir libpci)/pci.ids])
fi])
AC_MSG_CHECKING([for PCI database location])
AC_MSG_RESULT([$PCI_DATABASE])
AC_SUBST(PCI_DATABASE)

# ------------------------------------------------------------------------------
AC_ARG_WITH(firmware-path,
AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
Expand Down Expand Up @@ -878,8 +851,6 @@ AC_MSG_RESULT([
localed: ${have_localed}
coredump: ${have_coredump}
firmware path: ${FIRMWARE_PATH}
usb.ids: ${USB_DATABASE}
pci.ids: ${PCI_DATABASE}
gudev: ${enable_gudev}
gintrospection: ${enable_introspection}
keymap: ${enable_keymap}
Expand Down
2 changes: 2 additions & 0 deletions hwdb/.gitignore
@@ -0,0 +1,2 @@
/pci.ids
/usb.ids

0 comments on commit 796b06c

Please sign in to comment.