From 6f3d8a72ea281354a4eb806e9f370bedb78877c2 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Tue, 26 Nov 2024 15:51:11 +0100 Subject: [PATCH] runInLinuxVM: remove `hwclock -s` invocation Commit 97ed6b4565e76286062e6942517a71ae4c9cac72 broke the systemd-boot tests (among others) because of the `hwclock -s` invocation. This was broken for a while, but not noticed because we didn't have a `set -e` before. The error hwclock: select() to /dev/rtc0 to wait for clock tick timed out MAY be related to an open QEMU bug[1]: I can't reproduce the error on aarch64-linux and x86_64-linux with `partitionTableType = "legacy";`. Also, the issue disappears on x86_64-linux when adding `--directisa`. However, the invocation was added in f73ff0529ef079cb9b53b25201766d670287b28f 10 years ago which didn't give any reasoning or pointer to what KVM bug this may be. Given that this must have happened on an ancient version, we agreed on removing it altogether[2]. [1] https://gitlab.com/qemu-project/qemu/-/issues/1762 [2] https://github.com/NixOS/nixpkgs/pull/354535#issuecomment-2500791222 --- pkgs/build-support/vm/default.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index 8e262b20b3f6..aa504babdac5 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -176,10 +176,6 @@ rec { fi source $stdenv/setup - # Set the system time from the hardware clock. Works around an - # apparent KVM > 1.5.2 bug. - ${util-linux}/bin/hwclock -s - export NIX_STORE=${storeDir} export NIX_BUILD_TOP=/tmp export TMPDIR=/tmp