fix(quickget): select correct arch for Fedora and Ubuntu server ISOs

- Add FEDORA_ARCH and set to aarch64 when ARCH == arm64
- Use FEDORA_ARCH in jq filter to pick the correct Fedora ISO/sha256
- Add UBUNTU_ARCH and switch Ubuntu daily/releases URL for arm64
- Use UBUNTU_ARCH when parsing SHA256SUMS/MD5SUMS instead of hardcoded
amd64
Fixes incorrect ISO selection on ARM64 hosts and enables arm64
downloads.

Signed-off-by: Martin Wimpress <martin@wimpress.org>
This commit is contained in:
Martin Wimpress 2026-01-24 22:22:39 +00:00 committed by Martin Wimpress
parent 57f753a21d
commit b62c144480
1 changed files with 12 additions and 5 deletions

View File

@ -2068,11 +2068,15 @@ function get_endless() {
}
function get_fedora() {
local FEDORA_ARCH="x86_64"
local HASH=""
local ISO=""
local JSON=""
local URL=""
local VARIANT=""
[ "${ARCH}" == "arm64" ] && FEDORA_ARCH="aarch64"
case ${EDITION} in
Server|Kinoite|Onyx|Silverblue|Sericea|Workstation|KDE) VARIANT="${EDITION}";;
*) VARIANT="Spins";;
@ -2090,12 +2094,10 @@ function get_fedora() {
RELEASE="${RELEASE/_/ }"
fi
# shellcheck disable=SC2086
# Fedora may promote variants from Spins to Editions, in which case we want to accept either "Spins" or the specific edition name to preserve backwards compatibility
# For example, Fedora 42 KDE is now an edition, while previous releases are spins
JSON=$(web_pipe "https://getfedora.org/releases.json" | jq '.[] | select((.variant=="'"${VARIANT}"'" or .variant=="'"${EDITION}"'") and .subvariant=="'"${EDITION}"'" and .arch=="x86_64" and .version=="'"${RELEASE}"'" and (.link | endswith(".iso")))')
JSON=$(web_pipe "https://getfedora.org/releases.json" | jq '.[] | select((.variant=="'"${VARIANT}"'" or .variant=="'"${EDITION}"'") and .subvariant=="'"${EDITION}"'" and .arch=="'"${FEDORA_ARCH}"'" and .version=="'"${RELEASE}"'" and (.link | endswith(".iso")))')
URL=$(echo "${JSON}" | jq -r '.link' | head -n1)
HASH=$(echo "${JSON}" | jq -r '.sha256' | head -n1)
echo "${URL} ${HASH}"
@ -2853,13 +2855,18 @@ function get_tuxedo-os() {
}
function get_ubuntu-server() {
local DATA=""
local HASH=""
local ISO=""
local NAME="live-server"
local UBUNTU_ARCH="${ARCH}"
local URL=""
if [[ "${RELEASE}" == "daily"* ]]; then
URL="https://cdimage.ubuntu.com/${OS}/${RELEASE}/current"
elif [ "${UBUNTU_ARCH}" == "arm64" ]; then
# ARM64 ISOs are hosted on cdimage.ubuntu.com
URL="https://cdimage.ubuntu.com/releases/${RELEASE}/release"
else
URL="https://releases.ubuntu.com/${RELEASE}"
fi
@ -2869,11 +2876,11 @@ function get_ubuntu-server() {
esac
if web_check "${URL}/SHA256SUMS"; then
DATA=$(web_pipe "${URL}/SHA256SUMS" | grep "${NAME}" | grep amd64 | grep iso | tail -n 1 )
DATA=$(web_pipe "${URL}/SHA256SUMS" | grep "${NAME}" | grep "${UBUNTU_ARCH}" | grep iso | tail -n 1 )
ISO=$(cut -d'*' -f2 <<<"${DATA}")
HASH=$(cut -d' ' -f1 <<<"${DATA}")
else
DATA=$(web_pipe "${URL}/MD5SUMS" | grep "${NAME}" | grep amd64 | grep iso | tail -n 1 )
DATA=$(web_pipe "${URL}/MD5SUMS" | grep "${NAME}" | grep "${UBUNTU_ARCH}" | grep iso | tail -n 1 )
ISO=$(cut -d' ' -f3 <<<"${DATA}")
HASH=$(cut -d' ' -f1 <<<"${DATA}")
fi