Re: [PATCH 2/3] udev.eclass: add udev_hwdb_reload function
Mike Gilbert <[email protected]>
| Newsgroups | gmane.linux.gentoo.devel |
|---|---|
| Message-ID | <CAJ0EP43BdQc8c5CBYKru=BBCb0Ljz_Av3nh4NWSxfFz6vDaEjg@mail.gmail.com> |
On Tue, Apr 28, 2026 at 2:16 PM Lukas Schmelting <[email protected]> wrote: > > reload the udev hardware database using the `systemd-hwdb update` > command. The `udevadm hwdb` has been deprecated upstream. > > See-also: https://github.com/systemd/systemd/commit/f8717d2a723cf594617c3acb7e90992c881a3280 > Signed-off-by: Lukas Schmelting <[email protected]> > --- > eclass/udev.eclass | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/eclass/udev.eclass b/eclass/udev.eclass > index 7d1c213fa643..1690f7dd16cb 100644 > --- a/eclass/udev.eclass > +++ b/eclass/udev.eclass > @@ -130,3 +130,20 @@ udev_reload() { > } > > fi > + > +# @FUNCTION: udev_hwdb_reload > +# @DESCRIPTION: > +# Update the udev hardware database. > +# Should be called from pkg_postinst and pkg_postrm in packages installing hwdb > +# files. > +udev_hwdb_reload() { > + if [[ -n ${ROOT} ]]; then > + return 0 > + fi > + > + if [[ -d ${ROOT}/run/udev ]]; then > + ebegin "Running systemd-hwdb update, to update the binary hardware database" > + systemd-hwdb update --root "${ROOT}" > + eend $? > + fi > +} > -- > 2.53.0 > This command does not actually reload anything; it updates /etc/udev/hwdb.bin. Please rename the function to udev_hwdb_update instead. Also remove the /run/udev check; that's not needed here since we do not actually communicate with udevd. Also remove the comma in "Running systemd-hwdb update, to update the binary hardware database".