From 7e4a6ff458214082b692144d9f49e71f96526574 Mon Sep 17 00:00:00 2001 From: Kroese Date: Sat, 27 Apr 2024 14:58:34 +0200 Subject: [PATCH] fix: Bootmode migration --- src/install.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/install.sh b/src/install.sh index e79641f..417e4ef 100644 --- a/src/install.sh +++ b/src/install.sh @@ -283,7 +283,9 @@ finishInstall() { cp /run/version "$STORAGE/windows.ver" if [[ "${BOOT_MODE,,}" == "windows_legacy" ]]; then - echo "$MACHINE" > "$STORAGE/windows.old" + if [[ "${MACHINE,,}" != "q35" ]]; then + echo "$MACHINE" > "$STORAGE/windows.old" + fi echo "$BOOT_MODE" > "$STORAGE/windows.mode" else # Enable secure boot + TPM on manual installs as Win11 requires @@ -1156,14 +1158,15 @@ bootWindows() { if [ -s "$STORAGE/windows.mode" ] && [ -f "$STORAGE/windows.mode" ]; then BOOT_MODE=$(<"$STORAGE/windows.mode") - if [ -f "$STORAGE/windows.old" ]; then + if [ -s "$STORAGE/windows.old" ] && [ -f "$STORAGE/windows.old" ]; then MACHINE=$(<"$STORAGE/windows.old") - [ -z "$MACHINE" ] && MACHINE="q35" fi rm -rf "$TMP" return 0 fi + # Migrations + if [ -f "$STORAGE/windows.old" ]; then MACHINE=$(<"$STORAGE/windows.old") [ -z "$MACHINE" ] && MACHINE="q35"