Compare commits

..

No commits in common. "master" and "4.9.7" have entirely different histories.

21 changed files with 133 additions and 288 deletions

View File

@ -13,9 +13,9 @@ jobs:
name: Flake Checker
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: DeterminateSystems/nix-installer-action@v19
- uses: DeterminateSystems/magic-nix-cache-action@v9
- uses: DeterminateSystems/flake-checker-action@v12
- uses: DeterminateSystems/nix-installer-action@v16
- uses: DeterminateSystems/magic-nix-cache-action@v8
- uses: DeterminateSystems/flake-checker-action@v9

View File

@ -10,11 +10,11 @@ jobs:
name: Flake Lock Updater
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: DeterminateSystems/nix-installer-action@v19
- uses: DeterminateSystems/magic-nix-cache-action@v9
- uses: DeterminateSystems/update-flake-lock@v27
- uses: DeterminateSystems/nix-installer-action@v16
- uses: DeterminateSystems/magic-nix-cache-action@v8
- uses: DeterminateSystems/update-flake-lock@v24
with:
pr-title: "chore: update flake.lock"

View File

@ -15,7 +15,7 @@ jobs:
name: Validate pull request title
runs-on: ubuntu-22.04
steps:
- uses: amannn/action-semantic-pull-request@v6
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:

View File

@ -10,7 +10,7 @@ jobs:
name: Shellcheck
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:

View File

@ -16,7 +16,7 @@ jobs:
name: "Check versions ⚖️"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Compare App and Git versions 🟰"
@ -37,7 +37,7 @@ jobs:
name: "Draft Release 📥️"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Create release ${{ github.ref }} as a draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -49,7 +49,7 @@ jobs:
name: "Build Release 👨‍🔧"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Build and Upload .deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -67,7 +67,7 @@ jobs:
name: "Publish Release 📤️"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Publish release ${{ github.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -85,7 +85,7 @@ jobs:
id-token: "write"
contents: "read"
steps:
- uses: "actions/checkout@v5"
- uses: "actions/checkout@v4"
with:
ref: "${{ (inputs.tag != null) && format('refs/tags/{0}', inputs.tag) || '' }}"
- uses: "DeterminateSystems/nix-installer-action@main"
@ -102,7 +102,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: "Checkout 🥡"
uses: actions/checkout@v5
uses: actions/checkout@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Import gpg key 🔑"

View File

@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: "Checkout 🥡"
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: "Build & Test .deb 🍥"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -51,11 +51,11 @@ jobs:
contents: "read"
steps:
- name: "Checkout 🥡"
uses: "actions/checkout@v5"
uses: "actions/checkout@v4"
- name: "Install Nix ❄️"
uses: "DeterminateSystems/nix-installer-action@v19"
uses: "DeterminateSystems/nix-installer-action@v16"
- name: "Enable Magic Nix Cache 🪄"
uses: "DeterminateSystems/magic-nix-cache-action@v9"
uses: "DeterminateSystems/magic-nix-cache-action@v8"
- name: "Build & Test .nix ❄️"
run: |
nix build .#quickemu

View File

@ -18,7 +18,7 @@ jobs:
name: "Run quickget tests 👟"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: "Install dependencies 📦️"
run: |
sudo apt-get -y update

2
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "build-docs"]
path = build-docs
url = https://github.com/philclifford/quickemu-docs.git
url = git@github.com:philclifford/quickemu-docs.git

View File

@ -1,47 +0,0 @@
class Quickemu < Formula
desc "Quickly create and run optimised Windows, macOS and Linux virtual machines"
homepage "https://github.com/quickemu-project/quickemu"
livecheck do
url :stable
end
stable do
latest_release = JSON.parse(Utils.safe_popen_read("curl", "-s", "https://api.github.com/repos/quickemu-project/quickemu/releases/latest"))
version latest_release["tag_name"]
url "https://api.github.com/repos/quickemu-project/quickemu/tarball/#{latest_release["tag_name"]}"
end
head "https://github.com/quickemu-project/quickemu.git"
license "MIT"
depends_on "bash"
depends_on "cdrtools"
depends_on "coreutils"
depends_on "jq"
depends_on "python3"
depends_on "qemu"
depends_on "samba"
depends_on "socat"
depends_on "swtpm"
depends_on "usbutils"
depends_on "zsync"
def install
bin.install "quickemu"
bin.install "quickget"
end
test do
# `test do` will create, run in and delete a temporary directory.
#
# This test will fail and we won't accept that! For Homebrew/homebrew-core
# this will need to be a test that verifies the functionality of the
# software. Run the test with `brew test quickemu`. Options passed
# to `brew install` such as `--HEAD` also need to be provided to `brew test`.
#
# The installed folder is not in the path, so use the entire path to any
# executables being tested: `system bin/"program", "do", "something"`.
system "false"
end
end

View File

@ -63,7 +63,7 @@ required to run the virtual machines.
## As featured on [Linux Matters](https://linuxmatters.sh) podcast!
The presenters of Linux Matters 🐧🎙️ are the creators of each of the principal Quickemu projects. We discussed Quickemu's 2024 reboot in [Episode 30 - Quickemu Rising From the Bashes](https://linuxmatters.sh/30). <!-- and in [Episode 32 - Quick, quicker, quickest](https://linuxmatters.sh/32) [Martin](https://github.com/flexiondotorg) unveils macOS host support for [**Quickemu**](https://github.com/quickemu-project/quickemu), [Mark](https://github.com/marxjohnson) explains the origins of the [**Quickgui**](https://github.com/quickemu-project/quickgui) desktop app and upcoming improvements, and [Alan](https://github.com/popey) debuts [**Quicktest**](https://github.com/quickemu-project/quicktest); a framework for automatically testing operating systems via Quickemu -->
The presenters of Linux Matters 🐧🎙️ are the creators of each of the principle Quickemu projects. We discussed Quickemu's 2024 reboot in [Episode 30 - Quickemu Rising From the Bashes](https://linuxmatters.sh/30). <!-- and in [Episode 32 - Quick, quicker, quickest](https://linuxmatters.sh/32) [Martin](https://github.com/flexiondotorg) unveils macOS host support for [**Quickemu**](https://github.com/quickemu-project/quickemu), [Mark](https://github.com/marxjohnson) explains the origins of the [**Quickgui**](https://github.com/quickemu-project/quickgui) desktop app and upcoming improvements, and [Alan](https://github.com/popey) debuts [**Quicktest**](https://github.com/quickemu-project/quicktest); a framework for automatically testing operating systems via Quickemu -->
<div align="center">
<a href="https://linuxmatters.sh" target="_blank"><img src="https://github.com/wimpysworld/nix-config/raw/main/.github/screenshots/linuxmatters.png" alt="Linux Matters Podcast"/></a>

1
debian/control vendored
View File

@ -22,7 +22,6 @@ Depends:
procps,
python3-minimal,
qemu-system (>= 6.0),
base-files (<< 13~) | qemu-system-modules-spice,
socat,
spice-client-gtk,
swtpm,

View File

@ -1,6 +1,6 @@
.\" Automatically generated by Pandoc 3.6.1
.\" Automatically generated by Pandoc 3.3
.\"
.TH "QUICKEMU" "1" "December 30, 2024" "quickemu" "Quickemu User Manual"
.TH "QUICKEMU" "1" "August 2, 2024" "quickemu" "Quickemu User Manual"
.SH NAME
quickemu \- A quick VM builder and manager
.SH SYNOPSIS
@ -691,8 +691,6 @@ wiki
.IP \[bu] 2
\f[CR]lmde\f[R] (Linux Mint Debian Edition)
.IP \[bu] 2
\f[CR]maboxlinux\f[R] (Mabox Linux)
.IP \[bu] 2
\f[CR]mageia\f[R] (Mageia)
.IP \[bu] 2
\f[CR]manjaro\f[R] (Manjaro)
@ -727,8 +725,6 @@ wiki
.IP \[bu] 2
\f[CR]primtux\f[R] (PrimTux)
.IP \[bu] 2
\f[CR]proxmox\-ve\f[R] (Proxmox VE)
.IP \[bu] 2
\f[CR]pureos\f[R] (PureOS)
.IP \[bu] 2
\f[CR]reactos\f[R] (ReactOS)

View File

@ -1,6 +1,6 @@
---
author: Martin Wimpress
date: December 30, 2024
date: August 2, 2024
footer: quickemu
header: Quickemu User Manual
section: 1
@ -473,7 +473,6 @@ Further information is available from the project
- `linuxlite` (Linux Lite)
- `linuxmint` (Linux Mint)
- `lmde` (Linux Mint Debian Edition)
- `maboxlinux` (Mabox Linux)
- `mageia` (Mageia)
- `manjaro` (Manjaro)
- `mxlinux` (MX Linux)
@ -491,7 +490,6 @@ Further information is available from the project
- `popos` (Pop!\_OS)
- `porteus` (Porteus)
- `primtux` (PrimTux)
- `proxmox-ve` (Proxmox VE)
- `pureos` (PureOS)
- `reactos` (ReactOS)
- `rebornos` (RebornOS)

View File

@ -1,6 +1,6 @@
.\" Automatically generated by Pandoc 3.6.1
.\" Automatically generated by Pandoc 3.3
.\"
.TH "QUICKEMU_CONF" "5" "December 30, 2024" "quickemu_conf" "Quickemu Configuration Manual"
.TH "QUICKEMU_CONF" "5" "August 2, 2024" "quickemu_conf" "Quickemu Configuration Manual"
.SH NAME
quickemu_conf \- Options and parameters in the quickemu <vm>.conf
.SH DESCRIPTION

View File

@ -1,6 +1,6 @@
---
author: Martin Wimpress
date: December 30, 2024
date: August 2, 2024
footer: quickemu_conf
header: Quickemu Configuration Manual
section: 5

View File

@ -1,6 +1,6 @@
.\" Automatically generated by Pandoc 3.6.1
.\" Automatically generated by Pandoc 3.3
.\"
.TH "QUICKGET" "1" "December 30, 2024" "quickget" "Quickget User Manual"
.TH "QUICKGET" "1" "August 2, 2024" "quickget" "Quickget User Manual"
.SH NAME
quickget \- download and prepare materials for building a quickemu VM
.SH SYNOPSIS
@ -252,8 +252,6 @@ wiki
.IP \[bu] 2
\f[CR]lmde\f[R] (Linux Mint Debian Edition)
.IP \[bu] 2
\f[CR]maboxlinux\f[R] (Mabox Linux)
.IP \[bu] 2
\f[CR]mageia\f[R] (Mageia)
.IP \[bu] 2
\f[CR]manjaro\f[R] (Manjaro)
@ -288,8 +286,6 @@ wiki
.IP \[bu] 2
\f[CR]primtux\f[R] (PrimTux)
.IP \[bu] 2
\f[CR]proxmox\-ve\f[R] (Proxmox VE)
.IP \[bu] 2
\f[CR]pureos\f[R] (PureOS)
.IP \[bu] 2
\f[CR]reactos\f[R] (ReactOS)

View File

@ -1,6 +1,6 @@
---
author: Martin Wimpress
date: December 30, 2024
date: August 2, 2024
footer: quickget
header: Quickget User Manual
section: 1
@ -203,7 +203,6 @@ Further information is available from the project
- `linuxlite` (Linux Lite)
- `linuxmint` (Linux Mint)
- `lmde` (Linux Mint Debian Edition)
- `maboxlinux` (Mabox Linux)
- `mageia` (Mageia)
- `manjaro` (Manjaro)
- `mxlinux` (MX Linux)
@ -221,7 +220,6 @@ Further information is available from the project
- `popos` (Pop!\_OS)
- `porteus` (Porteus)
- `primtux` (PrimTux)
- `proxmox-ve` (Proxmox VE)
- `pureos` (PureOS)
- `reactos` (ReactOS)
- `rebornos` (RebornOS)

View File

@ -16,12 +16,12 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1756217674,
"narHash": "sha256-TH1SfSP523QI7kcPiNtMAEuwZR3Jdz0MCDXPs7TS8uo=",
"rev": "4e7667a90c167f7a81d906e5a75cba4ad8bee620",
"revCount": 808864,
"lastModified": 1735264675,
"narHash": "sha256-MgdXpeX2GuJbtlBrH9EdsUeWl/yXEubyvxM1G+yO4Ak=",
"rev": "d49da4c08359e3c39c4e27c74ac7ac9b70085966",
"revCount": 712007,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2505.808864%2Brev-4e7667a90c167f7a81d906e5a75cba4ad8bee620/0198eaa3-105a-74fa-a9b2-0a930acea8de/source.tar.gz"
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2411.712007%2Brev-d49da4c08359e3c39c4e27c74ac7ac9b70085966/01940ca0-b117-7d0e-b1ef-d579ee6d2f13/source.tar.gz"
},
"original": {
"type": "tarball",

View File

@ -22,11 +22,11 @@
schemas = flake-schemas.schemas;
# Define overlays for each supported system
overlays = {
overlays = forEachSupportedSystem ({pkgs, system, ...}: {
default = final: prev: {
quickemu = final.callPackage ./package.nix { };
};
};
});
# Define packages for each supported system
packages = forEachSupportedSystem ({pkgs, system, ...}: rec {

View File

@ -395,16 +395,6 @@ function configure_cpu() {
fi
fi
# SMM is also required for Linux guests when Secure Boot is enabled
if [ "${secureboot}" == "on" ]; then
if [ "${guest_os}" == "linux" ]; then
# SMM is not available on QEMU for macOS via Homebrew
if [ "${OS_KERNEL}" == "Linux" ]; then
SMM="on"
fi
fi
fi
case ${guest_os} in
batocera|freedos|haiku|solaris) MACHINE_TYPE="pc";;
kolibrios|reactos)
@ -424,7 +414,7 @@ function configure_cpu() {
# A CPU with fma is required for Metal support
# A CPU with invtsc is required for macOS to boot
case ${macos_release} in
ventura|sonoma|sequoia)
ventura|sonoma)
# A CPU with AVX2 support is required for >= macOS Ventura
if check_cpu_flag sse4_2 && check_cpu_flag avx2; then
if [ "${HOST_CPU_VENDOR}" != "GenuineIntel" ] && [ -z "${HYPERVISOR}" ]; then
@ -614,12 +604,6 @@ function configure_ram() {
fi
}
function is_firmware_qcow2() {
# Check for the magic bytes that indicate the firmware is in qcow2 format,
# otherwise default to assuming firmware files are in raw format
[ "$(head -c 4 "$1")" = "QFI"$'\xfb' ] && echo "true" || echo "false"
}
function configure_bios() {
# Always Boot macOS using EFI
if [ "${guest_os}" == "macos" ]; then
@ -679,15 +663,14 @@ function configure_bios() {
if [ -n "${EFI_CODE}" ] || [ ! -e "${EFI_CODE}" ]; then
case ${secureboot} in
on) # shellcheck disable=SC2054,SC2140
ovmfs=("${SHARE_PATH}/OVMF/OVMF_CODE_4M.secboot.fd","${SHARE_PATH}/OVMF/OVMF_VARS_4M.ms.fd" \
"${SHARE_PATH}/edk2/ovmf/OVMF_CODE.secboot.fd","${SHARE_PATH}/edk2/ovmf/OVMF_VARS.secboot.fd" \
ovmfs=("${SHARE_PATH}/OVMF/OVMF_CODE_4M.secboot.fd","${SHARE_PATH}/OVMF/OVMF_VARS_4M.fd" \
"${SHARE_PATH}/edk2/ovmf/OVMF_CODE.secboot.fd","${SHARE_PATH}/edk2/ovmf/OVMF_VARS.fd" \
"${SHARE_PATH}/OVMF/x64/OVMF_CODE.secboot.fd","${SHARE_PATH}/OVMF/x64/OVMF_VARS.fd" \
"${SHARE_PATH}/edk2-ovmf/OVMF_CODE.secboot.fd","${SHARE_PATH}/edk2-ovmf/OVMF_VARS.fd" \
"${SHARE_PATH}/qemu/ovmf-x86_64-smm-ms-code.bin","${SHARE_PATH}/qemu/ovmf-x86_64-smm-ms-vars.bin" \
"${SHARE_PATH}/qemu/edk2-x86_64-secure-code.fd","${SHARE_PATH}/qemu/edk2-x86_64-code.fd" \
"${SHARE_PATH}/edk2-ovmf/x64/OVMF_CODE.secboot.fd","${SHARE_PATH}/edk2-ovmf/x64/OVMF_VARS.fd" \
"${SHARE_PATH}/edk2/x64/OVMF_CODE.secboot.4m.fd","${SHARE_PATH}/edk2/x64/OVMF_VARS.4m.fd" \
"${SHARE_PATH}/edk2/ovmf/OVMF_CODE_4M.secboot.qcow2","${SHARE_PATH}/edk2/ovmf/OVMF_VARS_4M.secboot.qcow2"
"${SHARE_PATH}/edk2/x64/OVMF_CODE.secboot.4m.fd","${SHARE_PATH}/edk2/x64/OVMF_VARS.4m.fd"
);;
*) # shellcheck disable=SC2054,SC2140
ovmfs=("${SHARE_PATH}/OVMF/OVMF_CODE_4M.fd","${SHARE_PATH}/OVMF/OVMF_VARS_4M.fd" \
@ -698,8 +681,7 @@ function configure_bios() {
"${SHARE_PATH}/qemu/ovmf-x86_64-4m-code.bin","${SHARE_PATH}/qemu/ovmf-x86_64-4m-vars.bin" \
"${SHARE_PATH}/qemu/edk2-x86_64-code.fd","${SHARE_PATH}/qemu/edk2-x86_64-code.fd" \
"${SHARE_PATH}/edk2-ovmf/x64/OVMF_CODE.fd","${SHARE_PATH}/edk2-ovmf/x64/OVMF_VARS.fd" \
"${SHARE_PATH}/edk2/x64/OVMF_CODE.4m.fd","${SHARE_PATH}/edk2/x64/OVMF_VARS.4m.fd" \
"${SHARE_PATH}/edk2/ovmf/OVMF_CODE_4M.qcow2","${SHARE_PATH}/edk2/ovmf/OVMF_VARS_4M.qcow2"
"${SHARE_PATH}/edk2/x64/OVMF_CODE.4m.fd","${SHARE_PATH}/edk2/x64/OVMF_VARS.4m.fd"
);;
esac
# Attempt each EFI_CODE file one by one, selecting the corresponding code and vars
@ -730,14 +712,6 @@ function configure_bios() {
echo " - EFI: ERROR! EFI_EXTRA_VARS file ${EFI_EXTRA_VARS} does not exist."
exit 1
fi
# Write destination vars file with correct extension
# based on source format of the EFI_EXTRA_VARS file
QCOW2VARS=$(is_firmware_qcow2 "${EFI_EXTRA_VARS}")
if [ "${QCOW2VARS}" = "true" ]; then
EFI_VARS="${VMDIR}/OVMF_VARS.qcow2"
else
EFI_VARS="${VMDIR}/OVMF_VARS.fd"
fi
efi_vars "${EFI_EXTRA_VARS}" "${EFI_VARS}"
fi
@ -756,7 +730,7 @@ function configure_bios() {
EFI_CODE=$(realpath "${EFI_CODE}")
echo "${EFI_CODE}"
fi
BOOT_STATUS="EFI (${guest_os^}), OVMF (${EFI_CODE}), EFI Vars (${EFI_VARS}), SecureBoot (${secureboot})."
BOOT_STATUS="EFI (${guest_os^}), OVMF (${EFI_CODE}), SecureBoot (${secureboot})."
else
BOOT_STATUS="Legacy BIOS (${guest_os^})"
boot="legacy"
@ -768,7 +742,7 @@ function configure_bios() {
function configure_os_quirks() {
if [ "${guest_os}" == "batocera" ] || [ "${guest_os}" == "haiku" ] || [ "${guest_os}" == "kolibrios" ]; then
if [ "${guest_os}" == "batocera" ] || [ "${guest_os}" == "freedos" ] || [ "${guest_os}" == "haiku" ] || [ "${guest_os}" == "kolibrios" ]; then
NET_DEVICE="rtl8139"
fi
@ -779,8 +753,7 @@ function configure_os_quirks() {
case ${guest_os} in
windows-server) NET_DEVICE="e1000";;
*bsd|linux*|windows) NET_DEVICE="virtio-net";;
freedos) sound_card="sb16"
NET_DEVICE="pcnet";;
freedos) sound_card="sb16";;
*solaris) usb_controller="xhci"
sound_card="ac97";;
reactos) NET_DEVICE="e1000"
@ -793,7 +766,7 @@ function configure_os_quirks() {
# * VirtIO Memory Balloning is supported since Big Sur (https://pmhahn.github.io/virtio-balloon/)
# * VirtIO RNG is supported since Big Sur, but exposed to all guests by default.
case ${macos_release} in
big-sur|monterey|ventura|sonoma|sequoia)
big-sur|monterey|ventura|sonoma)
BALLOON="-device virtio-balloon"
MAC_DISK_DEV="virtio-blk-pci"
NET_DEVICE="virtio-net"
@ -909,12 +882,7 @@ function configure_storage() {
function configure_display() {
# Determine which audio driver use between Pulseaudio or ALSA
local AUDIO_DRIVER="pa"
if pidof pipewire >/dev/null 2>&1; then
# QEMU's pipewire audio backend was added in version 8.1
if [ "${QEMU_VER_SHORT}" -ge 81 ]; then
AUDIO_DRIVER="pipewire"
fi
elif ! pidof pulseaudio >/dev/null 2>&1; then
if ! command -v pacmd >/dev/null 2>&1 ; then
AUDIO_DRIVER="alsa"
fi
@ -1214,8 +1182,6 @@ function vm_boot() {
# Set the hostname of the VM
NET="user,hostname=${VMNAME}"
echo "#!/usr/bin/env bash" > "${VMDIR}/${VMNAME}.sh"
configure_cpu
configure_ram
configure_bios
@ -1228,6 +1194,8 @@ function vm_boot() {
configure_usb
configure_tpm
echo "#!/usr/bin/env bash" > "${VMDIR}/${VMNAME}.sh"
# Changing process name is not supported on macOS
if [ "${OS_KERNEL}" == "Linux" ]; then
# shellcheck disable=SC2054,SC2206,SC2140
@ -1391,14 +1359,10 @@ function vm_boot() {
# Add the disks
# - https://turlucode.com/qemu-disk-io-performance-comparison-native-or-threads-windows-10-version/
if [[ "${boot}" == *"efi"* ]]; then
QCOW2CODE=$(is_firmware_qcow2 "${EFI_CODE}")
QCOW2VARS=$(is_firmware_qcow2 "${EFI_VARS}")
if [ "${QCOW2CODE}" = "true" ]; then EFI_CODE_FORMAT="qcow2"; else EFI_CODE_FORMAT="raw"; fi
if [ "${QCOW2VARS}" = "true" ]; then EFI_VARS_FORMAT="qcow2"; else EFI_VARS_FORMAT="raw"; fi
# shellcheck disable=SC2054
args+=(-global driver=cfi.pflash01,property=secure,value=on
-drive if=pflash,format="${EFI_CODE_FORMAT}",unit=0,file="${EFI_CODE}",readonly=on
-drive if=pflash,format="${EFI_VARS_FORMAT}",unit=1,file="${EFI_VARS}")
-drive if=pflash,format=raw,unit=0,file="${EFI_CODE}",readonly=on
-drive if=pflash,format=raw,unit=1,file="${EFI_VARS}")
fi
if [ -n "${iso}" ] && [ "${guest_os}" == "freedos" ]; then
@ -1823,7 +1787,6 @@ function fileshare_param_check() {
if [ ! -d "${PUBLIC}" ]; then
echo " - WARNING! Public directory: '${PUBLIC}' doesn't exist!"
PUBLIC=""
else
PUBLIC_TAG="Public-${USER,,}"
PUBLIC_PERMS=$(${STAT} -c "%A" "${PUBLIC}")
@ -1951,7 +1914,7 @@ VMPATH=""
# shellcheck disable=SC2155
readonly LAUNCHER=$(basename "${0}")
readonly DISK_MIN_SIZE=$((197632 * 8))
readonly VERSION="4.9.8"
readonly VERSION="4.9.7"
# TODO: Make this run the native architecture binary
ARCH_VM="x86_64"
@ -1975,8 +1938,7 @@ if [ "${OS_KERNEL}" == "Darwin" ]; then
fi
QEMU_VER_LONG=$(${QEMU_IMG} --version | head -n 1 | awk '{print $3}')
# strip patch version and remove dots. 6.0.0 => 60 / 10.0.0 => 100
QEMU_VER_SHORT=$(echo "${QEMU_VER_LONG%.*}" | sed 's/\.//g')
QEMU_VER_SHORT=$(echo "${QEMU_VER_LONG//./}" | cut -c1-2)
if [ "${QEMU_VER_SHORT}" -lt 60 ]; then
echo "ERROR! QEMU 6.0.0 or newer is required, detected ${QEMU_VER_LONG}."
exit 1

213
quickget
View File

@ -5,9 +5,6 @@
# shellcheck disable=SC2317
export LC_ALL=C
# Detect host OS for checksum tool compatibility
HOST_OS=$(uname -s)
function cleanup() {
if [ -n "$(jobs -p)" ]; then
kill "$(jobs -p)" 2>/dev/null
@ -81,7 +78,6 @@ function os_info() {
opensuse) INFO="openSUSE|-|https://www.opensuse.org/|The makers choice for sysadmins, developers and desktop users.";;
oraclelinux) INFO="Oracle Linux|-|https://www.oracle.com/linux/|Linux with everything required to deploy, optimize, and manage applications on-premises, in the cloud, and at the edge.";;
parrotsec) INFO="Parrot Security|parrot:parrot|https://www.parrotsec.org/|Provides a huge arsenal of tools, utilities and libraries that IT and security professionals can use to test and assess the security of their assets in a reliable, compliant and reproducible way.";;
pclinuxos) INFO="PCLinuxOS|-|https://www.pclinuxos.com/|PCLinuxOS is a free easy to use Linux-based Operating System for x86_64 desktops or laptops.";;
peppermint) INFO="PeppermintOS|-|https://peppermintos.com/|Provides a user with the opportunity to build the system that best fits their needs. While at the same time providing a functioning OS with minimum hassle out of the box.";;
popos) INFO="Pop!_OS|-|https://pop.system76.com/|Operating system for STEM and creative professionals who use their computer as a tool to discover and create.";;
porteus) INFO="Porteus|-|http://www.porteus.org/|Complete linux operating system that is optimized to run from CD, USB flash drive, hard drive, or other bootable storage media.";;
@ -101,7 +97,7 @@ function os_info() {
spirallinux) INFO="SpiralLinux|-|https://spirallinux.github.io/|Selection of Linux spins built from Debian GNU/Linux, with a focus on simplicity and out-of-the-box usability across all the major desktop environments.";;
tails) INFO="Tails|-|https://tails.net/|Portable operating system that protects against surveillance and censorship.";;
tinycore) INFO="Tiny Core Linux|-|http://www.tinycorelinux.net/|Highly modular based system with community build extensions.";;
trisquel) INFO="Trisquel|-|https://trisquel.info/|Fully free operating system for home users, small enterprises and educational centers.";;
trisquel) INFO="Trisquel-|https://trisquel.info/|Fully free operating system for home users, small enterprises and educational centers.";;
truenas-core) INFO="TrueNAS Core|-|https://www.truenas.com/truenas-core/|Worlds most popular storage OS because it gives you the power to build your own professional-grade storage system to use in a variety of data-intensive applications without any software costs.";;
truenas-scale) INFO="TrueNAS Scale|-|https://www.truenas.com/truenas-scale/|Open Source Hyperconverged Infrastructure (HCI) solution. In addition to powerful scale-out storage capabilities, SCALE adds Linux Containers and VMs (KVM) so apps run closer to data.";;
tuxedo-os) INFO="Tuxedo OS|-|https://www.tuxedocomputers.com/en/|KDE Ubuntu LTS designed to go with their Linux hardware.";;
@ -150,7 +146,7 @@ function error_specify_os() {
}
function os_supported() {
if [[ ! " $(os_support) " =~ \ "${OS}"\ ]]; then
if [[ ! "$(os_support)" =~ ${OS} ]]; then
echo -e "ERROR! ${OS} is not a supported OS.\n"
os_support | fmt -w 80
exit 1
@ -189,7 +185,7 @@ function error_specify_release() {
}
function error_not_supported_release() {
if [[ ! " ${RELEASES[*]} " =~ \ "${RELEASE}"\ ]]; then
if [[ ! "${RELEASES[*]}" =~ ${RELEASE} ]]; then
echo -e "ERROR! ${DISPLAY_NAME} ${RELEASE} is not a supported release.\n"
echo -n ' - Supported releases: '
"releases_${OS}"
@ -213,17 +209,6 @@ function error_not_supported_argument() {
exit 1
}
function is_valid_language() {
local I18N=""
local PASSED_I18N="${1}"
for I18N in "${I18NS[@]}"; do
if [[ "${I18N}" == "${PASSED_I18N}" ]]; then
return 0
fi
done
return 1
}
function handle_missing() {
# Handle odd missing Fedora combinations
case "${OS}" in
@ -475,7 +460,6 @@ function os_support() {
opensuse \
oraclelinux \
parrotsec \
pclinuxos \
peppermint \
popos \
porteus \
@ -561,7 +545,9 @@ function releases_archlinux() {
function releases_arcolinux() {
#shellcheck disable=SC2046,SC2005
echo $(web_pipe "https://ant.seedhost.eu/arcolinux/iso/" | grep -o -E -e "v[[:digit:]]{2}.[[:digit:]]{2}.[[:digit:]]{2}" | sort -ru | head -n 5)
# breaking change in v24.05
# v24.05.1 is the first release with the new naming scheme and too complex to parse old and new so just show the new
echo $(web_pipe "https://mirror.accum.se/mirror/arcolinux.info/iso/" | grep -o -E -e "v24.0[5-9].[[:digit:]]{2}" -e "v24.1[0-2].[[:digit:]]{2}" | sort -ru | head -n 5)
}
function editions_arcolinux() {
@ -593,7 +579,7 @@ function releases_bazzite() {
}
function editions_bazzite() {
echo gnome plasma deck-gnome deck-plasma
echo gnome kde
}
function releases_biglinux() {
@ -746,7 +732,7 @@ function editions_freebsd() {
}
function releases_freedos() {
echo 1.4 1.3 1.2
echo 1.3 1.2
}
function releases_garuda() {
@ -816,7 +802,7 @@ function releases_linuxlite() {
}
function releases_linuxmint() {
echo 22.1 22 21.3 21.2 21.1 21 20.3 20.2
echo 22 21.3 21.2 21.1 21 20.3 20.2
}
function editions_linuxmint() {
@ -836,7 +822,7 @@ function releases_maboxlinux() {
}
function releases_macos() {
echo mojave catalina big-sur monterey ventura sonoma sequoia
echo mojave catalina big-sur monterey ventura sonoma
}
function releases_mageia() {
@ -857,7 +843,7 @@ function releases_manjaro() {
function releases_mxlinux() {
# needs header, so not web_pipe:
curl --disable -Ils "https://sourceforge.net/projects/mx-linux/files/latest/download" | grep -i 'location:' | cut -d? -f1 | cut -d_ -f1 | cut -d- -f3
curl -Ils "https://sourceforge.net/projects/mx-linux/files/latest/download" | grep -i 'location:' | cut -d? -f1 | cut -d_ -f1 | cut -d- -f3
}
function editions_mxlinux() {
@ -879,13 +865,13 @@ function releases_nitrux() {
}
function releases_nixos() {
# Lists unstable plus the most recent release
# Lists unstable plus the two most recent releases
#shellcheck disable=SC2046
echo unstable $(web_pipe "https://nix-channels.s3.amazonaws.com/?delimiter=/" | grep -o -E 'nixos-[[:digit:]]+\.[[:digit:]]+' | cut -d- -f2 | sort -nru | head -n +1)
echo unstable $(web_pipe "https://nix-channels.s3.amazonaws.com/?delimiter=/" | grep -o -E 'nixos-[[:digit:]]+\.[[:digit:]]+' | cut -d- -f2 | sort -nru | head -n +2)
}
function editions_nixos() {
echo minimal graphical
echo minimal plasma gnome
}
function releases_nwg-shell() {
@ -900,9 +886,7 @@ function releases_openbsd() {
function releases_openindiana() {
#shellcheck disable=SC2046,SC2005
#echo $(web_pipe "https://dlc.openindiana.org/isos/hipster/" | grep link | cut -d'/' -f 1 | cut -d '"' -f4 | sort -r | tail -n +2 | head -n 5)
echo $(web_pipe "https://dlc.openindiana.org/isos/hipster/" | grep 'href="./2' | cut -d'/' -f 2 | sort -r | head -n 5)
echo $(web_pipe "https://dlc.openindiana.org/isos/hipster/" | grep link | cut -d'/' -f 1 | cut -d '"' -f4 | sort -r | tail -n +2 | head -n 5)
}
function editions_openindiana() {
@ -920,22 +904,13 @@ function releases_oraclelinux() {
function releases_parrotsec() {
#shellcheck disable=SC2046,SC2005
echo $(web_pipe "https://deb.parrot.sh/parrot/iso/" | grep -o -E 'href="([[:digit:]]+\.)+[[:digit:]]+/' | sort -nr | head -n 3 | cut -d\" -f 2 | cut -d'/' -f 1)
echo $(web_pipe "https://download.parrot.sh/parrot/iso/" | grep -o -E 'href="[[:digit:]]\.[[:digit:]]+' | sort -nr | head -n 3 | cut -d\" -f 2 )
}
function editions_parrotsec() {
echo home htb security
}
function releases_pclinuxos() {
# shellcheck disable=SC2046
echo $(web_pipe "https://ftp.fau.de/pclinuxos/pclinuxos/iso" | grep -oP 'pclinuxos64-\K[^\-]+-\K[0-9]+\.[0-9]+' | head -n 1)
}
function editions_pclinuxos() {
echo kde kde-darkstar mate xfce
}
function releases_peppermint() {
echo latest
}
@ -1004,8 +979,7 @@ function releases_siduction() {
function editions_siduction() {
#shellcheck disable=SC2046,SC2005
NAME=$(web_pipe "https://mirror.math.princeton.edu/pub/siduction/iso/" | grep folder | cut -d'"' -f8 | tr -d '/')
web_pipe "https://mirror.math.princeton.edu/pub/siduction/iso/${NAME}/" | grep folder | cut -d'"' -f8 | tr -d '/' | sort -u
echo $(web_pipe "https://mirror.math.princeton.edu/pub/siduction/iso/Standing_on_the_Shoulders_of_Giants/" | grep folder | cut -d'"' -f8 | tr -d '/' | sort -u)
}
function releases_slackware() {
@ -1037,7 +1011,7 @@ function releases_solus() {
function editions_solus() {
#shellcheck disable=SC2046,SC2005
echo $(web_pipe_json "https://downloads.getsol.us/isos/$(IFS=' '; releases_solus | tail -n1)/" | jq -r '.[].name | select(endswith("iso")) | sub("Solus-(?<e>.*)-Release-.*"; "\(.e)")' | sort -u)
echo $(web_pipe_json "https://downloads.getsol.us/isos/$(releases_solus | tail -n1)/" | jq -r '.[].name | sub("Solus-(?<e>.*)-Release-.*"; "\(.e)")' | sort -u)
}
function releases_sparkylinux() {
@ -1195,17 +1169,6 @@ function check_hash() {
*) echo "WARNING! Can't guess hash algorithm, not checking ${iso} hash."
return;;
esac
# Use GNU coreutils on macOS/Darwin (prefixed with 'g')
if [ "${HOST_OS}" = "Darwin" ]; then
case ${hash_algo} in
md5sum) hash_algo=gmd5sum;;
sha1sum) hash_algo=gsha1sum;;
sha256sum) hash_algo=gsha256sum;;
sha512sum) hash_algo=gsha512sum;;
esac
fi
echo -n "Checking ${iso} with ${hash_algo}... "
if ! echo "${hash} ${iso}" | ${hash_algo} --check --status; then
echo "ERROR!"
@ -1218,12 +1181,12 @@ function check_hash() {
# Download a file from the web and pipe it to stdout
function web_pipe() {
curl --disable --silent --location "${1}"
curl --silent --location "${1}"
}
# Download a JSON file from the web and pipe it to stdout
function web_pipe_json() {
curl --disable --silent --location --header "Accept: application/json" "${1}"
curl --silent --location --header "Accept: application/json" "${1}"
}
# Download a file from the web
@ -1274,10 +1237,9 @@ function web_get() {
if [[ ${OS} != windows && ${OS} != macos && ${OS} != windows-server ]]; then
echo "Downloading $(pretty_name "${OS}") ${RELEASE} ${EDITION}"
echo "- URL: ${URL}"
echo "- PATH: ${PWD}/${DIR}/${FILE}"
fi
if ! curl --disable --progress-bar --location --output "${DIR}/${FILE}" --continue-at - --user-agent "${USER_AGENT}" "${HEADERS[@]}" -- "${URL}"; then
if ! curl --progress-bar --location --output "${DIR}/${FILE}" --continue-at - --user-agent "${USER_AGENT}" "${HEADERS[@]}" -- "${URL}"; then
echo "ERROR! Failed to download ${URL} with curl."
rm -f "${DIR}/${FILE}"
fi
@ -1289,7 +1251,7 @@ function web_redirect() {
local URL="${1}"
# Check for URL redirections
# Output to nonexistent directory so the download fails fast
REDIRECT_URL=$(curl --disable --silent --location --fail --write-out '%{url_effective}' --output /var/cache/${RANDOM}/${RANDOM} "${URL}" )
REDIRECT_URL=$(curl --silent --location --fail --write-out '%{url_effective}' --output /var/cache/${RANDOM}/${RANDOM} "${URL}" )
if [ "${REDIRECT_URL}" != "${URL}" ]; then
echo "${REDIRECT_URL}"
else
@ -1310,7 +1272,7 @@ function web_check() {
shift
fi
done
curl --disable --silent --location --head --output /dev/null --fail --connect-timeout 30 --max-time 30 --retry 3 "${HEADERS[@]}" "${URL}"
curl --silent --location --head --output /dev/null --fail --connect-timeout 30 --max-time 30 --retry 3 "${HEADERS[@]}" "${URL}"
}
function zsync_get() {
@ -1628,7 +1590,7 @@ function get_archcraft() {
function get_archlinux() {
local HASH=""
local ISO=""
local URL="https://geo.mirror.pkgbuild.com/"
local URL="https://mirror.rackspace.com/archlinux"
ISO=$(web_pipe "https://archlinux.org/releng/releases/json/" | jq -r '.releases[0].iso_url')
HASH=$(web_pipe "https://archlinux.org/releng/releases/json/" | jq -r '.releases[0].sha256_sum')
echo "${URL}${ISO} ${HASH}"
@ -1638,7 +1600,7 @@ function get_arcolinux() {
local HASH=""
local ISO=""
local URL=""
URL="https://ant.seedhost.eu/arcolinux/iso/${RELEASE}"
URL="https://mirror.accum.se/mirror/arcolinux.info/iso/${RELEASE}"
ISO="arco${EDITION}-${RELEASE}-x86_64.iso"
HASH=$(web_pipe "${URL}/${ISO}.sha256" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
@ -1674,10 +1636,8 @@ function get_bazzite() {
local ISO=""
local URL="https://download.bazzite.gg"
case ${EDITION} in
gnome) ISO="bazzite-gnome-stable-amd64.iso";;
plasma) ISO="bazzite-stable-amd64.iso";;
deck-gnome) ISO="bazzite-deck-gnome-stable-amd64.iso";;
deck-plasma) ISO="bazzite-deck-stable-amd64.iso";;
gnome) ISO="bazzite-gnome-stable.iso";;
kde) ISO="bazzite-stable.iso";;
esac
HASH=$(web_pipe "${URL}/${ISO}-CHECKSUM" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
@ -1875,28 +1835,21 @@ function get_fedora() {
local URL=""
local VARIANT=""
case ${EDITION} in
Server|Kinoite|Onyx|Silverblue|Sericea|Workstation|KDE) VARIANT="${EDITION}";;
Server|Kinoite|Onyx|Silverblue|Sericea|Workstation) VARIANT="${EDITION}";;
*) VARIANT="Spins";;
esac
# Handle KDE as a proper edition from 42 but a spin prior to 42
# Stripping eventual _Beta suffix from the RELEASE variable in the check
if [[ "${VARIANT}" == "KDE" && "${RELEASE/_Beta/}" -lt 42 ]]; then
VARIANT="Spins"
fi
# The naming of 41 Beta with a space is problematic so we replaced it with an underscore
# but we need to convert it back to a space for the URL search in the JSON
#shellcheck disable=SC2086
# if RELEASE contains an underscore, replace it with a space
if [[ "${RELEASE}" == *"_"* ]]; then
if [[ "${RELEASE}" == *"_"* ]]; then
RELEASE="${RELEASE/_/ }"
fi
# shellcheck disable=SC2086
# Fedora may promote variants from Spins to Editions, in which case we want to accept either "Spins" or the specific edition name to preserve backwards compatibility
# For example, Fedora 42 KDE is now an edition, while previous releases are spins
JSON=$(web_pipe "https://getfedora.org/releases.json" | jq '.[] | select((.variant=="'"${VARIANT}"'" or .variant=="'"${EDITION}"'") and .subvariant=="'"${EDITION}"'" and .arch=="x86_64" and .version=="'"${RELEASE}"'" and (.link | endswith(".iso")))')
JSON=$(web_pipe "https://getfedora.org/releases.json" | jq '.[] | select(.variant=="'${VARIANT}'" and .subvariant=="'"${EDITION}"'" and .arch=="x86_64" and .version=="'"${RELEASE}"'" and (.link | endswith(".iso")))')
URL=$(echo "${JSON}" | jq -r '.link' | head -n1)
HASH=$(echo "${JSON}" | jq -r '.sha256' | head -n1)
echo "${URL} ${HASH}"
@ -1913,17 +1866,11 @@ function get_freebsd() {
function get_freedos() {
local HASH=""
local ISO=""
local BASE_URL="https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/${RELEASE}"
local URL=""
local URL="https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/${RELEASE}/official"
case ${RELEASE} in
1.2) URL="${BASE_URL}/official"
ISO="FD12CD.iso"
1.2) ISO="FD12CD.iso"
HASH=$(web_pipe "${URL}/FD12.sha" | grep "${ISO}" | cut -d' ' -f1);;
1.3) URL="${BASE_URL}/official"
ISO="FD13-LiveCD.zip"
HASH=$(web_pipe "${URL}/verify.txt" | grep -A 8 "sha256sum" | grep "${ISO}" | cut -d' ' -f1);;
1.4) URL="${BASE_URL}"
ISO="FD14-LiveCD.zip"
1.3) ISO="FD13-LiveCD.zip"
HASH=$(web_pipe "${URL}/verify.txt" | grep -A 8 "sha256sum" | grep "${ISO}" | cut -d' ' -f1);;
esac
echo "${URL}/${ISO} ${HASH}"
@ -2115,8 +2062,6 @@ function get_macos() {
ventura|13)
BOARD_ID="Mac-BE088AF8C5EB4FA2";;
sonoma|14)
BOARD_ID="Mac-827FAC58A8FDFA22";;
sequoia|15)
BOARD_ID="Mac-53FDB3D8DB8CA971";;
*) echo "ERROR! Unknown release: ${RELEASE}"
releases_macos
@ -2130,10 +2075,10 @@ function get_macos() {
CHUNKCHECK="$(command -v chunkcheck)"
fi
appleSession=$(curl --disable -v -H "Host: osrecovery.apple.com" \
appleSession=$(curl -v -H "Host: osrecovery.apple.com" \
-H "Connection: close" \
-A "InternetRecovery/1.0" https://osrecovery.apple.com/ 2>&1 | tr ';' '\n' | awk -F'session=|;' '{print $2}' | grep 1)
info=$(curl --disable -s -X POST -H "Host: osrecovery.apple.com" \
info=$(curl -s -X POST -H "Host: osrecovery.apple.com" \
-H "Connection: close" \
-A "InternetRecovery/1.0" \
-b "session=\"${appleSession}\"" \
@ -2268,6 +2213,16 @@ function get_nitrux() {
function get_nixos() {
local HASH=""
# Adapt the plasma edition according to the NixOS release
case "${EDITION}" in
plasma)
if [ "${RELEASE}" == "23.11" ]; then
EDITION+="5"
else
EDITION+="6"
fi
;;
esac
local ISO="latest-nixos-${EDITION}-x86_64-linux.iso"
local URL="https://channels.nixos.org/nixos-${RELEASE}"
HASH=$(web_pipe "${URL}/${ISO}.sha256" | cut -d' ' -f1)
@ -2348,21 +2303,6 @@ function get_parrotsec() {
echo "${URL}/${ISO} ${HASH}"
}
function get_pclinuxos() {
case ${EDITION} in
mate) RELEASE="${RELEASE//./-}";;
# in case an edition is added that uses the mate style and sorts higher
kde|kde-darkstar) RELEASE="${RELEASE//-/.}";;
xfce) RELEASE="${RELEASE//-/.}";;
*) ;;
esac
# shellcheck disable=SC2155
local HASH="$(web_pipe "${URL}/pclinuxos64-${EDITION}-${RELEASE}.md5sum" | head -c 32)"
local ISO="pclinuxos64-${EDITION}-${RELEASE}.iso"
local URL="https://ftp.fau.de/pclinuxos/pclinuxos/iso"
echo "${URL}/${ISO} ${HASH}"
}
function get_peppermint() {
local HASH=""
local ISO=""
@ -2475,14 +2415,10 @@ function get_siduction() {
local HASH=""
local DATE=""
local ISO=""
local NAME=""
local URL=""
NAME=$(web_pipe "https://mirror.math.princeton.edu/pub/siduction/iso/" | grep folder | cut -d'"' -f8 | tr -d '/')
URL="https://mirrors.dotsrc.org/siduction/iso/${NAME}/${EDITION}"
local URL="https://mirrors.dotsrc.org/siduction/iso/Standing_on_the_Shoulders_of_Giants/${EDITION}"
DATE=$(web_pipe "${URL}"| grep .iso.md5 | cut -d'-' -f6 | cut -d'.' -f1)
HASH=$(web_pipe "${URL}/${ISO}.md5" | cut -d' ' -f1)
VERSION=$(web_pipe "${URL}"| grep .iso.md5 | cut -d'-' -f2)
ISO="siduction-${VERSION}-${NAME}-${EDITION}-amd64-${DATE}.iso"
ISO="siduction-2023.1.1-Standing_on_the_Shoulders_of_Giants-${EDITION}-amd64-${DATE}.iso"
echo "${URL}/${ISO} ${HASH}"
}
@ -2639,11 +2575,11 @@ function get_ubuntu-server() {
esac
if web_check "${URL}/SHA256SUMS"; then
DATA=$(web_pipe "${URL}/SHA256SUMS" | grep "${NAME}" | grep amd64 | grep iso | tail -n 1 )
DATA=$(web_pipe "${URL}/SHA256SUMS" | grep "${NAME}" | grep amd64 | grep iso)
ISO=$(cut -d'*' -f2 <<<"${DATA}")
HASH=$(cut -d' ' -f1 <<<"${DATA}")
else
DATA=$(web_pipe "${URL}/MD5SUMS" | grep "${NAME}" | grep amd64 | grep iso | tail -n 1 )
DATA=$(web_pipe "${URL}/MD5SUMS" | grep "${NAME}" | grep amd64 | grep iso)
ISO=$(cut -d' ' -f3 <<<"${DATA}")
HASH=$(cut -d' ' -f1 <<<"${DATA}")
fi
@ -2683,11 +2619,11 @@ function get_ubuntu() {
URL="https://cdimage.ubuntu.com/${OS}/releases/${RELEASE}/release"
fi
if web_check "${URL}/SHA256SUMS"; then
DATA=$(web_pipe "${URL}/SHA256SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | grep iso | grep -v "+mac" | tail -n 1 )
DATA=$(web_pipe "${URL}/SHA256SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | grep iso | grep -v "+mac")
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 amd64 | grep iso | grep -v "+mac" | tail -n 1 )
DATA=$(web_pipe "${URL}/MD5SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | grep iso | grep -v "+mac")
ISO=$(cut -d'*' -f2 <<<"${DATA}")
HASH=$(cut -d' ' -f1 <<<"${DATA}")
fi
@ -2942,15 +2878,21 @@ function unattended_windows() {
<Path>E:\qxldod\w10\amd64</Path>
</PathAndCredentials>
<PathAndCredentials wcm:action="add" wcm:keyValue="7">
<Path>E:\viorng\w10\amd64</Path>
<Path>E:\amd64\w10</Path>
</PathAndCredentials>
<PathAndCredentials wcm:action="add" wcm:keyValue="8">
<Path>E:\NetKVM\w10\amd64</Path>
<Path>E:\viogpudo\w10\amd64</Path>
</PathAndCredentials>
<PathAndCredentials wcm:action="add" wcm:keyValue="9">
<Path>E:\viofs\w10\amd64</Path>
<Path>E:\viorng\w10\amd64</Path>
</PathAndCredentials>
<PathAndCredentials wcm:action="add" wcm:keyValue="10">
<Path>E:\NetKVM\w10\amd64</Path>
</PathAndCredentials>
<PathAndCredentials wcm:action="add" wcm:keyValue="11">
<Path>E:\viofs\w10\amd64</Path>
</PathAndCredentials>
<PathAndCredentials wcm:action="add" wcm:keyValue="12">
<Path>E:\Balloon\w10\amd64</Path>
</PathAndCredentials>
</DriverPaths>
@ -3009,20 +2951,20 @@ function unattended_windows() {
<Description>Install spice-webdavd file sharing agent</Description>
<Order>2</Order>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>msiexec /i F:\UsbDk_1.0.22_x64.msi /quiet /passive /qn</CommandLine>
<Description>Install usbdk USB sharing agent</Description>
<Order>3</Order>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>msiexec /i F:\spice-vdagent-x64-0.10.0.msi /quiet /passive /qn</CommandLine>
<Description>Install spice-vdagent SPICE agent</Description>
<Order>3</Order>
<Order>4</Order>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>Cmd /c POWERCFG -H OFF</CommandLine>
<Description>Disable Hibernation</Description>
<Order>4</Order>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>pnputil /add-driver E:\viogpudo\w10\amd64\viogpudo.inf /install</CommandLine>
<Description>Install viogpudo driver</Description>
<Order>6</Order>
<Order>5</Order>
</SynchronousCommand>
</FirstLogonCommands>
</component>
@ -3034,9 +2976,10 @@ EOF
echo "Downloading Spice drivers..."
web_get https://www.spice-space.org/download/windows/spice-webdavd/spice-webdavd-x64-latest.msi "${VM_PATH}/unattended"
web_get https://www.spice-space.org/download/windows/vdagent/vdagent-win-0.10.0/spice-vdagent-x64-0.10.0.msi "${VM_PATH}/unattended"
web_get https://www.spice-space.org/download/windows/usbdk/UsbDk_1.0.22_x64.msi "${VM_PATH}/unattended"
echo "Making unattended.iso"
mkisofs -quiet -J -o "${VM_PATH}/unattended.iso" "${VM_PATH}/unattended/"
mkisofs -quiet -l -o "${VM_PATH}/unattended.iso" "${VM_PATH}/unattended/"
}
function handle_curl_error() {
@ -3122,7 +3065,7 @@ function download_windows_server() {
local url="https://www.microsoft.com/en-us/evalcenter/download-$windows_version"
echo " - Parsing download page: ${url}"
iso_download_page_html="$(curl --disable --silent --location --max-filesize 1M --fail --proto =https --tlsv1.2 --http1.1 -- "$url")" || {
iso_download_page_html="$(curl --silent --location --max-filesize 1M --fail --proto =https --tlsv1.2 --http1.1 -- "$url")" || {
handle_curl_error $?
return $?
}
@ -3195,7 +3138,7 @@ function download_windows_server() {
# Follow redirect so proceeding log message is useful
# This is a request we make this Fido doesn't
# We don't need to set "--max-filesize" here because this is a HEAD request and the output is to /dev/null anyway
iso_download_link="$(curl --disable --silent --location --output /dev/null --silent --write-out "%{url_effective}" --head --fail --proto =https --tlsv1.2 --http1.1 -- "$iso_download_link")" || {
iso_download_link="$(curl --silent --location --output /dev/null --silent --write-out "%{url_effective}" --head --fail --proto =https --tlsv1.2 --http1.1 -- "$iso_download_link")" || {
# This should only happen if the Microsoft servers are down
handle_curl_error $?
return $?
@ -3244,7 +3187,7 @@ function download_windows_workstation() {
# Also, keeping a "$WindowsVersions" array like Fido does would be way too much of a maintenance burden
# Remove "Accept" header that curl sends by default
echo " - Parsing download page: ${url}"
iso_download_page_html="$(curl --disable --silent --user-agent "$user_agent" --header "Accept:" --max-filesize 1M --fail --proto =https --tlsv1.2 --http1.1 -- "$url")" || {
iso_download_page_html="$(curl --silent --user-agent "$user_agent" --header "Accept:" --max-filesize 1M --fail --proto =https --tlsv1.2 --http1.1 -- "$url")" || {
handle_curl_error $?
return $?
}
@ -3258,7 +3201,7 @@ function download_windows_workstation() {
echo " - Permit Session ID: $session_id"
# Permit Session ID
# "org_id" is always the same value
curl --disable --silent --output /dev/null --user-agent "$user_agent" --header "Accept:" --max-filesize 100K --fail --proto =https --tlsv1.2 --http1.1 -- "https://vlscppe.microsoft.com/tags?org_id=y6jn8c31&session_id=$session_id" || {
curl --silent --output /dev/null --user-agent "$user_agent" --header "Accept:" --max-filesize 100K --fail --proto =https --tlsv1.2 --http1.1 -- "https://vlscppe.microsoft.com/tags?org_id=y6jn8c31&session_id=$session_id" || {
# This should only happen if there's been some change to how this API works
handle_curl_error $?
return $?
@ -3268,19 +3211,19 @@ function download_windows_workstation() {
echo -n " - Getting language SKU ID: "
# Get language -> skuID association table
language_skuid_table_json="$(curl --disable -s --fail --max-filesize 100K --proto =https --tlsv1.2 --http1.1 "https://www.microsoft.com/software-download-connector/api/getskuinformationbyproductedition?profile=${profile}&ProductEditionId=${product_edition_id}&SKU=undefined&friendlyFileName=undefined&Locale=en-US&sessionID=${session_id}")" || {
language_skuid_table_json="$(curl -s --fail --max-filesize 100K --proto =https --tlsv1.2 --http1.1 "https://www.microsoft.com/software-download-connector/api/getskuinformationbyproductedition?profile=${profile}&ProductEditionId=${product_edition_id}&SKU=undefined&friendlyFileName=undefined&Locale=en-US&sessionID=${session_id}")" || {
handle_curl_error $?
return $?
}
sku_id="$(echo "${language_skuid_table_json}" | jq -r '.Skus[] | select(.LocalizedLanguage=="'"${I18N}"'" or .Language=="'"${I18N}"'").Id')"
sku_id="$(echo "${language_skuid_table_json}" | jq -r '.Skus[] | select(.LocalizedLanguage=="'"${I18N}"'").Id')"
echo "$sku_id"
echo " - Getting ISO download link..."
# Get ISO download link
# If any request is going to be blocked by Microsoft it's always this last one (the previous requests always seem to succeed)
# --referer: Required by Microsoft servers to allow request
iso_download_link_json="$(curl --disable -s --fail --referer "$url" "https://www.microsoft.com/software-download-connector/api/GetProductDownloadLinksBySku?profile=${profile}&productEditionId=undefined&SKU=${sku_id}&friendlyFileName=undefined&Locale=en-US&sessionID=${session_id}")"
iso_download_link_json="$(curl -s --fail --referer "$url" "https://www.microsoft.com/software-download-connector/api/GetProductDownloadLinksBySku?profile=${profile}&productEditionId=undefined&SKU=${sku_id}&friendlyFileName=undefined&Locale=en-US&sessionID=${session_id}")"
local failed=0
@ -3643,7 +3586,7 @@ if [ -n "${2}" ]; then
EDITIONS=("$(editions_"${OS}")")
if [ -n "${3}" ]; then
EDITION="${3}"
if [[ ! " ${EDITIONS[*]} " =~ \ "${EDITION}"\ ]]; then
if [[ ! "${EDITIONS[*]}" = *"${EDITION}"* ]]; then
echo -e "ERROR! ${EDITION} is not a supported $(pretty_name "${OS}") edition\n"
echo -n ' - Supported editions: '
for EDITION in "${EDITIONS[@]}"; do
@ -3679,7 +3622,7 @@ if [ -n "${2}" ]; then
"languages_${OS}"
if [ -n "${3}" ]; then
I18N="${3}"
if ! is_valid_language "${I18N}"; then
if [[ ! "${I18NS[*]}" = *"${I18N}"* ]]; then
error_not_supported_lang
fi
VM_PATH="$(echo "${OS}-${RELEASE}-${I18N// /-}" | tr -d '()')"