Configure clock for dualboot systems
This commit is contained in:
parent
e868255996
commit
05201f1108
2 changed files with 21 additions and 0 deletions
|
@ -85,7 +85,25 @@ function Start-InstallationLoop {
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (Get-Stage) {
|
switch (Get-Stage) {
|
||||||
|
([SetupStage]::Configure) {
|
||||||
|
if (Get-Config "valhalla.windows.dualboot.enable") {
|
||||||
|
# Fix synchronization between Linux and Windows clocks.
|
||||||
|
Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" -Name "RealTimeIsUniversal" -Value 1 -Type "DWord";
|
||||||
|
|
||||||
|
# Force time resynchronization
|
||||||
|
$service = Get-Service W32Time;
|
||||||
|
$stopped = ($service.Status -eq "Stopped");
|
||||||
|
Start-Service $service;
|
||||||
|
w32tm /resync /force;
|
||||||
|
|
||||||
|
if ($stopped) {
|
||||||
|
Stop-Service $service;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
([SetupStage]::Install) {
|
([SetupStage]::Install) {
|
||||||
|
Write-Host "Entering install phase";
|
||||||
|
Set-IsFinished $true;
|
||||||
}
|
}
|
||||||
Default {}
|
Default {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ using namespace System.Security.Principal;
|
||||||
|
|
||||||
enum SetupStage {
|
enum SetupStage {
|
||||||
Initialize
|
Initialize
|
||||||
|
Configure
|
||||||
Install
|
Install
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,6 +172,8 @@ $null = New-Module {
|
||||||
param(
|
param(
|
||||||
$Value
|
$Value
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Set-SetupOption $finishedOption $true;
|
||||||
}
|
}
|
||||||
|
|
||||||
<#
|
<#
|
||||||
|
|
Loading…
Reference in a new issue