[OE-core] [PATCH 10/10] qemuwrapper-cross: always fall back to x86_64 and i386 variants of qemu
Alexander Kanavin
alexander.kanavin at linux.intel.com
Thu May 17 11:38:37 UTC 2018
This helps in particular when executing nativesdk- postinsts; previously
they were attempted only with target qemu, and this obivously failed.
This could be solved by properly mapping the binary to be run to the
best available qemu variant for the binary architecture, but that
would be a lot more invasive change, and so I think a simple fallback
should be fine.
Signed-off-by: Alexander Kanavin <alexander.kanavin at linux.intel.com>
---
.../qemu/qemuwrapper-cross_1.0.bb | 28 ++++++++-----------
1 file changed, 11 insertions(+), 17 deletions(-)
diff --git a/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb b/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb
index c983fbae667..091aa52a33e 100644
--- a/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb
+++ b/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb
@@ -17,30 +17,24 @@ do_install () {
qemu_binary=${@qemu_target_binary(d)}
qemu_options='${QEMU_OPTIONS}'
echo "$qemu_binary $qemu_options \"\$@\"" >> ${D}${bindir_crossscripts}/qemuwrapper
- fallback_qemu_bin=
- case $qemu_binary in
- "qemu-i386")
- fallback_qemu_bin=qemu-x86_64
- ;;
- "qemu-x86_64")
- fallback_qemu_bin=qemu-i386
- ;;
- *)
- ;;
- esac
-
- if [ -n "$fallback_qemu_bin" ]; then
-
- cat >> ${D}${bindir_crossscripts}/qemuwrapper << EOF
+
+ cat >> ${D}${bindir_crossscripts}/qemuwrapper << EOF
rc=\$?
if [ \$rc = 255 ]; then
- $fallback_qemu_bin "\$@"
+ qemu-x86_64 "\$@"
rc=\$?
fi
exit \$rc
EOF
- fi
+ cat >> ${D}${bindir_crossscripts}/qemuwrapper << EOF
+rc=\$?
+if [ \$rc = 255 ]; then
+ qemu-i386 "\$@"
+ rc=\$?
+fi
+exit \$rc
+EOF
chmod +x ${D}${bindir_crossscripts}/qemuwrapper
}
--
2.17.0
More information about the Openembedded-core
mailing list