From: Alexander Kanavin Date: Mon, 11 Jun 2018 13:38:19 +0000 (+0300) Subject: udev: only run qemu from postinst scripts if qemu usermode is supported X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~17617 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3247720dc4b1c49e8fad734e20b17ba55843b97;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git udev: only run qemu from postinst scripts if qemu usermode is supported Otherwise, there would be a failure at image creation time; avoid that by postponing to first boot explicitly. Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-core/systemd/systemd_237.bb b/meta/recipes-core/systemd/systemd_237.bb index 47d28902c8c..e4846fe4f6f 100644 --- a/meta/recipes-core/systemd/systemd_237.bb +++ b/meta/recipes-core/systemd/systemd_237.bb @@ -584,9 +584,13 @@ pkg_prerm_${PN} () { PACKAGE_WRITE_DEPS += "qemu-native" pkg_postinst_udev-hwdb () { if test -n "$D"; then - ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \ - --root $D - chown root:root $D${sysconfdir}/udev/hwdb.bin + if ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'true','false', d)}; then + ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \ + --root $D + chown root:root $D${sysconfdir}/udev/hwdb.bin + else + $INTERCEPT_DIR/postinst_intercept delay_to_first_boot ${PKG} mlprefix=${MLPREFIX} + fi else udevadm hwdb --update fi diff --git a/meta/recipes-core/udev/eudev_3.2.5.bb b/meta/recipes-core/udev/eudev_3.2.5.bb index 88ad8f1b375..75617c8d4ec 100644 --- a/meta/recipes-core/udev/eudev_3.2.5.bb +++ b/meta/recipes-core/udev/eudev_3.2.5.bb @@ -80,8 +80,12 @@ RPROVIDES_eudev-hwdb += "udev-hwdb" PACKAGE_WRITE_DEPS += "qemu-native" pkg_postinst_eudev-hwdb () { if test -n "$D"; then - ${@qemu_run_binary(d, '$D', '${bindir}/udevadm')} hwdb --update --root $D - chown root:root $D${sysconfdir}/udev/hwdb.bin + if ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'true','false', d)}; then + ${@qemu_run_binary(d, '$D', '${bindir}/udevadm')} hwdb --update --root $D + chown root:root $D${sysconfdir}/udev/hwdb.bin + else + $INTERCEPT_DIR/postinst_intercept delay_to_first_boot ${PKG} mlprefix=${MLPREFIX} + fi else udevadm hwdb --update fi