Commit 9439eee2 authored by Nikos Skalkotos's avatar Nikos Skalkotos

windows: Disable hibernation when booting

This used to be a sysprep but it is better if we disable it right away.
This is not needed for VMs and if this is enabled, the system will
hibernate on an ACPI shutdown event which will make the system
preparation to fail.
parent 709f45f8
......@@ -315,12 +315,6 @@ class Windows(OSBase):
self.vm.rexec('netsh firewall set icmpsetting 8')
@sysprep('Disabling hibernation support')
def disable_hibernation(self):
"""Disable hibernation support and remove the hibernation file"""
self.vm.rexec(r'powercfg.exe /hibernate off')
@sysprep('Setting the system clock to UTC')
def utc(self):
"""Set the hardware clock to UTC"""
......@@ -590,6 +584,8 @@ class Windows(OSBase):
commands = {}
# Disable hibernation. This is not needed for a VM
commands['hibernate'] = r'powercfg.exe /hibernate off'
# This script will send a random string to the first serial port. This
# can be used to determine when the OS has booted.
commands['BootMonitor'] = "cmd /q /a /c echo " + TOKEN + " > COM1"
......
......@@ -50,6 +50,9 @@ function Cat2Cert
[System.IO.File]::WriteAllBytes($certFile, $cert.Export("Cert"))
return $certFile
}
# This is not needed on VMs
powercfg.exe /hibernate off
"""
ADD_CERTIFICATE = r"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment