Only set secureboot=on for Windows 11 on non-Debian/Ubuntu

This commit is contained in:
Martin Wimpress 2021-10-25 16:13:53 +01:00
parent 5c0a7885c9
commit a5f27dc68d
No known key found for this signature in database
GPG key ID: 61DF940515E06DA3

View file

@ -526,6 +526,8 @@ function make_vm_config() {
local ISO_FILE=""
local IMAGE_TYPE=""
local GUEST=""
local SEC_BOOT=""
IMAGE_FILE="${1}"
ISO_FILE="${2}"
if [ "${OS}" == "elementary" ]; then
@ -588,6 +590,13 @@ EOF
# Enable TPM for Windows 11
if [ "${OS}" == "windows" ] && [ "${RELEASE}" -ge 11 ]; then
echo "tpm=\"on\"" >> "${OS}-${RELEASE}.conf"
# Only force SecureBoot on for non-Debian/Ubuntu distros.
if [ -e "/usr/share/OVMF/OVMF_CODE_4M.fd" ] && [ -e "/usr/share/OVMF/OVMF_VARS_4M.fd" ]; then
SEC_BOOT="off"
else
SEC_BOOT="on"
fi
echo "secureboot=\"${SEC_BOOT}\"" >> "${OS}-${RELEASE}.conf"
fi
fi
start_vm_info