diff options
author | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
commit | 972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch) | |
tree | 97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/classes/qemu.bbclass | |
download | poky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz |
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/classes/qemu.bbclass')
-rw-r--r-- | meta/classes/qemu.bbclass | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/meta/classes/qemu.bbclass b/meta/classes/qemu.bbclass new file mode 100644 index 0000000000..b2cf85d628 --- /dev/null +++ b/meta/classes/qemu.bbclass | |||
@@ -0,0 +1,48 @@ | |||
1 | # | ||
2 | # This class contains functions for recipes that need QEMU or test for its | ||
3 | # existence. | ||
4 | # | ||
5 | |||
6 | def 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 | # | ||
25 | 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) | ||
31 | base_libdir = rootfs_path + data.getVar("base_libdir", False) | ||
32 | oldest_kernel = data.getVar("OLDEST_KERNEL", True) | ||
33 | |||
34 | return "PSEUDO_UNLOAD=1 " + qemu_binary + " -r " + oldest_kernel + " -L " + rootfs_path\ | ||
35 | + " -E LD_LIBRARY_PATH=" + libdir + ":" + base_libdir + " "\ | ||
36 | + rootfs_path + binary | ||
37 | |||
38 | QEMU_OPTIONS = "-r ${OLDEST_KERNEL}" | ||
39 | QEMU_OPTIONS_append_iwmmxt = " -cpu pxa270-c5" | ||
40 | QEMU_OPTIONS_append_armv6 = " -cpu arm1136" | ||
41 | QEMU_OPTIONS_append_armv7a = " -cpu cortex-a8" | ||
42 | QEMU_OPTIONS_append_e500v2 = " -cpu e500v2" | ||
43 | QEMU_OPTIONS_append_e500mc = " -cpu e500mc" | ||
44 | QEMU_OPTIONS_append_e5500 = " -cpu e5500" | ||
45 | QEMU_OPTIONS_append_e5500-64b = " -cpu e5500" | ||
46 | QEMU_OPTIONS_append_e6500 = " -cpu e6500" | ||
47 | QEMU_OPTIONS_append_e6500-64b = " -cpu e6500" | ||
48 | QEMU_OPTIONS_append_ppc7400 = " -cpu 7400" | ||