hwclock: skip rtc checks if kernel lacks module support

Since we only use the result of the device scan to load modules, there is
no point in doing the scan if the kernel doesn't support modules in the
first place.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
Mike Frysinger 2008-10-26 07:09:02 +00:00
parent d12bb5cf3c
commit 1d96620b84

View File

@ -74,13 +74,15 @@ start()
fi fi
ebegin "Setting system clock using the hardware clock [${utc}]" ebegin "Setting system clock using the hardware clock [${utc}]"
if [ -e /proc/modules ]; then
local rtc= local rtc=
for rtc in /dev/rtc /dev/rtc[0-9]*; do for rtc in /dev/rtc /dev/rtc[0-9]*; do
[ -e "${rtc}" ] && break [ -e "${rtc}" ] && break
done done
if [ ! -e "${rtc}" -a -e /proc/modules ]; then if [ ! -e "${rtc}" ]; then
modprobe -q rtc-cmos || modprobe -q rtc || modprobe -q genrtc modprobe -q rtc-cmos || modprobe -q rtc || modprobe -q genrtc
fi fi
fi
if [ -e /etc/adjtime ] && yesno ${clock_adjfile}; then if [ -e /etc/adjtime ] && yesno ${clock_adjfile}; then
_hwclock --adjust ${utc_cmd} _hwclock --adjust ${utc_cmd}