From e9d4a74c169286bd8d61aa0150e65db593f538d6 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Mon, 14 Dec 2020 21:06:27 +0000 Subject: Do not use qemu when we are already on the right arch --- functions.sh | 43 +++++++++++++++++++------------------------ 1 file 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 } -- cgit v1.2.1