Skip to content

Commit 4735d6a

Browse files
ChenQi1989akuster
authored andcommitted
check-version-mismatch.bbclass: make it work for walnascar
The oe-core master has qemu.bbclass refactoring, but walnascar does not. So we will need to copy all the needed functions and settings from qemu.bbclass here to make things work. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
1 parent aed5f28 commit 4735d6a

1 file changed

Lines changed: 32 additions & 1 deletion

File tree

meta-oe/classes/check-version-mismatch.bbclass

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,35 @@
1-
inherit qemu
1+
def qemu_target_binary(data):
2+
package_arch = data.getVar("PACKAGE_ARCH")
3+
qemu_target_binary = (data.getVar("QEMU_TARGET_BINARY_%s" % package_arch) or "")
4+
if qemu_target_binary:
5+
return qemu_target_binary
6+
7+
target_arch = data.getVar("TARGET_ARCH")
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+
elif target_arch == "powerpc64le":
15+
target_arch = "ppc64le"
16+
17+
return "qemu-" + target_arch
18+
19+
def qemu_wrapper_cmdline(data, rootfs_path, library_paths):
20+
import string
21+
22+
qemu_binary = qemu_target_binary(data)
23+
if qemu_binary == "qemu-allarch":
24+
qemu_binary = "qemuwrapper"
25+
26+
qemu_options = data.getVar("QEMU_OPTIONS") or ""
27+
28+
return "PSEUDO_UNLOAD=1 " + qemu_binary + " " + qemu_options + " -L " + rootfs_path\
29+
+ " -E LD_LIBRARY_PATH=" + ":".join(library_paths) + " "
30+
31+
QEMU_OPTIONS = "-r ${OLDEST_KERNEL} ${@d.getVar("QEMU_EXTRAOPTIONS:tune-%s" % d.getVar('TUNE_PKGARCH')) or ""}"
32+
QEMU_OPTIONS[vardeps] += "QEMU_EXTRAOPTIONS:tune-${TUNE_PKGARCH}"
233

334
ENABLE_VERSION_MISMATCH_CHECK ?= "${@'1' if bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', True, False, d) else '0'}"
435
DEBUG_VERSION_MISMATCH_CHECK ?= "1"

0 commit comments

Comments
 (0)