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
echo ", ${RAM_VM} RAM"
if [ "${RAM_VM//G/}" -lt 4 ]; 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"
exit 1
fi
@ -488,9 +488,6 @@ function vm_boot() {
fi
MACHINE_TYPE="pc"
NET_DEVICE="rtl8139"
if [ -z "${disk_size}" ]; then
disk_size="256M"
fi
;;
macos)
#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}")
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
# shellcheck disable=SC2054
args+=(-drive media=cdrom,index=0,file="${iso}")
@ -944,8 +934,13 @@ function vm_boot() {
args+=(-drive media=cdrom,index=1,file="${fixed_iso}")
fi
if [ -n "${iso}" ] && [ "${guest_os}" == "kolibrios" ]; 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
if [ -n "${iso}" ] && [ "${guest_os}" == "windows" ] && [ -e "${VMDIR}/unattended.iso" ]; then
# shellcheck disable=SC2054
args+=(-drive media=cdrom,index=2,file="${VMDIR}/unattended.iso")
fi

View File

@ -514,10 +514,10 @@ function releases_tails() {
}
function releases_ubuntu() {
echo bionic \
focal \
hirsute \
impish \
echo 18.04 \
20.04 \
21.04 \
21.10 \
devel \
canary
}
@ -1453,7 +1453,7 @@ function get_tails() {
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/")
ISO="${URL##*/}"
web_get "${URL}" "${VM_PATH}"
check_hash "${ISO}" "${HASH}"
make_vm_config "${ISO}"
@ -1850,6 +1850,7 @@ function get_windows() {
local ARCH="x64"
local INDEX=0
local LANG_CODE="en"
local LANG_EDITION=""
local LATEST_WINDOWS_VERSION=""
local WINDOWS_NAME=""
local VERSION_ID=""
@ -1861,19 +1862,18 @@ function get_windows() {
local DOWNLOAD_ID=""
local DOWNLOAD_URL=""
# Ignore the most recent Windows 10 release for now.
if [ "${RELEASE}" -eq 10 ]; then
INDEX=0
fi
LANG_EDITION="${1}"
if [ "${RELEASE}" -eq 11 ]; then
INDEX=0
fi
# Ignore the most recent Windows 10 release for now.
case ${RELEASE} in
10) INDEX=0;;
11) INDEX=0;;
esac
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))')
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}"
WINDOWS_NAME=$(echo "${LATEST_WINDOWS_VERSION}" | jq -r .name)
@ -1883,11 +1883,11 @@ function get_windows() {
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');;
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
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}"
ARCH_INFO=$(wget -q -O- "https://tb.rg-adguard.net/php/get_arch.php?language_id=${LANGUAGE_ID}")
dbg_windows "${ARCH_INFO}"
@ -2005,7 +2005,7 @@ if [ -n "${2}" ]; then
elif [ "${OS}" == "windows" ]; then
LANG="English International"
if [ -n "${3}" ]; then
EDITION="${3}"
LANG="${3}"
if [[ ! ${LANGS[*]} =~ "${LANG}" ]]; then
echo -e "ERROR! ${LANG} is not a supported Windows language:\n"
for LANG in "${LANGS[@]}"; do