commit: 841b883825ddf9982a673b3964757f6df25acd46 Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com> AuthorDate: Thu Sep 8 17:39:52 2016 +0000 Commit: William Hubbs <williamh <AT> gentoo <DOT> org> CommitDate: Thu Sep 8 18:36:13 2016 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=841b8838
hwclock: fix module load warning init.d/hwclock.in | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/init.d/hwclock.in b/init.d/hwclock.in index d28ac85..e69c561 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