aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rc.conf2
-rwxr-xr-xrc.sysinit23
2 files changed, 15 insertions, 10 deletions
diff --git a/rc.conf b/rc.conf
index 0799974..076703c 100644
--- a/rc.conf
+++ b/rc.conf
@@ -8,6 +8,7 @@
#
# LOCALE: available languages can be listed with the 'locale -a' command
# HARDWARECLOCK: set to "UTC" or "localtime"
+# USEDIRECTISA: use direct I/O requests instead of /dev/rtc for hwclock
# TIMEZONE: timezones are found in /usr/share/zoneinfo
# KEYMAP: keymaps are found in /usr/share/kbd/keymaps
# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
@@ -16,6 +17,7 @@
#
LOCALE="en_US.utf8"
HARDWARECLOCK="localtime"
+USEDIRECTISA="yes"
TIMEZONE="Canada/Pacific"
KEYMAP="us"
CONSOLEFONT=
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