From 8897250ba47abeaa4c1a28cf191a47bff9f7b8d0 Mon Sep 17 00:00:00 2001 From: Zhang Qiang Date: Fri, 13 Dec 2013 12:48:21 +0800 Subject: [PATCH] use different qemu handler for arm and aarch64 Change-Id: Ida55fa669d464a452ee822705dc9813aa8b71629 --- mic/utils/misc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mic/utils/misc.py b/mic/utils/misc.py index 10b17d8..cc1b994 100644 --- a/mic/utils/misc.py +++ b/mic/utils/misc.py @@ -968,8 +968,10 @@ def setup_qemu_emulator(rootdir, arch): # qemu emulator should be a statically-linked executable file if arch == "aarch64": arm_binary = "qemu-arm64" + node = "/proc/sys/fs/binfmt_misc/aarch64" else: arm_binary = "qemu-arm" + node = "/proc/sys/fs/binfmt_misc/arm" qemu_emulator = "/usr/bin/%s" % arm_binary if not os.path.exists(qemu_emulator) or not is_statically_linked(qemu_emulator): @@ -988,10 +990,9 @@ def setup_qemu_emulator(rootdir, arch): runner.show(["/usr/sbin/setenforce", "0"]) # unregister it if it has been registered and is a dynamically-linked executable - node = "/proc/sys/fs/binfmt_misc/arm" if os.path.exists(node): qemu_unregister_string = "-1\n" - with open("/proc/sys/fs/binfmt_misc/arm", "w") as fd: + with open(node, "w") as fd: fd.write(qemu_unregister_string) # register qemu emulator for interpreting other arch executable file -- 2.7.4