aboutsummaryrefslogtreecommitdiff
path: root/rc.sysinit
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2008-01-08 03:06:56 -0600
committerAaron Griffin <aaronmgriffin@gmail.com>2008-01-08 03:10:11 -0600
commit9bf2014b750579d9720c13c9dfb9d358e0c27665 (patch)
tree184dda549842d6d7906c00684b6d07d2e636e3be /rc.sysinit
parentab5595c4f8cdea8e6b1813701828576cbfee2fc2 (diff)
downloadinitscripts-9bf2014b750579d9720c13c9dfb9d358e0c27665.tar.xz
Allow --directisa configuration for hwclock calls
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'rc.sysinit')
-rwxr-xr-xrc.sysinit23
1 files changed, 13 insertions, 10 deletions
diff --git a/rc.sysinit b/rc.sysinit
index 11f533a..05e2303 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -36,14 +36,20 @@ mount -n -t sysfs none /sys
/sbin/modprobe usbcore >/dev/null 2>&1
grep -qw usbfs /proc/filesystems && mount -n -t usbfs none /proc/bus/usb
+HWCLOCK_PARAMS="--hctosys"
+if [ "$HARDWARECLOCK" = "UTC" ]; then
+ HWCLOCK_PARAMS="$HWCLOCK_PARAMS --utc"
+else
+ HWCLOCK_PARAMS="$HWCLOCK_PARAMS --localtime"
+fi
+if [ "$USEDIRECTISA" != "no" ]; then
+ HWCLOCK_PARAMS="$HWCLOCK_PARAMS --directisa"
+fi
+
# Set clock early to fix some bugs with filesystem checks
# Clock is set again later to match rc.conf
if [ -f /etc/localtime ]; then
- if [ "$HARDWARECLOCK" = "UTC" ]; then
- /sbin/hwclock --directisa --utc --hctosys --noadjfile
- else
- /sbin/hwclock --directisa --localtime --hctosys --noadjfile
- fi
+ /sbin/hwclock $HWCLOCK_PARAMS --noadjfile
fi
if [ -x /sbin/udevadm -a -d /sys/block ]; then
@@ -308,11 +314,8 @@ if [ "$TIMEZONE" != "" -a -e /usr/share/zoneinfo/$TIMEZONE ]; then
/bin/rm -f /etc/localtime
/bin/cp /usr/share/zoneinfo/$TIMEZONE /etc/localtime
fi
-if [ "$HARDWARECLOCK" = "UTC" ]; then
- /sbin/hwclock --directisa --utc --hctosys
-else
- /sbin/hwclock --directisa --localtime --hctosys
-fi
+
+/sbin/hwclock $HWCLOCK_PARAMS
stat_done
if [ -f /var/run/random-seed ]; then