Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Alexander Kanavin <alexander.kanavin@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 4/6] qemuwrapper-cross: always fall back to x86_64 and i386 variants of qemu
Date: Thu, 24 May 2018 12:36:47 +0300	[thread overview]
Message-ID: <20180524093649.6911-4-alexander.kanavin@linux.intel.com> (raw)
In-Reply-To: <20180524093649.6911-1-alexander.kanavin@linux.intel.com>

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@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



  parent reply	other threads:[~2018-05-24  9:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-24  9:36 [PATCH 1/6] package_manager.py: get rid of ROOTFS_RPM_DEBUG in RpmPM() Alexander Kanavin
2018-05-24  9:36 ` [PATCH 2/6] gtk-immodules-cache.bbclass: convert cache creation to postinst_intercept mechanism Alexander Kanavin
2018-05-24  9:36 ` [PATCH 3/6] lib/oe/package_manager: turn postinst failure warnings into bitbake failures Alexander Kanavin
2018-05-24  9:36 ` Alexander Kanavin [this message]
2018-05-24  9:36 ` [PATCH 5/6] qemuwrapper-cross: set LD_LIBRARY_PATH directly Alexander Kanavin
2018-05-24  9:36 ` [PATCH 6/6] package_manger.py: rework postinst_intercept failures Alexander Kanavin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180524093649.6911-4-alexander.kanavin@linux.intel.com \
    --to=alexander.kanavin@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox