From 6fa56e5d675be03992fed94846023b982ace4b3b Mon Sep 17 00:00:00 2001 From: Kroese Date: Mon, 6 May 2024 04:52:05 +0200 Subject: [PATCH] Update install.sh --- src/install.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/install.sh b/src/install.sh index 914effd..17f3af0 100644 --- a/src/install.sh +++ b/src/install.sh @@ -671,9 +671,24 @@ detectVersion() { arch=$(sed -n "/$tag/{s/.*<$tag>\(.*\)<\/$tag>.*/\1/;p}" <<< "$xml") case "${arch,,}" in - "0" ) platform="x86" ;; - "9" ) platform="x64" ;; - "12" ) platform="arm64" ;; + "0" ) + platform="x86" + if [[ "${PLATFORM,,}" != "x64" ]]; then + error "You cannot boot $platform images on a $PLATFORM cpu!" && exit 67 + fi + ;; + "9" ) + platform="x64" + if [[ "${PLATFORM,,}" != "x64" ]]; then + error "You cannot boot $platform images on a $PLATFORM cpu!" && exit 67 + fi + ;; + "12" ) + platform="arm64" + if [[ "${PLATFORM,,}" != "arm64" ]]; then + error "You cannot boot ${platform^^} images on a $PLATFORM cpu!" && exit 67 + fi + ;; esac id=$(selectVersion "DISPLAYNAME" "$xml" "$platform")