From ad3332ab3754162a012b99608c99ca9eb6b380a9 Mon Sep 17 00:00:00 2001 From: Sebastian Volland Date: Wed, 5 Jan 2022 17:50:09 +0100 Subject: [PATCH] Add support for Tails Linux --- quickget | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/quickget b/quickget index 235fd9a..0ab2da8 100755 --- a/quickget +++ b/quickget @@ -186,6 +186,7 @@ function os_support() { regolith \ rockylinux \ solus \ + tails \ ubuntu \ ubuntu-budgie \ ubuntu-kylin \ @@ -343,6 +344,10 @@ function releases_solus() { 4.3-plasma } +function releases_tails() { + echo stable +} + function releases_ubuntu() { echo bionic \ focal \ @@ -567,6 +572,9 @@ function make_vm_config() { elif [ "${OS}" == "solus" ]; then GUEST="linux" IMAGE_TYPE="iso" + elif [[ "${OS}" == "tails" ]]; then + GUEST="linux" + IMAGE_TYPE="iso" elif [[ "${OS}" == *"ubuntu"* ]]; then GUEST="linux" IMAGE_TYPE="iso" @@ -603,6 +611,10 @@ EOF echo "boot=\"legacy\"" >> "${OS}-${RELEASE}.conf" fi + if [ "${OS}" == "tails" ]; then + echo "boot=\"legacy\"" >> "${OS}-${RELEASE}.conf" + fi + if [ "${OS}" == "macos" ]; then echo "macos_release=\"${RELEASE}\"" >> "${OS}-${RELEASE}.conf" fi @@ -1100,6 +1112,18 @@ function get_regolith() { make_vm_config "${ISO}" } +function get_tails() { + validate_release "releases_tails" + + RELEASE_JSON_URL="https://tails.boum.org/install/v2/Tails/amd64/${RELEASE}/latest.json" + RELEASE_JSON="$(wget -q -O- "$RELEASE_JSON_URL")" + URL=$(echo "$RELEASE_JSON" | jq -r '.installations[0]."installation-paths"[]|select(.type=="iso")|."target-files"[0].url') + HASH=$(echo "$RELEASE_JSON" | jq -r '.installations[0]."installation-paths"[]|select(.type=="iso")|."target-files"[0].sha256') + ISO=$(echo "${URL}" | sed -e "s/.*\/\([^\/]*\)$/\1/") + web_get "${URL}" "${VM_PATH}" + check_hash "${ISO}" "${HASH}" + make_vm_config "${ISO}" +} function get_ubuntu() { local DEVEL="daily-live" @@ -1703,6 +1727,8 @@ if [ -n "${2}" ]; then get_rocky "${ISOTYPE}" elif [ "${OS}" == "solus" ]; then get_solus + elif [[ "${OS}" == "tails"* ]]; then + get_tails elif [[ "${OS}" == *"ubuntu"* ]]; then get_ubuntu elif [ "${OS}" == "windows" ]; then @@ -1766,6 +1792,8 @@ else releases_rockylinux elif [ "${OS}" == "solus" ]; then releases_solus + elif [[ "${OS}" == "tails"* ]]; then + releases_tails elif [[ "${OS}" == *"ubuntu"* ]]; then releases_ubuntu elif [ "${OS}" == "windows" ]; then