summaryrefslogtreecommitdiff
path: root/src/core/main.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2012-10-27 16:23:32 +0200
committerKay Sievers <kay@vrfy.org>2012-10-27 16:31:10 +0200
commit19e65613563dd9c14cf1ce58aa6e151de8fb90c2 (patch)
treee4ee82809a4dbb218d041a5966e46ad872b0715d /src/core/main.c
parentb80f194eea3e2757966118cadf218354b11bf5da (diff)
hwclock: do not seal the kernel's time-warp call from inside the initrd
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/core/main.c b/src/core/main.c
index e094efeb3c..4da8ecb864 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1350,8 +1350,15 @@ int main(int argc, char *argv[]) {
log_error("Failed to apply local time delta, ignoring: %s", strerror(-r));
else
log_info("RTC configured in localtime, applying delta of %i minutes to system time.", min);
- } else {
- /* Do dummy first-time call to seal the kernel's time warp magic */
+ } else if (!in_initrd()) {
+ /*
+ * Do dummy first-time call to seal the kernel's time warp magic
+ *
+ * Do not call this this from inside the initrd. The initrd might not
+ * carry /etc/adjtime with LOCAL, but the real system could be set up
+ * that way. In such case, we need to delay the time-warp or the sealing
+ * until we reach the real system.
+ */
hwclock_reset_timezone();
/* Tell the kernel our time zone */