Refactor Alma Linux support

Uses the minimal image only.
This commit is contained in:
Martin Wimpress 2022-02-21 04:01:03 +00:00
parent 67d07dfb89
commit e0308b4957
No known key found for this signature in database
GPG key ID: 61DF940515E06DA3

View file

@ -172,10 +172,6 @@ function list_csv() {
for OPTION in intel nvidia; do for OPTION in intel nvidia; do
echo "${DISPLAY_NAME},${OS},${RELEASE},${OPTION},${DOWNLOADER},${PNG},${SVG}" echo "${DISPLAY_NAME},${OS},${RELEASE},${OPTION},${DOWNLOADER},${PNG},${SVG}"
done done
elif [ "${OS}" == "alma" ]; then
for OPTION in minimal dvd; do
echo "${DISPLAY_NAME},${OS},${RELEASE},${OPTION},${DOWNLOADER},${PNG},${SVG}"
done
else else
echo "${DISPLAY_NAME},${OS},${RELEASE},,${DOWNLOADER},${PNG},${SVG}" echo "${DISPLAY_NAME},${OS},${RELEASE},,${DOWNLOADER},${PNG},${SVG}"
fi fi
@ -764,14 +760,7 @@ function get_alma() {
local URL="" local URL=""
validate_release "releases_alma" validate_release "releases_alma"
URL="http://lon.mirror.rackspace.com/almalinux/${RELEASE}/isos/x86_64/"
if [ -n "${1}" ]; then
ISOTYPE="${1}"
fi
# The mirror url returns 10 or so local mirrors with some kind or RR rotation/load balancing
# We'll just grab the first
URL=$(wget -qq -O- "https://mirrors.almalinux.org/isos/x86_64/${RELEASE}.html" | awk -F"<li>|</li>" '{for(i=2;i<=NF;i+=2) {print $i}}' RS="" | grep href | cut -d'"' -f2 | head -1)
ISO="AlmaLinux-${RELEASE}-x86_64-${ISOTYPE}.iso" ISO="AlmaLinux-${RELEASE}-x86_64-${ISOTYPE}.iso"
HASH="$(wget -q -O- "${URL}/CHECKSUM" | grep \("${ISO}" | cut -d'\' -f4)" HASH="$(wget -q -O- "${URL}/CHECKSUM" | grep \("${ISO}" | cut -d'\' -f4)"
web_get "${URL}/${ISO}" "${VM_PATH}" web_get "${URL}/${ISO}" "${VM_PATH}"
@ -1904,21 +1893,7 @@ if [ -n "${2}" ]; then
RELEASE="${2,,}" RELEASE="${2,,}"
VM_PATH="${OS}-${RELEASE}" VM_PATH="${OS}-${RELEASE}"
if [ "${OS}" == "alma" ]; then if [ "${OS}" == "alma" ]; then
if [ -n "${3}" ]; then get_alma
ISOTYPE="${3,,}"
ISOTYPES=(minimal dvd)
if [[ ! ${ISOTYPES[*]} =~ ${ISOTYPE} ]]; then
echo "iso ${ISOTYPE} is not supported:"
for ISOTYPE in "${ISOTYPES[@]}"; do
echo "${ISOTYPE}"
done
exit 1
fi
else
ISOTYPE="minimal"
fi
VM_PATH="${OS}-${RELEASE}-${ISOTYPE}"
get_alma "${ISOTYPE}"
elif [ "${OS}" == "alpine" ]; then elif [ "${OS}" == "alpine" ]; then
get_alpine get_alpine
elif [ "${OS}" == "android" ]; then elif [ "${OS}" == "android" ]; then