mirror of
https://github.com/dockur/windows.git
synced 2025-10-27 19:35:49 +00:00
fix: Fall back to secure boot on older installations
This commit is contained in:
parent
e8a7b2c708
commit
ad5b06da59
1 changed files with 28 additions and 4 deletions
|
|
@ -250,8 +250,9 @@ finishInstall() {
|
|||
rm -f "$STORAGE/windows.old"
|
||||
fi
|
||||
|
||||
# Fall back to secure boot when ISO has not been modified
|
||||
if [[ "$MANUAL" == [Yy1]* ]] || [[ "$aborted" == [Yy1]* ]]; then
|
||||
[[ "${DETECTED,,}" == "win11"* ]] && TPM="Y"
|
||||
[[ "${DETECTED,,}" == "win11"* ]] && BOOT_MODE="windows_secure"
|
||||
fi
|
||||
|
||||
rm -rf "$TMP"
|
||||
|
|
@ -1084,9 +1085,7 @@ buildImage() {
|
|||
return 0
|
||||
}
|
||||
|
||||
######################################
|
||||
|
||||
if ! startInstall; then
|
||||
bootWindows() {
|
||||
|
||||
if [ -f "$STORAGE/windows.old" ]; then
|
||||
MACHINE=$(<"$STORAGE/windows.old")
|
||||
|
|
@ -1094,7 +1093,32 @@ if ! startInstall; then
|
|||
BOOT_MODE="windows_legacy"
|
||||
fi
|
||||
|
||||
local creation="1.10"
|
||||
local minimal="2.14"
|
||||
|
||||
if [ -s "$STORAGE/windows.ver" ]; then
|
||||
creation=$(<"$STORAGE/windows.ver")
|
||||
fi
|
||||
|
||||
# Fall back to secure boot on installations created prior to v2.14
|
||||
if (( $(echo "$creation < $minimal" | bc -l) )); then
|
||||
if [[ "${BOOT_MODE,,}" == "windows" ]] || [[ "${BOOT_MODE,,}" == "windows_plain" ]]; then
|
||||
BOOT_MODE="windows_secure"
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -rf "$TMP"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
######################################
|
||||
|
||||
if ! startInstall; then
|
||||
if ! bootWindows; then
|
||||
error "Failed to boot Windows!"
|
||||
exit 68
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue