summaryrefslogtreecommitdiffstats
path: root/meta/classes/qemu.bbclass
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2014-10-16 03:05:19 +0200
committerTudor Florea <tudor.florea@enea.com>2014-10-16 03:05:19 +0200
commitc527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch)
treebb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/classes/qemu.bbclass
downloadpoky-daisy-140929.tar.gz
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/classes/qemu.bbclass')
-rw-r--r--meta/classes/qemu.bbclass35
1 files changed, 35 insertions, 0 deletions
diff --git a/meta/classes/qemu.bbclass b/meta/classes/qemu.bbclass
new file mode 100644
index 0000000000..3d437b0e45
--- /dev/null
+++ b/meta/classes/qemu.bbclass
@@ -0,0 +1,35 @@
1#
2# This class contains functions for recipes that need QEMU or test for its
3# existence.
4#
5
6def qemu_target_binary(data):
7 target_arch = data.getVar("TARGET_ARCH", True)
8 if target_arch in ("i486", "i586", "i686"):
9 target_arch = "i386"
10 elif target_arch == "powerpc":
11 target_arch = "ppc"
12 elif target_arch == "powerpc64":
13 target_arch = "ppc64"
14
15 return "qemu-" + target_arch
16#
17# 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
19# postinstall scriptlet run at do_rootfs time and running the postinstall is
20# architecture dependent, we can run it through qemu. For example, in the
21# postinstall scriptlet, we could use the following:
22#
23# ${@qemu_run_binary(d, '$D', '/usr/bin/test_app')} [test_app arguments]
24#
25def 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)
31 base_libdir = rootfs_path + data.getVar("base_libdir", False)
32
33 return "PSEUDO_UNLOAD=1 " + qemu_binary + " -L " + rootfs_path\
34 + " -E LD_LIBRARY_PATH=" + libdir + ":" + base_libdir + " "\
35 + rootfs_path + binary