Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Time synchronization on Windows #492

Merged
merged 1 commit into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions src/boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ BOOT_DESC=""
BOOT_OPTS=""
SECURE=",smm=off"

if [[ "${BOOT_MODE,,}" == "windows"* ]]; then

BOOT_OPTS="-rtc base=localtime"
BOOT_OPTS="$BOOT_OPTS -global ICH9-LPC.disable_s3=1"
BOOT_OPTS="$BOOT_OPTS -global ICH9-LPC.disable_s4=1"

if [ -e /sys/module/kvm/parameters/ignore_msrs ]; then
if [ "$(cat /sys/module/kvm/parameters/ignore_msrs)" == "N" ]; then
echo 1 | tee /sys/module/kvm/parameters/ignore_msrs > /dev/null 2>&1 || true
fi
fi

fi

case "${BOOT_MODE,,}" in
uefi)
BOOT_DESC=" with UEFI"
Expand All @@ -24,20 +38,17 @@ case "${BOOT_MODE,,}" in
windows | windows_plain)
ROM="OVMF_CODE_4M.fd"
VARS="OVMF_VARS_4M.fd"
BOOT_OPTS="-global ICH9-LPC.disable_s3=1 -global ICH9-LPC.disable_s4=1"
;;
windows_secure)
TPM="Y"
SECURE=",smm=on"
BOOT_DESC=" securely"
ROM="OVMF_CODE_4M.ms.fd"
VARS="OVMF_VARS_4M.ms.fd"
BOOT_OPTS="-global ICH9-LPC.disable_s3=1 -global ICH9-LPC.disable_s4=1"
;;
windows_legacy)
BOOT_DESC=" (legacy)"
USB="usb-ehci,id=ehci"
BOOT_OPTS="-global ICH9-LPC.disable_s3=1 -global ICH9-LPC.disable_s4=1"
;;
legacy)
BOOT_OPTS=""
Expand Down Expand Up @@ -104,12 +115,4 @@ if [[ "$TPM" == [Yy1]* ]]; then

fi

if [[ "${BOOT_MODE,,}" == "windows"* ]]; then
if [ -e /sys/module/kvm/parameters/ignore_msrs ]; then
if [ "$(cat /sys/module/kvm/parameters/ignore_msrs)" == "N" ]; then
echo 1 | tee /sys/module/kvm/parameters/ignore_msrs > /dev/null 2>&1 || true
fi
fi
fi

return 0
Loading