# Template file for 'ubuntu' OSNAME="ubuntu" PRETTY="Ubuntu" LOGO=" " ICON="ubuntu.svg" ICON_ONLINE="" CATEGORY="Beginner, Desktop" BASEDOF="Debian" DESCRIPTION="Complete desktop Linux operating system, freely available with both community and professional support" HOMEPAGE="https://ubuntu.com" CREDENTIALS="-" GPG="" RSS="https://raw.githubusercontent.com/oSoWoSo/distro-feeds/public/releases.xml" DW="" MAGNET="" MAGNET_PREFERRED="" TORRENT="" CHAT="" RELEASES="26.10 26.04 24.04 22.04 20.04 18.04 16.04 14.04 daily-live" QEMU_ARCH="amd64 arm64" releases_() { local VERSION_DATA="" local SUPPORTED_VERSIONS=() local FEED_RELEASES="" local RELEASE_LIST="" VERSION_DATA="$(IFS=$'\n' web_pipe https://api.launchpad.net/devel/ubuntu/series | jq -r '.entries[]')" # shellcheck disable=SC2207 SUPPORTED_VERSIONS=($(IFS=$'\n' jq -r 'select(.status=="Supported" or .status=="Current Stable Release") | .version' <<<"${VERSION_DATA}" | sort)) FEED_RELEASES=$(atom_feed_iso_entries "${RSS}" "${OS//-/}" | cut -f1) case "${OS}" in ubuntu) RELEASE_LIST="${SUPPORTED_VERSIONS[*]}";; kubuntu|lubuntu|ubuntu-kylin|ubuntu-mate|ubuntu-studio|xubuntu) # after 16.04 RELEASE_LIST="${SUPPORTED_VERSIONS[*]:1}";; ubuntu-budgie) # after 18.04 RELEASE_LIST="${SUPPORTED_VERSIONS[*]:2}";; edubuntu|ubuntu-unity|ubuntu-cinnamon) # after 23.10 RELEASE_LIST="${SUPPORTED_VERSIONS[*]:5}";; esac RELEASE_LIST="${RELEASE_LIST} ${FEED_RELEASES} daily-live" printf '%s\n' "${RELEASE_LIST// /$'\n'}" | awk 'NF && !seen[$0]++' | paste -sd ' ' } arch_() { if [ -z "${RELEASE}" ]; then echo "amd64 arm64" return fi if [[ ! "${RELEASE}" =~ ^[0-9]+\.[0-9]+$ ]]; then echo "amd64" return fi local MAJOR="${RELEASE%%.*}" local MINOR="${RELEASE##*.}" local NUM_MINOR NUM_MINOR=$((10#${MINOR})) if [ "${MAJOR}" -gt 25 ] || { [ "${MAJOR}" -eq 25 ] && [ "${NUM_MINOR}" -ge 10 ]; }; then echo "amd64 arm64" else echo "amd64" fi } get_() { local ISO="" local HASH="" local URL="" local DATA="" local QEMU_ARCH="${ARCH:-amd64}" local CDIMAGE_OS="${OS}" case "${OS}" in ubuntu-cinnamon) CDIMAGE_OS="ubuntucinnamon";; ubuntu-kylin) CDIMAGE_OS="ubuntukylin";; ubuntu-studio) CDIMAGE_OS="ubuntustudio";; esac if [[ "${RELEASE}" == "daily"* ]] && [ "${OS}" == "ubuntu-studio" ]; then # Ubuntu Studio daily-live images are in the dvd directory RELEASE="dvd" fi if [[ "${RELEASE}" == "jammy-daily" ]]; then if [[ "${OS}" == "ubuntu-studio" ]]; then URL="https://cdimage.ubuntu.com/${CDIMAGE_OS}/jammy/dvd/current" else URL="https://cdimage.ubuntu.com/${CDIMAGE_OS}/jammy/daily-live/current" fi VM_PATH="${OS}-jammy-live$(arch_suffix)" elif [[ "${RELEASE}" == "daily"* ]] || [ "${RELEASE}" == "dvd" ]; then URL="https://cdimage.ubuntu.com/${CDIMAGE_OS}/${RELEASE}/current" VM_PATH="${OS}-${RELEASE}$(arch_suffix)" elif [ "${OS}" == "ubuntu" ]; then URL="https://releases.ubuntu.com/${RELEASE}" else URL="https://cdimage.ubuntu.com/${CDIMAGE_OS}/releases/${RELEASE}/release" fi if web_check "${URL}/SHA256SUMS"; then DATA=$(web_pipe "${URL}/SHA256SUMS" | grep 'desktop\|dvd\|install' | grep "${QEMU_ARCH}" | grep '\.iso$' | grep -v "+mac" | sort -k2,2V | tail -n 1) ISO=$(cut -d'*' -f2 <<<"${DATA}" | sed '1q;d') HASH=$(cut -d' ' -f1 <<<"${DATA}" | sed '1q;d') else DATA=$(web_pipe "${URL}/MD5SUMS" | grep 'desktop\|dvd\|install' | grep "${QEMU_ARCH}" | grep '\.iso$' | grep -v "+mac" | sort -k2,2V | tail -n 1) ISO=$(cut -d'*' -f2 <<<"${DATA}") HASH=$(cut -d' ' -f1 <<<"${DATA}") fi if [ -z "${ISO}" ] || [ -z "${HASH}" ]; then echo "${PRETTY} ${RELEASE} is currently unavailable. Please select other OS/Release combination" >&2 exit 1 fi if [[ "${RELEASE}" == "daily"* ]] || [ "${RELEASE}" == "dvd" ]; then zsync_get "${URL}/${ISO}" "${VM_PATH}" "${OS}-devel.iso" || return $? make_vm_config "${OS}-devel.iso" elif [[ "${RELEASE}" == "jammy-daily" ]]; then zsync_get "${URL}/${ISO}" "${VM_PATH}" "${OS}-jammy-live.iso" || return $? make_vm_config "${OS}-jammy-live.iso" else web_get "${URL}/${ISO}" "${VM_PATH}" || return $? check_hash "${ISO}" "${HASH}" make_vm_config "${ISO}" fi } config_() { [[ "${RELEASE}" == *"daily"* ]] && echo "disk_size=\"32G\"" >> "${CONF_FILE}" } releases_() { # Releases parsed at generation time — no network access needed. echo "${RELEASES}" }