From 73cdf10f1f513be7b5dec4f1cc91e0c68cda689b Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Thu, 18 Aug 2016 16:25:56 -0500 Subject: Deprecate automatic loading of modules In the hwclock, procfs and sysfs service scripts, we automatically attempt to load the kernel modules we need before we take any action. We shouldn't do this, because there are systems which do not use kernel modules and do not have the kmod package installed. With this change, we continue to load the modules ourselves, but we warn the admin that they need to be added to /etc/conf.d/modules or built into the kernel. In the future, this automatic loading will be dropped. X-Gentoo-Bug: 342313 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=342313 --- init.d/hwclock.in | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'init.d/hwclock.in') diff --git a/init.d/hwclock.in b/init.d/hwclock.in index 2cd1ef31..d28ac850 100644 --- a/init.d/hwclock.in +++ b/init.d/hwclock.in @@ -30,6 +30,7 @@ fi depend() { provide clock + want modules if yesno $clock_adjfile; then use root else @@ -81,7 +82,7 @@ get_noadjfile() start() { - local retval=0 errstr="" + local retval=0 errstr="" modname setupopts if [ -z "$utc_cmd" ]; then @@ -96,7 +97,12 @@ start() [ -e "$rtc" ] && break done if [ ! -e "${rtc}" ]; then - modprobe -q rtc-cmos || modprobe -q rtc || modprobe -q genrtc + 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." fi fi -- cgit v1.2.3