udev: only run qemu from postinst scripts if qemu usermode is supported
PATCH 1/1 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 <[email protected]>
--- meta/recipes-core/systemd/systemd_237.bb | 10 +++++++--- meta/recipes-core/udev/eudev_3.2.5.bb | 8 ++++++-- 2 files changed, 13 insertions(+), 5 deletions(-)
meta/recipes-core/systemd/systemd_237.bb +7 -3
@@ -580,9 +580,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
meta/recipes-core/udev/eudev_3.2.5.bb +6 -2
@@ -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
Signature · 1 line
2.17.0