hwclock: fix module load warning

This commit is contained in:
William Hubbs 2016-09-08 12:39:52 -05:00
parent ba10793b0b
commit 841b883825

View File

@ -80,6 +80,15 @@ get_noadjfile()
fi fi
} }
rtc_exists()
{
local rtc=
for rtc in /dev/rtc /dev/rtc[0-9]*; do
[ -e "$rtc" ] && break
done
[ -e "$rtc" ]
}
start() start()
{ {
local retval=0 errstr="" modname local retval=0 errstr="" modname
@ -92,13 +101,9 @@ start()
ebegin "Setting system clock using the hardware clock [$utc]" ebegin "Setting system clock using the hardware clock [$utc]"
if [ -e /proc/modules ]; then if [ -e /proc/modules ]; then
local rtc= if ! rtc_exists; then
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 for x in rtc-cmos rtc genrtc; do
modprobe -q $x && modname=$x && break modprobe -q $x && rtc_exists && modname="$x" && break
done done
[ -n "$modname" ] && [ -n "$modname" ] &&
ewarn "The $modname module needs to be configured in \ ewarn "The $modname module needs to be configured in \