Now that systemd-tools-native gives us a native systemd-hwdb, and the
database format is known to be hardware-agnostic, we can simply run
systemd-hwdb directly instead of running it inside qemu-user if we're
using systemd instead of eudev.

Signed-off-by: Ross Burton <[email protected]>
---
 meta/recipes-core/systemd/systemd_259.5.bb   |  6 ++----
 scripts/postinst-intercepts/update_udev_hwdb | 18 +++++++++---------
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/meta/recipes-core/systemd/systemd_259.5.bb 
b/meta/recipes-core/systemd/systemd_259.5.bb
index 858605d9a4d..0bd67b56523 100644
--- a/meta/recipes-core/systemd/systemd_259.5.bb
+++ b/meta/recipes-core/systemd/systemd_259.5.bb
@@ -915,12 +915,10 @@ pkg_prerm:${PN}:libc-glibc () {
        fi
 }
 
-PACKAGE_WRITE_DEPS += "qemuwrapper-cross"
-
 pkg_postinst:udev-hwdb () {
        if test -n "$D"; then
-               $INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} 
mlprefix=${MLPREFIX} binprefix=${MLPREFIX} \
-                       rootlibexecdir="${nonarch_libdir}" 
PREFERRED_PROVIDER_udev="${PREFERRED_PROVIDER_udev}" 
base_bindir="${base_bindir}"
+               $INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} 
mlprefix=${MLPREFIX} \
+                       PREFERRED_PROVIDER_udev="${PREFERRED_PROVIDER_udev}"
        else
                systemd-hwdb update
        fi
diff --git a/scripts/postinst-intercepts/update_udev_hwdb 
b/scripts/postinst-intercepts/update_udev_hwdb
index 8b3f5de791f..5b84adfe872 100644
--- a/scripts/postinst-intercepts/update_udev_hwdb
+++ b/scripts/postinst-intercepts/update_udev_hwdb
@@ -7,19 +7,19 @@ set -e
 
 case "${PREFERRED_PROVIDER_udev}" in
        systemd)
-               UDEV_EXTRA_ARGS="--usr"
-               UDEVLIBDIR="${rootlibexecdir}"
-               UDEVADM="${base_bindir}/udevadm"
+               echo Updating HWDB with native systemd-hwdb...
+               systemd-hwdb update --root $D --usr
                ;;
 
        *)
-               UDEV_EXTRA_ARGS=""
+               echo Updating HWDB with udevadm...
+
                UDEVLIBDIR="${sysconfdir}"
                UDEVADM="${bindir}/udevadm"
+
+               rm -f $D${UDEVLIBDIR}/udev/hwdb.bin
+               PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${UDEVADM} hwdb 
--update --root $D ||
+                       PSEUDO_UNLOAD=1 qemuwrapper -L $D $D${UDEVADM} hwdb 
--update --root $D
+               chown root:root $D${UDEVLIBDIR}/udev/hwdb.bin
                ;;
 esac
-
-rm -f $D${UDEVLIBDIR}/udev/hwdb.bin
-PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${UDEVADM} hwdb --update 
--root $D ${UDEV_EXTRA_ARGS} ||
-       PSEUDO_UNLOAD=1 qemuwrapper -L $D $D${UDEVADM} hwdb --update --root $D 
${UDEV_EXTRA_ARGS}
-chown root:root $D${UDEVLIBDIR}/udev/hwdb.bin
-- 
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#241556): 
https://lists.openembedded.org/g/openembedded-core/message/241556
Mute This Topic: https://lists.openembedded.org/mt/120379575/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to