summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>2016-03-09 17:01:47 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-09 16:59:55 +0000
commit0b68f0632312392cbd20bfcb9ed4895cfc9883ff (patch)
treec17c337676d6af2c4e50e97d59ee203b08c5213d
parent82aeafe722f447a55e04c39aec70e88f2a1962e3 (diff)
downloadopenembedded-core-contrib-0b68f0632312392cbd20bfcb9ed4895cfc9883ff.tar.gz
openembedded-core-contrib-0b68f0632312392cbd20bfcb9ed4895cfc9883ff.tar.bz2
openembedded-core-contrib-0b68f0632312392cbd20bfcb9ed4895cfc9883ff.zip
qemu.bbclass: add qemu_wrapper_cmdline()
The class had qemu_run_binary() which was not suitable for gobject-introspection, as it required the name of the binary to run. qemu_wrapper_cmdline() returns just the command line string needed to run binaries, and does not require the binary name. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/qemu.bbclass23
1 files changed, 14 insertions, 9 deletions
diff --git a/meta/classes/qemu.bbclass b/meta/classes/qemu.bbclass
index c696085ddf..f3d3be832c 100644
--- a/meta/classes/qemu.bbclass
+++ b/meta/classes/qemu.bbclass
@@ -13,7 +13,19 @@ def qemu_target_binary(data):
target_arch = "ppc64"
return "qemu-" + target_arch
-#
+
+def qemu_wrapper_cmdline(data, rootfs_path, library_paths):
+ import string
+
+ qemu_binary = qemu_target_binary(data)
+ if qemu_binary == "qemu-allarch":
+ qemu_binary = "qemuwrapper"
+
+ qemu_options = data.getVar("QEMU_OPTIONS", True)
+
+ return "PSEUDO_UNLOAD=1 " + qemu_binary + " " + qemu_options + " -L " + rootfs_path\
+ + " -E LD_LIBRARY_PATH=" + ":".join(library_paths) + " "
+
# Next function will return a string containing the command that is needed to
# to run a certain binary through qemu. For example, in order to make a certain
# postinstall scriptlet run at do_rootfs time and running the postinstall is
@@ -23,17 +35,10 @@ def qemu_target_binary(data):
# ${@qemu_run_binary(d, '$D', '/usr/bin/test_app')} [test_app arguments]
#
def qemu_run_binary(data, rootfs_path, binary):
- qemu_binary = qemu_target_binary(data)
- if qemu_binary == "qemu-allarch":
- qemu_binary = "qemuwrapper"
-
libdir = rootfs_path + data.getVar("libdir", False)
base_libdir = rootfs_path + data.getVar("base_libdir", False)
- qemu_options = data.getVar("QEMU_OPTIONS", True)
- return "PSEUDO_UNLOAD=1 " + qemu_binary + " " + qemu_options + " -L " + rootfs_path\
- + " -E LD_LIBRARY_PATH=" + libdir + ":" + base_libdir + " "\
- + rootfs_path + binary
+ return qemu_wrapper_cmdline(data, rootfs_path, [libdir, base_libdir]) + rootfs_path + binary
# QEMU_EXTRAOPTIONS is not meant to be directly used, the extensions are
# PACKAGE_ARCH, *NOT* overrides.