Refactor get_alpine() to add create_vm() compatibility

This commit is contained in:
Martin Wimpress 2022-02-23 10:04:05 +00:00
parent 7dc6572bdf
commit 4f5752bb0d
No known key found for this signature in database
GPG Key ID: 61DF940515E06DA3
1 changed files with 3 additions and 8 deletions

View File

@ -685,20 +685,15 @@ function get_alpine() {
local ISO=""
local URL=""
local VERSION=""
local BRANCH=""
case ${RELEASE} in
latest) BRANCH="latest-stable";;
*) BRANCH="v${RELEASE}";;
latest) URL="https://dl-cdn.alpinelinux.org/alpine/latest-stable/releases/x86_64";;
*) URL="https://dl-cdn.alpinelinux.org/alpine/v${RELEASE}/releases/x86_64";;
esac
URL="https://dl-cdn.alpinelinux.org/alpine/${BRANCH}/releases/x86_64"
VERSION=$(wget -qO- "${URL}/latest-releases.yaml" | awk '/"Xen"/{found=0} {if(found) print} /"Virtual"/{found=1}' | grep 'version:' | awk '{print $2}')
ISO="alpine-virt-${VERSION}-x86_64.iso"
web_get "${URL}/${ISO}" "${VM_PATH}"
HASH=$(wget -qO- "${URL}/latest-releases.yaml" | awk '/"Xen"/{found=0} {if(found) print} /"Virtual"/{found=1}' | grep 'sha256:' | awk '{print $2}')
check_hash "${ISO}" "${HASH}"
make_vm_config "${ISO}"
echo "${URL}/${ISO} ${HASH}"
}
function get_android() {