diff options
author | Alexander Kanavin <alexander.kanavin@linux.intel.com> | 2016-03-09 17:01:47 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-03-09 17:00:28 +0000 |
commit | 5dce2e36642e910d58783ce2865c81c0e0580dd6 (patch) | |
tree | 652b882d742eb4bdeec252ac552559455c43a271 /meta | |
parent | 8b5afcd4e4d2fd4ab25d00d23bb277e47a31b16f (diff) | |
download | poky-5dce2e36642e910d58783ce2865c81c0e0580dd6.tar.gz |
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.
(From OE-Core rev: 0b68f0632312392cbd20bfcb9ed4895cfc9883ff)
Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/qemu.bbclass | 23 |
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): | |||
13 | target_arch = "ppc64" | 13 | target_arch = "ppc64" |
14 | 14 | ||
15 | return "qemu-" + target_arch | 15 | return "qemu-" + target_arch |
16 | # | 16 | |
17 | def qemu_wrapper_cmdline(data, rootfs_path, library_paths): | ||
18 | import string | ||
19 | |||
20 | qemu_binary = qemu_target_binary(data) | ||
21 | if qemu_binary == "qemu-allarch": | ||
22 | qemu_binary = "qemuwrapper" | ||
23 | |||
24 | qemu_options = data.getVar("QEMU_OPTIONS", True) | ||
25 | |||
26 | return "PSEUDO_UNLOAD=1 " + qemu_binary + " " + qemu_options + " -L " + rootfs_path\ | ||
27 | + " -E LD_LIBRARY_PATH=" + ":".join(library_paths) + " " | ||
28 | |||
17 | # Next function will return a string containing the command that is needed to | 29 | # Next function will return a string containing the command that is needed to |
18 | # to run a certain binary through qemu. For example, in order to make a certain | 30 | # to run a certain binary through qemu. For example, in order to make a certain |
19 | # postinstall scriptlet run at do_rootfs time and running the postinstall is | 31 | # postinstall scriptlet run at do_rootfs time and running the postinstall is |
@@ -23,17 +35,10 @@ def qemu_target_binary(data): | |||
23 | # ${@qemu_run_binary(d, '$D', '/usr/bin/test_app')} [test_app arguments] | 35 | # ${@qemu_run_binary(d, '$D', '/usr/bin/test_app')} [test_app arguments] |
24 | # | 36 | # |
25 | def qemu_run_binary(data, rootfs_path, binary): | 37 | def qemu_run_binary(data, rootfs_path, binary): |
26 | qemu_binary = qemu_target_binary(data) | ||
27 | if qemu_binary == "qemu-allarch": | ||
28 | qemu_binary = "qemuwrapper" | ||
29 | |||
30 | libdir = rootfs_path + data.getVar("libdir", False) | 38 | libdir = rootfs_path + data.getVar("libdir", False) |
31 | base_libdir = rootfs_path + data.getVar("base_libdir", False) | 39 | base_libdir = rootfs_path + data.getVar("base_libdir", False) |
32 | qemu_options = data.getVar("QEMU_OPTIONS", True) | ||
33 | 40 | ||
34 | return "PSEUDO_UNLOAD=1 " + qemu_binary + " " + qemu_options + " -L " + rootfs_path\ | 41 | return qemu_wrapper_cmdline(data, rootfs_path, [libdir, base_libdir]) + rootfs_path + binary |
35 | + " -E LD_LIBRARY_PATH=" + libdir + ":" + base_libdir + " "\ | ||
36 | + rootfs_path + binary | ||
37 | 42 | ||
38 | # QEMU_EXTRAOPTIONS is not meant to be directly used, the extensions are | 43 | # QEMU_EXTRAOPTIONS is not meant to be directly used, the extensions are |
39 | # PACKAGE_ARCH, *NOT* overrides. | 44 | # PACKAGE_ARCH, *NOT* overrides. |