aboutsummaryrefslogtreecommitdiff
path: root/rc.sysinit
diff options
context:
space:
mode:
authorThomas Bächler <thomas@archlinux.org>2009-11-05 22:03:55 +0100
committerThomas Bächler <thomas@archlinux.org>2009-11-05 22:03:55 +0100
commit4e35fd35e6eab00a4fcc99bbd84ffd7dda32e60d (patch)
treea005e92e446bac7b936e9307e525619fbc554f48 /rc.sysinit
parent4927f7decd20315a7020e9e37ef9f54fbfaf6e46 (diff)
downloadinitscripts-4e35fd35e6eab00a4fcc99bbd84ffd7dda32e60d.tar.xz
Only load rtc-cmos if rc.conf has proper clock settings
Diffstat (limited to 'rc.sysinit')
-rwxr-xr-xrc.sysinit28
1 files changed, 15 insertions, 13 deletions
diff --git a/rc.sysinit b/rc.sysinit
index 2b0231b..405f8dd 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -35,15 +35,6 @@ else
/bin/dmesg -n 3
fi
-# enable rtc access
-/sbin/modprobe rtc-cmos >/dev/null 2>&1
-RTC_MAJOR=$(/bin/grep -w rtc /proc/devices 2>/dev/null)
-RTC_MAJOR="${RTC_MAJOR%% *}"
-if [ -n "$RTC_MAJOR" ]; then
- /bin/mknod /dev/rtc0 c $RTC_MAJOR 0
- /bin/ln -s /dev/rtc0 /dev/rtc
-fi
-
HWCLOCK_PARAMS="--hctosys"
if [ "$HARDWARECLOCK" = "UTC" ]; then
HWCLOCK_PARAMS="$HWCLOCK_PARAMS --utc"
@@ -53,10 +44,21 @@ else
HWCLOCK_PARAMS=""
fi
-# Set clock early to fix some bugs with filesystem checks
-# Clock is set again later to match rc.conf
-if [ -n "$HWCLOCK_PARAMS" -a -f /etc/localtime ]; then
- /sbin/hwclock $HWCLOCK_PARAMS --noadjfile
+if [ -n "$HWCLOCK_PARAMS" ]; then
+ # enable rtc access
+ /sbin/modprobe rtc-cmos >/dev/null 2>&1
+ RTC_MAJOR=$(/bin/grep -w rtc /proc/devices 2>/dev/null)
+ RTC_MAJOR="${RTC_MAJOR%% *}"
+ if [ -n "$RTC_MAJOR" ]; then
+ /bin/mknod /dev/rtc0 c $RTC_MAJOR 0
+ /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
+ if [ -f /etc/localtime ]; then
+ /sbin/hwclock $HWCLOCK_PARAMS --noadjfile
+ fi
fi
echo > /proc/sys/kernel/hotplug