[OE-core] [PATCH 4/6] qemuwrapper-cross: always fall back to x86_64 and i386 variants of qemu

Alexander Kanavin alexander.kanavin at linux.intel.com
Thu May 24 09:36:47 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.

Also, add 'set -x' so we know exactly what is being executed.

Signed-off-by: Alexander Kanavin <alexander.kanavin at linux.intel.com>
---
 .../qemu/qemuwrapper-cross_1.0.bb             | 29 +++++++------------
 1 file changed, 11 insertions(+), 18 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..d90ce36ba90 100644
--- a/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb
+++ b/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb
@@ -16,31 +16,24 @@ do_install () {
 	echo "#!/bin/sh" > ${D}${bindir_crossscripts}/qemuwrapper
 	qemu_binary=${@qemu_target_binary(d)}
 	qemu_options='${QEMU_OPTIONS}'
+	echo "set -x" >> ${D}${bindir_crossscripts}/qemuwrapper
 	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 $qemu_options "\$@"
 	rc=\$?
 fi
-exit \$rc
 EOF
 
-	fi
+	cat >> ${D}${bindir_crossscripts}/qemuwrapper << EOF
+if [ \$rc = 255 ]; then
+	qemu-i386 $qemu_options "\$@"
+	rc=\$?
+fi
+exit \$rc
+EOF
 
 	chmod +x ${D}${bindir_crossscripts}/qemuwrapper
 }
-- 
2.17.0




More information about the Openembedded-core mailing list