From 78ff610e571e4d739326520c391a37ee1f1290ae Mon Sep 17 00:00:00 2001 From: Alex Kiernan Date: Fri, 27 Mar 2020 17:25:11 +0000 Subject: systemd: Reinstate systemd-hwdb-update.service systemd supports a distribution hwdb.bin in /usr/lib/udev/hwdb.bin, which is used if /etc/udev/hwdb.bin is not present. When generating the install time hwdb, for systemd, ensure that we put it in /usr/lib/udev, which then ensures that at boot time we do not regenerate it, unless the system is marked for update. This allows fragments dropped into /etc/udev/hwdb.d to be processed correctly, but without requiring a first boot time build: root@qemumips:~# systemctl status systemd-hwdb-update.service * systemd-hwdb-update.service - Rebuild Hardware Database Loaded: loaded (/usr/lib/systemd/system/systemd-hwdb-update.service; static; vendor preset: disabled) Active: inactive (dead) Condition: start condition failed at Wed 2020-03-04 15:18:11 UTC; 44s ago |- ConditionPathExists=|!/usr/lib/udev/hwdb.bin was not met |- ConditionPathExists=|/etc/udev/hwdb.bin was not met `- ConditionDirectoryNotEmpty=|/etc/udev/hwdb.d was not met Docs: man:hwdb(7) man:systemd-hwdb(8) Signed-off-by: Alex Kiernan Acked-by: Otavio Salvador Signed-off-by: Richard Purdie --- scripts/postinst-intercepts/update_udev_hwdb | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/postinst-intercepts/update_udev_hwdb b/scripts/postinst-intercepts/update_udev_hwdb index c4fb2bffcb..102e99b947 100644 --- a/scripts/postinst-intercepts/update_udev_hwdb +++ b/scripts/postinst-intercepts/update_udev_hwdb @@ -5,5 +5,17 @@ set -e -PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${libexecdir}/${binprefix}udevadm hwdb --update --root $D -chown root:root $D${sysconfdir}/udev/hwdb.bin +case "${PREFERRED_PROVIDER_udev}" in + systemd) + UDEV_EXTRA_ARGS="--usr" + UDEVLIBDIR="${rootlibexecdir}" + ;; + + *) + UDEV_EXTRA_ARGS="" + UDEVLIBDIR="${sysconfdir}" + ;; +esac + +PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${libexecdir}/${binprefix}udevadm hwdb --update --root $D ${UDEV_EXTRA_ARGS} +chown root:root $D${UDEVLIBDIR}/udev/hwdb.bin -- cgit 1.2.3-korg