aboutsummaryrefslogtreecommitdiff
path: root/rc.sysinit
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2009-11-10 15:24:16 -0600
committerDan McGee <dan@archlinux.org>2009-11-10 15:24:16 -0600
commit5d063a532c4dfe687cece40829b9d66aa83ffe4a (patch)
tree8777501c01b297394e8f01d04a8eec6ca5996707 /rc.sysinit
parent7e479ce340e8014da3921f62f1a4f4b8e3c4f595 (diff)
downloadinitscripts-5d063a532c4dfe687cece40829b9d66aa83ffe4a.tar.xz
rc.sysinit: add and clarify clock comments
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'rc.sysinit')
-rwxr-xr-xrc.sysinit18
1 files changed, 15 insertions, 3 deletions
diff --git a/rc.sysinit b/rc.sysinit
index e948074..c09dad2 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -54,8 +54,14 @@ if [ -n "$HWCLOCK_PARAMS" ]; then
/bin/ln -s /dev/rtc0 /dev/rtc
fi
- # Set clock early to fix some bugs with filesystem checks
- # Clock is set again later to match rc.conf
+ # Do a clock set here for a few reasons:
+ # 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 does *NOT* take into account a time adjustment file as /var may not be
+ # mounted yet. A second set occurs later to match rc.conf.
if [ -f /etc/localtime ]; then
/sbin/hwclock $HWCLOCK_PARAMS --noadjfile
fi
@@ -283,8 +289,14 @@ fi
clock_pid=""
if [ -n "$HWCLOCK_PARAMS" ]; then
+ # This time, we set the clock for real. Use the adjustment file now that
+ # /var will definitely be available, and then set the system clock once
+ # the hardware clock has been adjusted accordingly. The backgrounding magic
+ # is due to the fact that the second call to hwclock will almost always
+ # take ~1 second because of the clock granularity, and we might as well
+ # stay busy.
(
- /sbin/hwclock --adjust #Adjust for system drift
+ /sbin/hwclock --adjust
/sbin/hwclock $HWCLOCK_PARAMS
) &
clock_pid=$!