aboutsummaryrefslogtreecommitdiff
path: root/rc.sysinit
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2011-06-25 00:53:05 +0200
committerTom Gundersen <teg@jklm.no>2011-06-25 01:27:53 +0200
commitac55830ea6cfa2c130275ebd6b4f2c0fea80130e (patch)
treed9756cca22e0772acf615de2b9ae730e51bc1f2b /rc.sysinit
parent5b19b901c6b00dd9b2b3a39e983b88ddd5eb874f (diff)
downloadinitscripts-ac55830ea6cfa2c130275ebd6b4f2c0fea80130e.tar.xz
hwclock: use correct timezone
To avoid setting the kernel timezone with an out-of-date /etc/localtime, we pass TZ directly to hwclock. Also document how TIMEZONE and HARDWARECLOCK are optional in rc.conf Signed-off-by: Tom Gundersen <teg@jklm.no>
Diffstat (limited to 'rc.sysinit')
-rwxr-xr-xrc.sysinit11
1 files changed, 6 insertions, 5 deletions
diff --git a/rc.sysinit b/rc.sysinit
index 3773beb..0fca20e 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -62,11 +62,12 @@ if [[ $HWCLOCK_PARAMS ]]; then
# Adjust the system time for timezone offset if rtc is not in UTC
# 1. Make creation time on udev nodes sane (FS#8665)
# 2. Filesystem checks can depend on system time
- # 3. This will set the clock, if using non-UTC, off the last known
- # configured timezone. Any new timezone put in rc.conf is copied over at
- # a later time.
- # This also sets the kernel time zone.
- [[ -f /etc/localtime ]] && hwclock $HWCLOCK_PARAMS
+ # 3. This also sets the kernel time zone, used by e.g. vfat
+ # If TIMEZONE is not set in rc.conf, the timezone stored in /etc/localtime
+ # is used. If HARDWARECLOCK is not set in rc.conf, the value in
+ # /var/lib/hwclock/adjfile is used (in this case /var can not be a separate
+ # partition).
+ TZ=$TIMEZONE && hwclock $HWCLOCK_PARAMS
fi
# Start/trigger UDev, load MODULES and settle UDev