From 3d7f452481e07d734ac1ba74afafda9fb89205aa Mon Sep 17 00:00:00 2001 From: zenobit Date: Sun, 24 Dec 2023 04:23:36 +0100 Subject: [PATCH] waiting for upstream merge https://github.com/quickemu-project/quickemu/pull/885 --- quickemu | 12 +++++- quickget | 124 +++++++++++++++++++++++++++++++++++++------------------ 2 files changed, 94 insertions(+), 42 deletions(-) diff --git a/quickemu b/quickemu index ee519f7..533c61b 100755 --- a/quickemu +++ b/quickemu @@ -1388,6 +1388,13 @@ function sound_card_param_check() { fi } +function sound_card_param_check() { + if [ "${SOUND_CARD}" != "intel-hda" ] && [ "${SOUND_CARD}" != "ac97" ] && [ "${SOUND_CARD}" != "es1370" ] && [ "${SOUND_CARD}" != "sb16" ] && [ "${SOUND_CARD}" != "none" ]; then + echo "ERROR! Requested sound card '${SOUND_CARD}' is not recognised." + exit 1 + fi +} + function viewer_param_check() { if [ "${VIEWER}" != "none" ] && [ "${VIEWER}" != "spicy" ] && [ "${VIEWER}" != "remote-viewer" ]; then echo "ERROR! Requested viewer '${VIEWER}' is not recognised." @@ -1736,7 +1743,10 @@ if [ -n "${VM}" ] && [ -e "${VM}" ]; then VMPATH=$(realpath "$(dirname "${VM}")") VM_MONITOR_SOCKETPATH="${VMDIR}/${VMNAME}-monitor.socket" VM_SERIAL_SOCKETPATH="${VMDIR}/${VMNAME}-serial.socket" - + if [ ! -f "${disk_img}" ]; then + cd "${VMPATH}" + fi + # Backwards compatibility for ${driver_iso} if [ -n "${driver_iso}" ] && [ -z "${fixed_iso}" ]; then fixed_iso="${driver_iso}" diff --git a/quickget b/quickget index 3b90a16..173c1ff 100755 --- a/quickget +++ b/quickget @@ -5,7 +5,7 @@ export LC_ALL=C # # 1. Update os_support() - add new OS, all lowercase # 2. Update pretty_name() - add a pretty name for new OS *only if the catch all is not suitable* -# 3. Update os_homepages() - add a homepage for new OS +# 3. Update os_homepage() - add a homepage for new OS # 4. Create a releases_newos() generator (required) outputs the current supported release versions # 5. Create a editions_newos() generator (optional) outputs the editions if new OS has multiple flavours/editions # 6. Update make_vm_config() - add any *required* new OS tweaks @@ -51,6 +51,15 @@ elif [ "${1}" == '--open-distro-homepage' ] || [ "${1}" == '-o' ]; then elif [ "${1}" == '--show-distro-homepage' ] || [ "${1}" == '-s' ]; then show_distro_homepage="on" set -- "$2" +elif [ "${1}" == '--download-iso' ] || [ "${1}" == '-d' ]; then + download_iso="on" + if [ -n "$4" ]; then + set -- "$2" "$3" "$4" + elif [ -n "$3" ]; then + set -- "$2" "$3" + else + set -- "$2" + fi fi function pretty_name() { @@ -328,7 +337,7 @@ function os_support() { zorin } -function os_homepages(){ +function os_homepage(){ local SIMPLE_NAME="" local HOMEPAGE="" SIMPLE_NAME="${1}" @@ -351,7 +360,7 @@ function os_homepages(){ bunsenlabs) HOMEPAGE="https://www.bunsenlabs.org/";; cachyos) HOMEPAGE="https://cachyos.org/";; centos-stream) HOMEPAGE="https://www.centos.org/centos-stream/";; - cereues) HOMEPAGE="https://sourceforge.net/projects/cereus-linux/";; + cereues) HOMEPAGE="https://cereus-linux.sourceforge.io/";; chimeralinux) HOMEPAGE="https://chimera-linux.org/";; crunchbang++) HOMEPAGE="https://www.crunchbangplusplus.org/";; debian) HOMEPAGE="https://www.debian.org/";; @@ -381,6 +390,7 @@ function os_homepages(){ linuxlite) HOMEPAGE="https://www.linuxliteos.com/";; linuxmint) HOMEPAGE="https://linuxmint.com/";; lmde) HOMEPAGE="https://www.linuxmint.com/download_lmde.php";; + lubuntu) HOMEPAGE="https://lubuntu.me/";; mageia) HOMEPAGE="https://www.mageia.org/";; manjaro) HOMEPAGE="https://manjaro.org/";; mxlinux) HOMEPAGE="https://mxlinux.org/";; @@ -389,7 +399,6 @@ function os_homepages(){ netbsd) HOMEPAGE="https://www.netbsd.org/";; nitrux) HOMEPAGE="https://nxos.org/";; nixos) HOMEPAGE="https://nixos.org/";; - lubuntu) HOMEPAGE="https://lubuntu.me/";; macos) HOMEPAGE="https://www.apple.com/macos/";; openbsd) HOMEPAGE="https://www.openbsd.org/";; openindiana) HOMEPAGE="https://www.openindiana.org/";; @@ -592,11 +601,11 @@ function editions_android() { } function releases_antix() { - echo 21 22 23 + echo 21 22 23 } function editions_antix() { - echo net-sysv core-sysv base-sysv full-sysv net-runit core-runit base-runit full-runit + echo net-sysv core-sysv base-sysv full-sysv net-runit core-runit base-runit full-runit } function releases_archlinux() { @@ -799,7 +808,7 @@ function releases_kolibrios() { } function releases_linuxlite() { - echo 6.0 6.2 6.4 6.6 + echo 6.0 6.2 6.4 6.6 } function releases_linuxmint(){ @@ -961,12 +970,21 @@ function editions_solus() { echo Budgie GNOME MATE Plasma } +function releases_sparkylinux() { + local SPARKY_RELEASES=$(wget -qO- "https://sourceforge.net/projects/sparkylinux/rss?path=/" | grep 'link' | grep '.iso' | cut -d'-' -f2 | uniq | tr '\r\n' ' ') + echo "${SPARKY_RELEASES}" +} + +function editions_sparkylinux() { + echo lxqt mate xfce kde minimalgui minimalcli gameover multimedia rescue +} + function releases_spiral() { - echo latest + echo latest } function editions_spiral() { - echo Plasma XFCE Mate LXQt Gnome Budgie Cinnamon Builder + echo Plasma XFCE Mate LXQt Gnome Budgie Cinnamon Builder } function releases_tails() { @@ -1094,7 +1112,11 @@ function check_hash() { local iso="" local hash="" local hash_algo="" - iso="${VM_PATH}/${1}" + if [ "${download_iso}" == "on" ]; then + iso="${1}" + else + iso="${VM_PATH}/${1}" + fi hash="${2}" # Guess the hash algorithm by the hash length @@ -1128,16 +1150,18 @@ function web_get() { FILE="${URL##*/}" fi - # Test mode for ISO - if [ "${show_iso_url}" == 'on' ]; then - echo "${URL}" - exit 0 + # Test mode for ISO + if [ "${show_iso_url}" == 'on' ]; then + echo "${URL}" + exit 0 elif [ "${test_iso_url}" == 'on' ]; then - wget --spider "${URL}" - exit 0 + wget --spider "${URL}" + exit 0 + elif [ "${download_iso}" == 'on' ]; then + DIR="$(pwd)" fi - if ! mkdir -p "${DIR}" 2>/dev/null; then + if [ "${DIR}" != "$(pwd)" ] && ! mkdir -p "${DIR}" 2>/dev/null; then echo "ERROR! Unable to create directory ${DIR}" exit 1 fi @@ -1161,13 +1185,13 @@ function zsync_get() { local OUT="" local URL="${1}" - # Test mode for ISO - if [ "${show_iso_url}" == 'on' ]; then - echo "${URL}" - exit 0 + # Test mode for ISO + if [ "${show_iso_url}" == 'on' ]; then + echo "${URL}" + exit 0 elif [ "${test_iso_url}" == 'on' ]; then - wget --spider "${URL}" - exit 0 + wget --spider "${URL}" + exit 0 elif command -v zsync &>/dev/null; then if [ -n "${3}" ]; then OUT="${3}" @@ -1207,6 +1231,10 @@ function make_vm_config() { local GUEST="" local SEC_BOOT="" + if [ "${download_iso}" == "on" ]; then + exit 0 + fi + IMAGE_FILE="${1}" ISO_FILE="${2}" case "${OS}" in @@ -2587,14 +2615,31 @@ function get_solus() { echo "${URL}/${ISO} ${HASH}" } -function get_spiral() { - local EDITION="${1:-}" - local HASH="" - local ISO="SpiralLinux_${EDITION}_12.231005_x86-64.iso" - local URL="https://sourceforge.net/projects/spirallinux/files/12.231005" +function get_sparkylinux() { + local EDITION="${1:-}" + local HASH="" + local ISO="" + local URL="" - HASH=$(wget -q -O- 'https://sourceforge.net/projects/spirallinux/rss?path=/' | grep "${ISO}" | grep 'md5' | cut -d'<' -f3 | cut -d'>' -f2) - echo "${URL}/${ISO}" "${HASH}" + ISO="sparkylinux-${RELEASE}-x86_64-${EDITION}.iso" + case ${EDITION} in + minimalcli) URL="https://sourceforge.net/projects/sparkylinux/files/cli";; + minimalgui) URL="https://sourceforge.net/projects/sparkylinux/files/base";; + *) URL="https://sourceforge.net/projects/sparkylinux/files/${EDITION}";; + esac + + HASH=$(wget -q -O- ${URL}/${ISO}.allsums.txt | head -2 | grep 'iso' | cut -d' ' -f1) + echo "${URL}/${ISO}" "${HASH}" +} + +function get_spiral() { + local EDITION="${1:-}" + local HASH="" + local ISO="SpiralLinux_${EDITION}_12.231005_x86-64.iso" + local URL="https://sourceforge.net/projects/spirallinux/files/12.231005" + + HASH=$(wget -q -O- 'https://sourceforge.net/projects/spirallinux/rss?path=/' | grep "${ISO}" | grep 'md5' | cut -d'<' -f3 | cut -d'>' -f2) + echo "${URL}/${ISO}" "${HASH}" } function get_tails() { @@ -3374,15 +3419,12 @@ else echo -n " - Operating Systems: " os_support echo " - You can also use this arguments: - Only show ISO download URL - --show-iso-url / -u {distro} {release} [edition] - Test if ISO is available - --test-iso-url / -t {distro} {release} [edition] - Open distro homepage - --open-distro-homepage / -o {distro} - Only show distro homepage link - --show-distro-homepage / -s {distro}" +You can also use these arguments +--show-iso-url / -u : Show ISO download URL +--test-iso-url / -t : Test if ISO is available +--download-iso / -d : Download ISO +--open-distro-homepage / -o : Open distro homepage +--show-distro-homepage / -s : Show distro homepage link" exit 1 fi @@ -3467,11 +3509,11 @@ if [ -n "${2}" ]; then fi else if [ "${open_distro_homepage}" == 'on' ]; then - HOMEPAGE=$(os_homepages ${OS}) + HOMEPAGE=$(os_homepage ${OS}) open_url "${HOMEPAGE}" && exit 0 fi if [ "${show_distro_homepage}" == 'on' ]; then - HOMEPAGE=$(os_homepages ${OS}) + HOMEPAGE=$(os_homepage ${OS}) echo "${HOMEPAGE}" && exit 0 fi echo "ERROR! You must specify a release."