Skip to content

Commit

Permalink
Rocky Linux Support (#184)
Browse files Browse the repository at this point in the history
* Rocky Linux Support

* Update quickget
  • Loading branch information
Guy-Sowden authored Nov 1, 2021
1 parent ada72ca commit 257a63c
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions quickget
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function pretty_name() {
openbsd) PRETTY_NAME="OpenBSD";;
opensuse) PRETTY_NAME="openSUSE";;
popos) PRETTY_NAME="Pop!_OS";;
rockylinux) PRETTY_NAME="Rocky Linux";;
ubuntu-budgie) PRETTY_NAME="Ubuntu Budgie";;
ubuntu-kylin) PRETTY_NAME="Ubuntu Kylin";;
ubuntu-mate) PRETTY_NAME="Ubuntu MATE";;
Expand Down Expand Up @@ -143,6 +144,7 @@ function os_support() {
openbsd \
opensuse \
popos \
rockylinux \
ubuntu \
ubuntu-budgie \
ubuntu-kylin \
Expand Down Expand Up @@ -221,6 +223,14 @@ function releases_popos() {
21.04
}

function releases_rockylinux() {
echo 8.4 \
8.3 \
8.2 \
8.1 \
8.0
}

function releases_ubuntu() {
echo bionic \
focal \
Expand Down Expand Up @@ -593,6 +603,9 @@ function make_vm_config() {
elif [ "${OS}" == "popos" ]; then
GUEST="linux"
IMAGE_TYPE="iso"
elif [ "${OS}" == "rockylinux" ]; then
GUEST="linux"
IMAGE_TYPE="iso"
elif [[ "${OS}" == *"ubuntu"* ]]; then
GUEST="linux"
IMAGE_TYPE="iso"
Expand Down Expand Up @@ -803,6 +816,25 @@ function get_openbsd() {
make_vm_config "${ISO}"
}

function get_rocky() {
local HASH=""
local ISO=""
local URL=""

local arch="x86_64"
local baseurl="https://download.rockylinux.org/pub/rocky/${RELEASE}/isos/${arch}"

validate_release "releases_rockylinux"
ISO="Rocky-${RELEASE}-${arch}-${ISOTYPE}.iso"
URL="${baseurl}/${ISO}"
HASH=$(wget -q -O- "${baseurl}/CHECKSUM" | grep "SHA256 (${ISO})" | grep -E -i -w -o '[0-9a-z]{64}')

web_get "${URL}" "${VM_PATH}"
check_hash "${ISO}" "${HASH}"
make_vm_config "${ISO}"
}


function get_opensuse() {
local HASH=""
local ISO=""
Expand Down Expand Up @@ -1101,6 +1133,22 @@ if [ -n "${2}" ]; then
fi
VM_PATH="${OS}-${RELEASE}-${DRIVER}"
get_popos "${DRIVER}"
elif [ "${OS}" == "rockylinux" ]; then
if [ -n "${3}" ]; then
ISOTYPE="${3}"
ISOTYPES=(minimal dvd1 boot)
if [[ ! ${ISOTYPES[*]} =~ ${ISOTYPE} ]]; then
echo "iso ${ISOTYPE} is not supported:"
for ISOTYPE in "${ISOTYPES[@]}"; do
echo "${ISOTYPE}"
done
exit 1
fi
else
ISOTYPE="dvd1"
fi
VM_PATH="${OS}-${RELEASE}-${ISOTYPE}"
get_rocky "${ISOTYPE}"
elif [[ "${OS}" == *"ubuntu"* ]]; then
get_ubuntu
elif [ "${OS}" == "windows" ]; then
Expand Down

0 comments on commit 257a63c

Please sign in to comment.