diff options
author | lihongsx <lihongx.sun@intel.com> | 2014-08-13 19:34:16 +0800 |
---|---|---|
committer | admin <yuhuan.yang@samsung.com> | 2016-02-04 18:24:53 +0800 |
commit | b1861ea20d3d0b9140b69b3b623288009d723222 (patch) | |
tree | 39abd483a0f173edfd7ac32c25178e325aeb89ca | |
parent | c3252005b334e60cd623b0ec0d74a5e015583e6e (diff) | |
download | mic-b1861ea20d3d0b9140b69b3b623288009d723222.tar.gz mic-b1861ea20d3d0b9140b69b3b623288009d723222.tar.bz2 mic-b1861ea20d3d0b9140b69b3b623288009d723222.zip |
Check whether '/usr/bin/qemu-aarch64' exist.
Change-Id: I3d15f5ee386802c23e438e453aedfdace72739d5
-rwxr-xr-x | mic/utils/misc.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/mic/utils/misc.py b/mic/utils/misc.py index b90df8c..24f08bf 100755 --- a/mic/utils/misc.py +++ b/mic/utils/misc.py @@ -897,17 +897,26 @@ def setup_qemu_emulator(rootdir, arch): # qemu_emulator is a special case, we can't use find_binary_path # qemu emulator should be a statically-linked executable file if arch == "aarch64": - arm_binary = "qemu-aarch64" node = "/proc/sys/fs/binfmt_misc/aarch64" + if os.path.exists("/usr/bin/qemu-arm64") and is_statically_linked("/usr/bin/qemu-arm64"): + arm_binary = "qemu-arm64" + elif os.path.exists("/usr/bin/qemu-aarch64") and is_statically_linked("/usr/bin/qemu-aarch64"): + arm_binary = "qemu-aarch64" + elif os.path.exists("/usr/bin/qemu-arm64-static"): + arm_binary = "qemu-arm64-static" + elif os.path.exists("/usr/bin/qemu-aarch64-static"): + arm_binary = "qemu-aarch64-static" + else: + raise CreatorError("Please install a statically-linked %s" % arm_binary) else: - arm_binary = "qemu-arm" node = "/proc/sys/fs/binfmt_misc/arm" + arm_binary = "qemu-arm" + if not os.path.exists("/usr/bin/qemu-arm") or not is_statically_linked("/usr/bin/qemu-arm"): + arm_binary = "qemu-arm-static" + if not os.path.exists("/usr/bin/qemu-arm-static"): + raise CreatorError("Please install a statically-linked %s" % arm_binary) qemu_emulator = "/usr/bin/%s" % arm_binary - if not os.path.exists(qemu_emulator) or not is_statically_linked(qemu_emulator): - qemu_emulator = "/usr/bin/%s-static" % arm_binary - if not os.path.exists(qemu_emulator): - raise CreatorError("Please install a statically-linked %s" % arm_binary) if not os.path.exists(rootdir + "/usr/bin"): makedirs(rootdir + "/usr/bin") |