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.

(From OE-Core rev: f3247720dc4b1c49e8fad734e20b17ba55843b97)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexander Kanavin authored and Richard Purdie committed 2018-06-18 11:07:58 +01:00
1 parent 4f3b7477a3
commit e67551e80e
2 files changed
+13 -5

No files matched your search

+7 -3
View 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
+6 -2
View 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