Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 269349 - openrc migration guide does not document /etc/conf.d/modules correctly
Summary: openrc migration guide does not document /etc/conf.d/modules correctly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: nm (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 213988
  Show dependency tree
 
Reported: 2009-05-11 00:20 UTC by Renat Golubchyk
Modified: 2010-07-20 08:51 UTC (History)
4 users (show)

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


Attachments
Initial patch (modules.patch,599 bytes, patch)
2009-05-11 00:21 UTC, Renat Golubchyk
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Renat Golubchyk 2009-05-11 00:20:11 UTC
/etc/init.d/modules doesn't consider all the modules listed in /etc/conf.d/modules

According to [1] the "configuration allows for fine grained control over the
modules and parameters based on kernel version". Reading the comments in Code
Listing 2.3  I get the impression that modules listed in ${modules} will be
loaded regardless of the kernel version, modules listed in ${modules_2_6} will
be loaded for any kernel in the 2.6 branch, and so on. It seems that the list
of loaded modules is cumulative, i.e. if I have, say, kernels 2.6.29 and
2.6.28 then if I boot 2.6.29 kernel the modules from ${modules},
${modules_2_6}, and ${modules_2_6_29} will be loaded. If I boot a 2.6.28 kernel
then the modules from ${modules}, ${modules_2_6}, and ${modules_2_6_28}
will be loaded.

Unfortunately, this is not what happens. /etc/init.d/modules doesn't
accumulate the modules listed. It scans the variables from the most specific
to the least specific, i.e. from ${KV} to ${modules} and stops at the first
one found:

        local list= x= xx= y= args= mpargs= cnt=0 a=
        for x in "${KV}" \
                ${KV_MAJOR}.${KV_MINOR}.${KV_MICRO} \
                ${KV_MAJOR}.${KV_MINOR} \
        ; do
                eval list=\$modules_$(shell_var "${x}")
                [ -n "${list}" ] && break
        done
        [ -z "${list}" ] && list=${modules}

With this approach one has to put the modules that are common to multiple
kernel versions into a variable specific to that kernel. This produces lots of
duplicate stuff in /etc/conf.d/modules and becomes tedious to maintain.

I propose to change the above code to something that makes the duplication
unnecessary and resembles the description in [1]. A patch is attached.



[1] http://www.gentoo.org/doc/en/openrc-migration.xml#doc_chap2_sect3

Reproducible: Always

Steps to Reproduce:
Comment 1 Renat Golubchyk 2009-05-11 00:21:25 UTC
Created attachment 190889 [details, diff]
Initial patch
Comment 2 Trevor Summers Smith 2010-01-20 06:16:41 UTC
The intended behavior of the modules config file is correct as is. Please see:
http://roy.marples.name/archives/openrc-discuss/2010/0073.html

I think the documentation at http://www.gentoo.org/doc/en/openrc-migration.xml#doc_chap2_sect3 does suggest that all 'matching' variables load their modules and that is incorrect.

I suggest this ticket should be changed to be in the 'Documentation' Component. Then the GDP can decide what changes should be made to the document.

Thoughts? Thanks.

Trevor 
Comment 3 William Hubbs gentoo-dev 2010-01-20 18:31:13 UTC
Docs team,

I agree with comment #2 in this bug.  The openrc migration guide implies that the modules* variables in /etc/conf.d/modules are cumulative, but this is not correct.

What actually happens is, the more version specific variables override the more general ones.


Thanks,

William
Comment 4 Renat Golubchyk 2010-01-20 23:53:27 UTC
I can't really say that I like it, but it's, of course, an equally fine solution to the problem. Code Listing 2.3 in the migration guide has to be fixed then.

Cheers,
Renat
Comment 5 nm (RETIRED) gentoo-dev 2010-07-20 08:51:34 UTC
Fixed in CVS.