diff options
author | Pascal Terjan <pterjan@mageia.org> | 2020-12-14 21:06:27 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mageia.org> | 2020-12-19 15:03:28 +0000 |
commit | e9d4a74c169286bd8d61aa0150e65db593f538d6 (patch) | |
tree | 29c4c4e137743eebfc383c11bbb32ed311c3a322 | |
parent | 65e8d86e885d8b6757248ea33ac0bb9ee2698cbf (diff) | |
download | mageia4arm-e9d4a74c169286bd8d61aa0150e65db593f538d6.tar mageia4arm-e9d4a74c169286bd8d61aa0150e65db593f538d6.tar.gz mageia4arm-e9d4a74c169286bd8d61aa0150e65db593f538d6.tar.bz2 mageia4arm-e9d4a74c169286bd8d61aa0150e65db593f538d6.tar.xz mageia4arm-e9d4a74c169286bd8d61aa0150e65db593f538d6.zip |
Do not use qemu when we are already on the right arch
-rwxr-xr-x | functions.sh | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/functions.sh b/functions.sh index 549c627..cb27a57 100755 --- a/functions.sh +++ b/functions.sh @@ -100,32 +100,27 @@ function createchroot() { fi fi - if ! [ -f /usr/bin/qemu-arm-static ]; then - title "Qemu package not present : installing qemu packages" - #/usr/bin/dnf --assumeyes --setopt=install_weak_deps=False install qemu-user-static - installhostpkg "qemu-user-static" "--setopt=install_weak_deps=False" - if [ ${?} -ne 0 ]; then - error "line ${LINENO} can't install qemu-user-static : exiting" - cleanExit ${ERR_1} + if [ `arch` != "${ARM_VERSION}" ]; then + if ! [ -f /usr/bin/qemu-arm-static ]; then + title "Qemu package not present : installing qemu packages" + #/usr/bin/dnf --assumeyes --setopt=install_weak_deps=False install qemu-user-static + installhostpkg "qemu-user-static" "--setopt=install_weak_deps=False" + if [ ${?} -ne 0 ]; then + error "line ${LINENO} can't install qemu-user-static : exiting" + cleanExit ${ERR_1} + fi fi - fi - # Starting qemu service if not started - print_info "check systemd-binfmt service : " - /usr/bin/systemctl is-active systemd-binfmt.service - if [ ${?} -ne 0 ]; then - title "Starting systemd-binfmt.service" - /usr/bin/systemctl start systemd-binfmt.service - if [ ${?} -ne 0 ]; then - error "line ${LINENO} can't start qemu-user-static : exiting" - cleanExit ${ERR_1} + # Starting qemu service if not started + print_info "check systemd-binfmt service : " + /usr/bin/systemctl is-active systemd-binfmt.service + if [ ${?} -ne 0 ]; then + title "Starting systemd-binfmt.service" + /usr/bin/systemctl start systemd-binfmt.service + if [ ${?} -ne 0 ]; then + error "line ${LINENO} can't start qemu-user-static : exiting" + cleanExit ${ERR_1} + fi fi -# else -# title "Restarting systemd-binfmt.service" -# /usr/bin/systemctl restart systemd-binfmt.service -# if [ ${?} -ne 0 ]; then -# error "line ${LINENO} can't start qemu-user-static : exiting" -# cleanExit ${ERR_1} -# fi fi return 0 } |