From c704f6bb4e884c5c5670f08dd3f5daedd18d5772 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 28 Mar 2014 16:52:08 +0100 Subject: [PATCH] VM tests: Run hwclock in the initrd Needed for the installer tests, since otherwise mounting a filesystem may fail as it has a last-mounted date in the future. http://hydra.nixos.org/build/9846712 --- nixos/modules/virtualisation/qemu-vm.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index a866b513f0f..80bc71bbb8c 100644 --- a/nixos/modules/virtualisation/qemu-vm.nix +++ b/nixos/modules/virtualisation/qemu-vm.nix @@ -291,6 +291,11 @@ in if test -z "$FSTYPE"; then mke2fs -t ext4 /dev/vda fi + + # Set the system time from the hardware clock to work around a + # bug in qemu-kvm > 1.5.2 (where the VM clock is initialised + # to the *boot time* of the host). + hwclock -s ''; boot.initrd.postMountCommands =