mirror of
https://github.com/dockur/windows.git
synced 2025-10-27 19:35:49 +00:00
fix: Store bootmode in file
This commit is contained in:
parent
d9f5e62513
commit
3467b5d55f
1 changed files with 15 additions and 3 deletions
|
|
@ -266,6 +266,7 @@ finishInstall() {
|
|||
# Mark ISO as prepared via magic byte
|
||||
if ! printf '\x16' | dd of="$iso" bs=1 seek=0 count=1 conv=notrunc status=none; then
|
||||
error "Failed to set magic byte!"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
@ -280,7 +281,10 @@ finishInstall() {
|
|||
|
||||
# Enable secure boot + TPM on manual installs as Win11 requires
|
||||
if [[ "$MANUAL" == [Yy1]* ]] || [[ "$aborted" == [Yy1]* ]]; then
|
||||
[[ "${DETECTED,,}" == "win11"* ]] && BOOT_MODE="windows_secure"
|
||||
if [[ "${DETECTED,,}" == "win11"* ]]; then
|
||||
BOOT_MODE="windows_secure"
|
||||
echo "$BOOT_MODE" > "$STORAGE/windows.mode"
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -rf "$TMP"
|
||||
|
|
@ -292,7 +296,10 @@ abortInstall() {
|
|||
local iso="$1"
|
||||
|
||||
if [[ "$iso" != "$STORAGE/$BASE" ]]; then
|
||||
mv -f "$iso" "$STORAGE/$BASE"
|
||||
if ! mv -f "$iso" "$STORAGE/$BASE"; then
|
||||
error "Failed to move ISO: $iso"
|
||||
exit 69
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! finishInstall "$STORAGE/$BASE" "Y"; then
|
||||
|
|
@ -1115,6 +1122,8 @@ bootWindows() {
|
|||
MACHINE=$(<"$STORAGE/windows.old")
|
||||
[ -z "$MACHINE" ] && MACHINE="q35"
|
||||
BOOT_MODE="windows_legacy"
|
||||
rm -rf "$TMP"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local creation="1.10"
|
||||
|
|
@ -1136,10 +1145,13 @@ bootWindows() {
|
|||
mv "$STORAGE/windows.vars" "$STORAGE/$BOOT_MODE.vars"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if [ -s "$STORAGE/windows.mode" ] && [ -f "$STORAGE/windows.mode" ]; then
|
||||
BOOT_MODE=$(<"$STORAGE/windows.mode")
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -rf "$TMP"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue