From 80b1305bbcc63026e01faf0d379c23c07c5f9695 Mon Sep 17 00:00:00 2001 From: Gui Chen Date: Sun, 13 Jan 2013 16:45:19 +0800 Subject: [PATCH] register arm binfmt in every time in bootstrap, there is only 'qemu-arm-static', so should unregister arm binfmt, and register it for arm image in every time to avoid conflict register Signed-off-by: Gui Chen --- mic/utils/misc.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mic/utils/misc.py b/mic/utils/misc.py index ead3fe0..46d1aae 100644 --- a/mic/utils/misc.py +++ b/mic/utils/misc.py @@ -955,19 +955,17 @@ def setup_qemu_emulator(rootdir, arch): if not os.path.exists(rootdir + "/usr/bin"): makedirs(rootdir + "/usr/bin") - shutil.copy(qemu_emulator, rootdir + qemu_emulator) + shutil.copy(qemu_emulator, rootdir + "/usr/bin/qemu-arm-static") + qemu_emulator = "/usr/bin/qemu-arm-static" # disable selinux, selinux will block qemu emulator to run if os.path.exists("/usr/sbin/setenforce"): msger.info('Try to disable selinux') runner.show(["/usr/sbin/setenforce", "0"]) - node = "/proc/sys/fs/binfmt_misc/arm" - if is_statically_linked(qemu_emulator) and os.path.exists(node): - return qemu_emulator - # unregister it if it has been registered and is a dynamically-linked executable - if not is_statically_linked(qemu_emulator) and os.path.exists(node): + node = "/proc/sys/fs/binfmt_misc/arm" + if os.path.exists(node): qemu_unregister_string = "-1\n" fd = open("/proc/sys/fs/binfmt_misc/arm", "w") fd.write(qemu_unregister_string) -- 2.7.4