Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 23923 - /etc/init.d/modules requires sysctl support in kernel
Summary: /etc/init.d/modules requires sysctl support in kernel
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Martin Schlemmer (RETIRED)
URL: http://forums.gentoo.org/viewtopic.ph...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-03 15:05 UTC by Bas van Dijk
Modified: 2003-07-17 12:15 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bas van Dijk 2003-07-03 15:05:28 UTC
I noticed that the /etc/init.d/modules scripts tries to read from: 
 
/proc/sys/osrelease 
 
[CODE] 
... 
if [ -f /etc/modules.autoload -a ! -L /etc/modules.autoload ] 
        then 
                einfo "Using /etc/modules.autoload:" 
                # Loop over every line in /etc/modules.autoload. 
                load_modules /etc/modules.autoload 
        else 
                local KV="$(</proc/sys/kernel/osrelease)" 
                local KV_MAJOR="`KV_major "${KV}"`" 
                local KV_MINOR="`KV_minor "${KV}"`" 
 
                # New support for /etc/modules.autoload/kernel-$KV 
                if [ "$(get_KV)" -ge "$(KV_to_int '2.5.0')" ] && \ 
                   [ -f /etc/modules.autoload.d/kernel-"${KV_MAJOR}.${KV_MINOR}" ] 
                then 
                        einfo "Using 
/etc/modules.autoload.d/kernel-${KV_MAJOR}.${KV_MINOR}:" 
                        load_modules 
/etc/modules.autoload.d/kernel-"${KV_MAJOR}.${KV_MINOR}" 
                else 
                        einfo "Using /etc/modules.autoload.d/kernel-2.4:" 
                        load_modules /etc/modules.autoload.d/kernel-2.4 
                fi 
        fi 
... 
[/CODE] 
 
So if you don't have modules.autoload you are required to have /proc/sys/osrelease 
 
However, the /proc/sys directory only exist if you compiled your kernel with "sysctl" 
support. 
 
I talked with Gentoo developer: Sven Vermeulen about this. He said that it wasn't a 
good idea to be too depended on the kernel. He proposed two possible solutions: 
 
- Make the use of modules.autoload obligated (i.e. include it in baselayout) 
- Edit /etc/init.d/modules so that it doens't require sysctl support. 
 
This bug came out of a forum discussion: 
http://forums.gentoo.org/viewtopic.php?t=64807
Comment 1 Bas van Dijk 2003-07-03 15:09:05 UTC
Also, the install-doc doesn't mension including the sysctl option. 
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2003-07-17 12:15:01 UTC
Fixed in CVS.  New baselayout in a bit.

Side note:  I do not know if anybody these days do not use
            sysctl support, but sure, especially for porting
            to non linux systems, it will be better to use
            'uname -r'.

----------------------------------
Index: init.d/modules
===================================================================
RCS file: /home/cvsroot/gentoo-src/rc-scripts/init.d/modules,v
retrieving revision 1.24
diff -u -r1.24 modules
--- init.d/modules	15 Jul 2003 20:36:32 -0000	1.24
+++ init.d/modules	17 Jul 2003 19:12:01 -0000
@@ -50,7 +50,7 @@
 		# Loop over every line in /etc/modules.autoload.
 		load_modules /etc/modules.autoload
 	else
-		local KV="$(</proc/sys/kernel/osrelease)"
+		local KV="$(uname -r)"
 		local KV_MAJOR="`KV_major "${KV}"`"
 		local KV_MINOR="`KV_minor "${KV}"`"