udev.eclass: add udev_hwdb_update function

update the udev hardware database binary using the `systemd-hwdb update`
command. The `udevadm hwdb` has been deprecated upstream.

See-also: f8717d2a72
Signed-off-by: Lukas Schmelting <lschmelting@posteo.com>
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
This commit is contained in:
Lukas Schmelting
2026-04-29 17:51:18 +00:00
committed by Mike Gilbert
parent 6d460e1406
commit 564d70f50a

View File

@@ -130,3 +130,18 @@ udev_reload() {
}
fi
# @FUNCTION: udev_hwdb_update
# @DESCRIPTION:
# Rebuild the systemd hwdb binary database used by udev for hardware
# property lookups. Should be called from pkg_postinst and pkg_postrm
# in packages installing hwdb files.
udev_hwdb_update() {
if [[ -n ${ROOT} ]]; then
return 0
fi
ebegin "Running systemd-hwdb update to regenerate binary udev hardware database"
systemd-hwdb update --root "${ROOT}"
eend $?
}