summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-05-11 16:22:49 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-07-22 12:23:52 +0200
commitec82157ac5b36560c7edae4acfe47edb57133991 (patch)
tree61783c40f25764f23e2426ce3daff743641aeaf2 /nixos/modules
parent9647609e3eb687079d2120b57bdf095d8643671f (diff)
downloadnixlib-ec82157ac5b36560c7edae4acfe47edb57133991.tar
nixlib-ec82157ac5b36560c7edae4acfe47edb57133991.tar.gz
nixlib-ec82157ac5b36560c7edae4acfe47edb57133991.tar.bz2
nixlib-ec82157ac5b36560c7edae4acfe47edb57133991.tar.lz
nixlib-ec82157ac5b36560c7edae4acfe47edb57133991.tar.xz
nixlib-ec82157ac5b36560c7edae4acfe47edb57133991.tar.zst
nixlib-ec82157ac5b36560c7edae4acfe47edb57133991.zip
stage-2: Don't run hwclock in containers
(cherry picked from commit b978df019a2b1281f7a70445eaa71b45049f4cfd)
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/system/boot/stage-2-init.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/nixos/modules/system/boot/stage-2-init.sh b/nixos/modules/system/boot/stage-2-init.sh
index 330e2f97c5bf..a73070ab332f 100644
--- a/nixos/modules/system/boot/stage-2-init.sh
+++ b/nixos/modules/system/boot/stage-2-init.sh
@@ -164,7 +164,9 @@ $systemConfig/activate
 # Restore the system time from the hardware clock.  We do this after
 # running the activation script to be sure that /etc/localtime points
 # at the current time zone.
-hwclock --hctosys
+if [ -e /dev/rtc ]; then
+    hwclock --hctosys
+fi
 
 
 # Record the boot configuration.