aboutsummaryrefslogtreecommitdiff
path: root/init.d
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2016-09-08 12:39:52 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2016-09-08 13:36:13 -0500
commit841b883825ddf9982a673b3964757f6df25acd46 (patch)
treec89c039801a57713a1e7f5a6043f29fc969d02f1 /init.d
parentba10793b0b85b11fae04e6526716c6f7976afde1 (diff)
hwclock: fix module load warning
Diffstat (limited to 'init.d')
-rw-r--r--init.d/hwclock.in27
1 files changed, 16 insertions, 11 deletions
diff --git a/init.d/hwclock.in b/init.d/hwclock.in
index d28ac850..e69c5615 100644
--- a/init.d/hwclock.in
+++ b/init.d/hwclock.in
@@ -80,6 +80,15 @@ get_noadjfile()
fi
}
+rtc_exists()
+{
+ local rtc=
+ for rtc in /dev/rtc /dev/rtc[0-9]*; do
+ [ -e "$rtc" ] && break
+ done
+ [ -e "$rtc" ]
+}
+
start()
{
local retval=0 errstr="" modname
@@ -92,17 +101,13 @@ start()
ebegin "Setting system clock using the hardware clock [$utc]"
if [ -e /proc/modules ]; then
- local rtc=
- for rtc in /dev/rtc /dev/rtc[0-9]*; do
- [ -e "$rtc" ] && break
- done
- if [ ! -e "${rtc}" ]; then
- for x in rtc-cmos rtc genrtc; do
- modprobe -q $x && modname=$x && break
- done
- [ -n "$modname" ] &&
- ewarn "The $modname module needs to be configured in \
- @SYSCONFDIR@/conf.d/modules or built in."
+ if ! rtc_exists; then
+ for x in rtc-cmos rtc genrtc; do
+ modprobe -q $x && rtc_exists && modname="$x" && break
+ done
+ [ -n "$modname" ] &&
+ ewarn "The $modname module needs to be configured in \
+ @SYSCONFDIR@/conf.d/modules or built in."
fi
fi