Merge branch 'quickemu-project:master' into submod-docbuild

This commit is contained in:
Phil Clifford 2022-02-22 17:01:37 +00:00 committed by GitHub
commit 9f7e164d56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 36 deletions

View File

@ -328,8 +328,8 @@ function vm_boot() {
fi fi
echo ", ${RAM_VM} RAM" echo ", ${RAM_VM} RAM"
if [ "${RAM_VM//G/}" -lt 4 ]; then if [ "${guest_os}" == "macos" ] || [ "${guest_os}" == "windows" ]; then
if [ "${guest_os}" == "macos" ] || [ "${guest_os}" == "windows" ]; then if [ "${RAM_VM//G/}" -lt 4 ]; then
echo "ERROR! You have insufficient RAM to run ${guest_os} in a VM" echo "ERROR! You have insufficient RAM to run ${guest_os} in a VM"
exit 1 exit 1
fi fi
@ -488,9 +488,6 @@ function vm_boot() {
fi fi
MACHINE_TYPE="pc" MACHINE_TYPE="pc"
NET_DEVICE="rtl8139" NET_DEVICE="rtl8139"
if [ -z "${disk_size}" ]; then
disk_size="256M"
fi
;; ;;
macos) macos)
#https://www.nicksherlock.com/2020/06/installing-macos-big-sur-on-proxmox/ #https://www.nicksherlock.com/2020/06/installing-macos-big-sur-on-proxmox/
@ -927,13 +924,6 @@ function vm_boot() {
args+=(-drive if=floppy,format=raw,file="${floppy}") args+=(-drive if=floppy,format=raw,file="${floppy}")
fi fi
# Since there is bug (probably) in KolibriOS: cdrom indexes 0 or 1 make system show an extra unexisting iso, so we use index=2
if [ -n "${iso}" ] && [ "${guest_os}" == "kolibrios" ]; then
# shellcheck disable=SC2054
args+=(-drive media=cdrom,index=2,file="${iso}")
iso=""
fi
if [ -n "${iso}" ]; then if [ -n "${iso}" ]; then
# shellcheck disable=SC2054 # shellcheck disable=SC2054
args+=(-drive media=cdrom,index=0,file="${iso}") args+=(-drive media=cdrom,index=0,file="${iso}")
@ -944,8 +934,13 @@ function vm_boot() {
args+=(-drive media=cdrom,index=1,file="${fixed_iso}") args+=(-drive media=cdrom,index=1,file="${fixed_iso}")
fi fi
# Attach the unattended configuration to Windows guests when booting from ISO if [ -n "${iso}" ] && [ "${guest_os}" == "kolibrios" ]; then
if [ -n "${iso}" ] && [ "${guest_os}" == "windows" ] && [ -e "${VMDIR}/unattended.iso" ]; then # Since there is bug (probably) in KolibriOS: cdrom indexes 0 or 1 make system show an extra unexisting iso, so we use index=2
# shellcheck disable=SC2054
args+=(-drive media=cdrom,index=2,file="${iso}")
iso=""
elif [ -n "${iso}" ] && [ "${guest_os}" == "windows" ] && [ -e "${VMDIR}/unattended.iso" ]; then
# Attach the unattended configuration to Windows guests when booting from ISO
# shellcheck disable=SC2054 # shellcheck disable=SC2054
args+=(-drive media=cdrom,index=2,file="${VMDIR}/unattended.iso") args+=(-drive media=cdrom,index=2,file="${VMDIR}/unattended.iso")
fi fi

View File

@ -514,10 +514,10 @@ function releases_tails() {
} }
function releases_ubuntu() { function releases_ubuntu() {
echo bionic \ echo 18.04 \
focal \ 20.04 \
hirsute \ 21.04 \
impish \ 21.10 \
devel \ devel \
canary canary
} }
@ -1453,7 +1453,7 @@ function get_tails() {
RELEASE_JSON="$(wget -q -O- "${RELEASE_JSON_URL}")" 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') 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') HASH=$(echo "${RELEASE_JSON}" | jq -r '.installations[0]."installation-paths"[]|select(.type=="iso")|."target-files"[0].sha256')
ISO=$(echo "${URL}" | sed -e "s/.*\/\([^\/]*\)$/\1/") ISO="${URL##*/}"
web_get "${URL}" "${VM_PATH}" web_get "${URL}" "${VM_PATH}"
check_hash "${ISO}" "${HASH}" check_hash "${ISO}" "${HASH}"
make_vm_config "${ISO}" make_vm_config "${ISO}"
@ -1850,6 +1850,7 @@ function get_windows() {
local ARCH="x64" local ARCH="x64"
local INDEX=0 local INDEX=0
local LANG_CODE="en" local LANG_CODE="en"
local LANG_EDITION=""
local LATEST_WINDOWS_VERSION="" local LATEST_WINDOWS_VERSION=""
local WINDOWS_NAME="" local WINDOWS_NAME=""
local VERSION_ID="" local VERSION_ID=""
@ -1861,19 +1862,18 @@ function get_windows() {
local DOWNLOAD_ID="" local DOWNLOAD_ID=""
local DOWNLOAD_URL="" local DOWNLOAD_URL=""
# Ignore the most recent Windows 10 release for now. LANG_EDITION="${1}"
if [ "${RELEASE}" -eq 10 ]; then
INDEX=0
fi
if [ "${RELEASE}" -eq 11 ]; then # Ignore the most recent Windows 10 release for now.
INDEX=0 case ${RELEASE} in
fi 10) INDEX=0;;
11) INDEX=0;;
esac
echo "Getting Windows ${RELEASE} URL..." echo "Getting Windows ${RELEASE} URL..."
WINDOWS_VERSIONS=$(wget -q -O- "https://tb.rg-adguard.net/php/get_version.php?type_id=1" | jq '.versions | sort_by(-(.version_id | tonumber))') WINDOWS_VERSIONS=$(wget -q -O- "https://tb.rg-adguard.net/php/get_version.php?type_id=1" | jq '.versions | sort_by(-(.version_id | tonumber))')
dbg_windows "${WINDOWS_VERSIONS}" dbg_windows "${WINDOWS_VERSIONS}"
LATEST_WINDOWS_VERSION=$(echo "${WINDOWS_VERSIONS}" | jq -c 'map(select(.name | contains("Windows '${RELEASE}'")))['${INDEX}']') LATEST_WINDOWS_VERSION=$(echo "${WINDOWS_VERSIONS}" | jq -c 'map(select(.name | contains("Windows '"${RELEASE}"'")))['${INDEX}']')
dbg_windows "${LATEST_WINDOWS_VERSION}" dbg_windows "${LATEST_WINDOWS_VERSION}"
WINDOWS_NAME=$(echo "${LATEST_WINDOWS_VERSION}" | jq -r .name) WINDOWS_NAME=$(echo "${LATEST_WINDOWS_VERSION}" | jq -r .name)
@ -1883,11 +1883,11 @@ function get_windows() {
case ${RELEASE} in case ${RELEASE} in
8) EDITION_ID=$(wget -q -O- "https://tb.rg-adguard.net/php/get_edition.php?version_id=${VERSION_ID}&lang=name_${LANG_CODE}" | jq -r '.editions[] | select(.name_'${LANG_CODE}'=="Windows 8.1 Pro + Core").edition_id');; 8) EDITION_ID=$(wget -q -O- "https://tb.rg-adguard.net/php/get_edition.php?version_id=${VERSION_ID}&lang=name_${LANG_CODE}" | jq -r '.editions[] | select(.name_'${LANG_CODE}'=="Windows 8.1 Pro + Core").edition_id');;
10|11) EDITION_ID=$(wget -q -O- "https://tb.rg-adguard.net/php/get_edition.php?version_id=${VERSION_ID}&lang=name_${LANG_CODE}" | jq -r '.editions[] | select(.name_'${LANG_CODE}'=="Windows '${RELEASE}'").edition_id');; 10|11) EDITION_ID=$(wget -q -O- "https://tb.rg-adguard.net/php/get_edition.php?version_id=${VERSION_ID}&lang=name_${LANG_CODE}" | jq -r '.editions[] | select(.name_'${LANG_CODE}'=="Windows '"${RELEASE}"'").edition_id');;
esac esac
dbg_windows "${EDITION_ID}" dbg_windows "${EDITION_ID}"
LANGUAGE_ID=$(wget -q -O- "https://tb.rg-adguard.net/php/get_language.php?edition_id=${EDITION_ID}&lang=name_${LANG_CODE}" | jq -r '.languages[] | select(.name_'${LANG_CODE}'=="'"${LANG_NAME}"'").language_id') LANGUAGE_ID=$(wget -q -O- "https://tb.rg-adguard.net/php/get_language.php?edition_id=${EDITION_ID}&lang=name_${LANG_CODE}" | jq -r '.languages[] | select(.name_'${LANG_CODE}'=="'"${LANG_EDITION}"'").language_id')
dbg_windows "${LANGUAGE_ID}" dbg_windows "${LANGUAGE_ID}"
ARCH_INFO=$(wget -q -O- "https://tb.rg-adguard.net/php/get_arch.php?language_id=${LANGUAGE_ID}") ARCH_INFO=$(wget -q -O- "https://tb.rg-adguard.net/php/get_arch.php?language_id=${LANGUAGE_ID}")
dbg_windows "${ARCH_INFO}" dbg_windows "${ARCH_INFO}"
@ -1947,9 +1947,9 @@ if [ -n "${1}" ]; then
elif [ "${OS}" == "list_json" ]; then elif [ "${OS}" == "list_json" ]; then
list_json list_json
elif [ "${OS}" == "--version" ] || [ "${OS}" == "-version" ] || [ "${OS}" == "version" ]; then elif [ "${OS}" == "--version" ] || [ "${OS}" == "-version" ] || [ "${OS}" == "version" ]; then
WHERE=$(dirname "${BASH_SOURCE[0]}") WHERE=$(dirname "${BASH_SOURCE[0]}")
"${WHERE}/quickemu" --version "${WHERE}/quickemu" --version
exit 0 exit 0
fi fi
else else
echo "ERROR! You must specify an operating system." echo "ERROR! You must specify an operating system."
@ -1959,9 +1959,9 @@ else
fi fi
if [[ ! $(os_support) =~ ${OS} ]]; then if [[ ! $(os_support) =~ ${OS} ]]; then
echo -e "ERROR! ${OS} is not a supported OS.\n" echo -e "ERROR! ${OS} is not a supported OS.\n"
os_support os_support
exit 1 exit 1
fi fi
if [ -n "${2}" ]; then if [ -n "${2}" ]; then
@ -2005,7 +2005,7 @@ if [ -n "${2}" ]; then
elif [ "${OS}" == "windows" ]; then elif [ "${OS}" == "windows" ]; then
LANG="English International" LANG="English International"
if [ -n "${3}" ]; then if [ -n "${3}" ]; then
EDITION="${3}" LANG="${3}"
if [[ ! ${LANGS[*]} =~ "${LANG}" ]]; then if [[ ! ${LANGS[*]} =~ "${LANG}" ]]; then
echo -e "ERROR! ${LANG} is not a supported Windows language:\n" echo -e "ERROR! ${LANG} is not a supported Windows language:\n"
for LANG in "${LANGS[@]}"; do for LANG in "${LANGS[@]}"; do