]> code.ossystems Code Review - openembedded-core.git/commitdiff
udev: only run qemu from postinst scripts if qemu usermode is supported
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>
Mon, 11 Jun 2018 13:38:19 +0000 (16:38 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 18 Jun 2018 09:59:33 +0000 (10:59 +0100)
Otherwise, there would be a failure at image creation time; avoid
that by postponing to first boot explicitly.

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/systemd/systemd_237.bb
meta/recipes-core/udev/eudev_3.2.5.bb

index 47d28902c8c4328704cd6c470aa7fd805f2a1f26..e4846fe4f6f961a1c53143487c04c9c9fa8e2ee9 100644 (file)
@@ -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
index 88ad8f1b37557dd2b45d414c1b9aeb9e69c2bfc7..75617c8d4ec55af92b96771b4a383942af540d3f 100644 (file)
@@ -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