Skip to content

Commit

Permalink
wip: add architecture aware to alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
flexiondotorg committed Jun 24, 2024
1 parent 0e0aafa commit d78f010
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions quickget
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ function releases_alpine() {
local RELS=""
RELS=$(web_pipe "https://dl-cdn.alpinelinux.org/alpine/" | grep '"v' | cut -d'"' -f2 | tr -d / | sort -Vr | head -n 10)
for REL in ${RELS}; do
if web_check "https://dl-cdn.alpinelinux.org/alpine/${REL}/releases/x86_64/"; then
if web_check "https://dl-cdn.alpinelinux.org/alpine/${REL}/releases/${ARCH_GUEST}/"; then
echo -n "${REL} "
fi
done
Expand Down Expand Up @@ -1436,6 +1436,7 @@ function make_vm_config() {
echo "Making ${CONF_FILE}"
cat << EOF > "${CONF_FILE}"
#!$(which quickemu) --vm
arch_vm="${ARCH_QEMU}"
guest_os="${GUEST}"
disk_img="${VM_PATH}/disk.qcow2"
${IMAGE_TYPE}="${VM_PATH}/${IMAGE_FILE}"
Expand Down Expand Up @@ -1555,10 +1556,10 @@ function get_alma() {
function get_alpine() {
local HASH=""
local ISO=""
local URL="https://dl-cdn.alpinelinux.org/alpine/${RELEASE}/releases/x86_64"
local URL="https://dl-cdn.alpinelinux.org/alpine/${RELEASE}/releases/${ARCH_GUEST}"
local VERSION=""
VERSION=$(web_pipe "${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"
ISO="alpine-virt-${VERSION}-${ARCH_GUEST}.iso"
HASH=$(web_pipe "${URL}/latest-releases.yaml" | awk '/"Xen"/{found=0} {if(found) print} /"Virtual"/{found=1}' | grep 'sha256:' | awk '{print $2}')
echo "${URL}/${ISO} ${HASH}"
}
Expand Down Expand Up @@ -3390,6 +3391,7 @@ if ((BASH_VERSINFO[0] < 4)); then
exit 1
fi

# TODO: Move supported archs to distro info and check that from releases_
# ARCH_GUEST is the common string used in the URL
# ARCH_QEMU is the suffix used by to determine the qemu-system-<arch> to use and what is written into the VM config
ARCH_HOST=$(uname -m)
Expand Down

0 comments on commit d78f010

Please sign in to comment.