Merge upstream into generated-readme

This commit is contained in:
Phil 2022-02-19 14:55:05 +00:00
commit 59746b3a09
2 changed files with 58 additions and 42 deletions

View File

@ -399,9 +399,6 @@ function vm_boot() {
elif [ -e "/usr/share/qemu/ovmf-x86_64-smm-ms-code.bin" ]; then
EFI_CODE="/usr/share/qemu/ovmf-x86_64-smm-ms-code.bin"
efi_vars "/usr/share/qemu/ovmf-x86_64-smm-ms-vars.bin" "${EFI_VARS}"
elif [ -e "/usr/share/edk2-ovmf/OVMF_CODE.secboot.fd" ]; then
EFI_CODE="/usr/share/edk2-ovmf/OVMF_CODE.secboot.fd"
efi_vars "/usr/share/edk2-ovmf/OVMF_VARS.fd" "${EFI_VARS}"
elif [ -e "/usr/share/qemu/edk2-x86_64-secure-code.fd" ]; then
EFI_CODE="/usr/share/qemu/edk2-x86_64-secure-code.fd"
efi_vars "/usr/share/qemu/edk2-x86_64-code.fd" "${EFI_VARS}"
@ -425,8 +422,8 @@ function vm_boot() {
EFI_CODE="/usr/share/OVMF/x64/OVMF_CODE.fd"
efi_vars "/usr/share/OVMF/x64/OVMF_VARS.fd" "${EFI_VARS}"
elif [ -e "/usr/share/edk2-ovmf/OVMF_CODE.fd" ]; then
EFI_CODE="/usr/share/edk2-ovmf/OVMF_CODE.fd"
efi_vars "/usr/share/edk2-ovmf/OVMF_VARS.fd" "${EFI_VARS}"
EFI_CODE="/usr/share/edk2-ovmf/OVMF_CODE.fd"
efi_vars "/usr/share/edk2-ovmf/OVMF_VARS.fd" "${EFI_VARS}"
elif [ -e "/usr/share/qemu/ovmf-x86_64-4m-code.bin" ]; then
EFI_CODE="/usr/share/qemu/ovmf-x86_64-4m-code.bin"
efi_vars "/usr/share/qemu/ovmf-x86_64-4m-vars.bin" "${EFI_VARS}"

View File

@ -537,23 +537,34 @@ function check_hash() {
}
function copy_local(){
if [ -n "${ISODIR}" ]; then
# use supplied filename or default to original distro ISO name
if [ -z ${LOCALISO} ]; then
LOCALISO=${FILE}
fi
LOCALFILE=$(find ${ISODIR} -type f -name "${LOCALISO}" -print -quit )
#echo got local file "${LOCALFILE}"
if [ -f "${DIR}/${FILE}" ]; then
echo "ERROR! File Exists - not copying over local file"
echo "Move it out of the way to replace it with a local file"
exit 1
else
cp -pv "${LOCALFILE}" ${DIR}/${FILE}
# if ! ; then echo ERROR! Failed to copy ${LOCALFILE}" to ${DIR}/${FILE}"
fi
#exit 0 # while testing
fi
case $OS in
windows)
echo "${OS} not (yet?) supported for local isos" ;;
macos)
# echo "${OS} not (yet?) supported for local isos" ;;
if [ -n "${ISODIR}" ]; then
for macfile in RecoveryImage.dmg RecoveryImage.chunklist
do
find "${ISODIR}" -type f -name "${macfile}" -exec cp -pv \{\} "$DIR"/ \;
done
fi;;
*)
if [ -n "${ISODIR}" ]; then
# use supplied filename or default to original distro ISO name
if [ -z "${LOCALISO}" ]; then
LOCALISO=${FILE}
fi
LOCALFILE=$(find "${ISODIR}" -type f -name "${LOCALISO}" -print -quit )
if [ -f "${DIR}/${FILE}" ]; then
echo "ERROR! File Exists - not copying over local file"
echo "Move it out of the way to replace it with a local file"
exit 1
else
cp -pv "${LOCALFILE}" "${DIR}"/"${FILE}"
# if ! ; then echo ERROR! Failed to copy ${LOCALFILE}" to ${DIR}/${FILE}"
fi
fi
esac
}
function web_get() {
@ -572,7 +583,14 @@ function web_get() {
echo "ERROR! Unable to create directory ${DIR}"
exit 1
fi
if [ -n "${LOCALISO}" ] || [ -n "${ISODIR}" ] ; then
copy_local
# you only get one shot
LOCALISO=""
ISODIR=""
fi
if command -v aria2c > /dev/null; then
if ! aria2c -x16 --continue=true --summary-interval=0 --download-result=hide --console-log-level=error "${URL}" -o "${DIR}/${FILE}"; then
@ -613,7 +631,12 @@ function zsync_get() {
exit 1
fi
if [ -n "${LOCALISO}" ] || [ -n "${ISODIR}" ] ; then
copy_local
# you only get one shot
LOCALISO=""
ISODIR=""
fi
if ! zsync "${URL}.zsync" -i "${DIR}/${OUT}" -o "${DIR}/${OUT}" 2>/dev/null; then
echo "ERROR! Failed to download ${URL}.zsync"
@ -634,6 +657,7 @@ function start_vm_info() {
echo "To start your ${OS} ${RELEASE} virtual machine run:"
echo " quickemu --vm ${OS}-${RELEASE}.conf"
echo
exit 0
}
function make_vm_config() {
@ -646,11 +670,6 @@ function make_vm_config() {
IMAGE_FILE="${1}"
ISO_FILE="${2}"
case "${OS}" in
alma | android | archlinux | debian | elementary | fedora | kali | \
garuda | kdeneon | linuxmint* | nixos* | opensuse | oraclelinux | \
popos | regolith | rockylinux | solus | *ubuntu* | zorin )
GUEST="linux"
IMAGE_TYPE="iso";;
freebsd )
GUEST="freebsd"
IMAGE_TYPE="iso";;
@ -670,7 +689,6 @@ function make_vm_config() {
GUEST="windows"
IMAGE_TYPE="iso";;
*)
echo "Undefined OS Defaulting to Guest=Linux and IMAGE_TYPE=iso"
GUEST="linux"
IMAGE_TYPE="iso";;
esac
@ -690,7 +708,7 @@ EOF
echo "fixed_iso=\"${VM_PATH}/${ISO_FILE}\"" >> "${OS}-${RELEASE}.conf"
fi
if [ "${OS}" == "alma" ] && [ ${ISOTYPE} == "dvd" ]; then
if [ "${OS}" == "alma" ] && [ "${ISOTYPE}" == "dvd" ]; then
echo "disk_size=\"32G\"" >> "${OS}-${RELEASE}.conf"
fi
@ -1155,8 +1173,8 @@ function get_void() {
local HASH_URL=""
validate_release "releases_void"
DATE=$(wget -q -O- "https://mirror.fit.cvut.cz/voidlinux/live/current/sha256sum.txt" | awk 'NR == 1' |cut -d'.' -f1| cut -d'-' -f4)
URL="http://mirror.fit.cvut.cz/voidlinux/live/current"
DATE=$(wget -q -O- "https://alpha.de.repo.voidlinux.org/live/current/sha256sum.txt" | awk 'NR == 1' |cut -d'.' -f1| cut -d'-' -f4)
URL="https://alpha.de.repo.voidlinux.org/live/current"
case ${RELEASE} in
base)
ISO="void-live-x86_64-${DATE}.iso";;
@ -1169,13 +1187,13 @@ function get_void() {
esac
case ${RELEASE} in
base)
HASH="$(wget -q -O- "https://mirror.fit.cvut.cz/voidlinux/live/current/sha256sum.txt" | grep "void-live-x86_64-${DATE}.iso" | cut -d' ' -f4)";;
HASH="$(wget -q -O- "https://alpha.de.repo.voidlinux.org/live/current/sha256sum.txt" | grep "void-live-x86_64-${DATE}.iso" | cut -d' ' -f4)";;
musl)
HASH="$(wget -q -O- "https://mirror.fit.cvut.cz/voidlinux/live/current/sha256sum.txt" | grep "void-live-x86_64-musl-${DATE}.iso" | cut -d' ' -f4)";;
HASH="$(wget -q -O- "https://alpha.de.repo.voidlinux.org/live/current/sha256sum.txt" | grep "void-live-x86_64-musl-${DATE}.iso" | cut -d' ' -f4)";;
xfce)
HASH="$(wget -q -O- "https://mirror.fit.cvut.cz/voidlinux/live/current/sha256sum.txt" | grep "void-live-x86_64-${DATE}-xfce.iso" | cut -d' ' -f4)";;
HASH="$(wget -q -O- "https://alpha.de.repo.voidlinux.org/live/current/sha256sum.txt" | grep "void-live-x86_64-${DATE}-xfce.iso" | cut -d' ' -f4)";;
xfce-musl)
HASH="$(wget -q -O- "https://mirror.fit.cvut.cz/voidlinux/live/current/sha256sum.txt" | grep "void-live-x86_64-musl-${DATE}.iso" | cut -d' ' -f4)";;
HASH="$(wget -q -O- "https://alpha.de.repo.voidlinux.org/live/current/sha256sum.txt" | grep "void-live-x86_64-musl-${DATE}.iso" | cut -d' ' -f4)";;
esac
web_get "${URL}/${ISO}" "${VM_PATH}"
check_hash "${ISO}" "${HASH}"
@ -1947,10 +1965,10 @@ languages_windows
# handle parameters
# Take command line arguments
#if [ $# -lt 1 ]; then
# usage
# exit 0
#else
if [ $# -lt 1 ]; then
usage
exit 0
fi
while [ $# -gt 0 ]; do
case "${1}" in
-isodir|--isodir)
@ -1973,10 +1991,11 @@ languages_windows
quickemu_version=$( "${whereIam}"/quickemu --version)
echo "Quickemu Version: ${quickemu_version}"
exit 0;;
test*)
-t|--t|-test|--test)
echo "you are just testing
ISODIR: ${ISODIR}
LOCALISO: ${LOCALISO}"
ls -lh "${ISODIR}/${LOCALISO}"
exit 0;;
*)
@ -2113,7 +2132,7 @@ if [ -n "${2}" ]; then
elif [ "${OS}" == "windows" ]; then
if [ -n "${3}" ]; then
LANG_NAME="${3}"
if [[ ! ${LANGS[*]} =~ ${LANG_NAME} ]]; then
if [[ ! ${LANGS[*]} =~ "${LANG_NAME}" ]]; then
echo "ERROR! ${LANG_NAME} is not a supported language:"
for LANG in "${LANGS[@]}"; do
echo "${LANG}"
@ -2210,4 +2229,4 @@ fi
echo "Error: You must supply an OS!"
os_support
exit 1
fi
fi