All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Kanavin <alexander.kanavin@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 10/10] qemuwrapper-cross: always fall back to x86_64 and i386 variants of qemu
Date: Thu, 17 May 2018 14:38:37 +0300	[thread overview]
Message-ID: <20180517113837.24240-10-alexander.kanavin@linux.intel.com> (raw)
In-Reply-To: <20180517113837.24240-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.

Signed-off-by: Alexander Kanavin <alexander.kanavin@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



      parent reply	other threads:[~2018-05-17 11:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17 11:38 [PATCH 01/10] dtc: upgrade to 1.4.6 Alexander Kanavin
2018-05-17 11:38 ` [PATCH 02/10] xz: fix upstream version check Alexander Kanavin
2018-05-17 11:38 ` [PATCH 03/10] babeltrace: " Alexander Kanavin
2018-05-17 11:38 ` [PATCH 04/10] gnome-desktop3: remove the recipe Alexander Kanavin
2018-05-17 11:38 ` [PATCH 05/10] libidn: upgrade 1.34 -> 1.35 Alexander Kanavin
2018-05-17 11:38 ` [PATCH 06/10] btrfs-tools: upgrade 4.15.1 -> 4.16.1 Alexander Kanavin
2018-05-23 14:01   ` Burton, Ross
2018-05-17 11:38 ` [PATCH 07/10] rt-tests: fix upstream version check Alexander Kanavin
2018-05-17 11:38 ` [PATCH 08/10] openssl: fix upstream version check for 1.0 version Alexander Kanavin
2018-05-17 11:38 ` [PATCH 09/10] meson: update to 0.46.1 Alexander Kanavin
2018-05-17 11:38 ` Alexander Kanavin [this message]

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=20180517113837.24240-10-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.