Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 154047 - Please add the ability to support a custom modules ordering without editing package provided modules_load file
Summary: Please add the ability to support a custom modules ordering without editing p...
Status: RESOLVED DUPLICATE of bug 186652
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Other
: High enhancement (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-04 09:37 UTC by Andy Wang
Modified: 2008-02-26 00:45 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 Andy Wang 2006-11-04 09:37:49 UTC
This is a re-request for Bug #96357.  The solution for that bug is not really effective in cases where module load order matters.  For example, I have a motherboard that supports sata_sil24 and sata_nv.  sata_sil24 is the e-sata driver and sata_nv is the internal sata driver.  Currently sata_sil24 loads first and sata_nv loads second.  If I have an esata device attached at boot, the scsi device enumeration will make that device /dev/sda vs. /dev/sdb.  This requires the use of labels for my partitions and in /etc/fstab which has it's own set of problems.  By reordering sata_nv to be first, problem solved.

The AMODULES_* method:

for group_modules in ${!AMODULES_*}; do
        group="$(echo $group_modules | cut -d_ -f2)"
        eval cmodules="\$$group_modules"
        eval MODULES_${group}=\"\${MODULES_${group}} ${cmodules}\"
        print_info 1 "<config> Merged AMODULES_${group}:'${cmodules}' into MODULES_${group}"
done

Adds the custom modules AFTER the values in modules_load, so short of making my own custom arch, or modifying modules_load, which might be overridden by emerge updates there's no real easy solution to this.
Comment 1 Andy Wang 2006-11-04 10:57:14 UTC
Another piece of this is that it doesn't really make sense on most fully modular systems to load usb and firewire before sata.  Since scsi isn't included in MY_HWOPTS by default, it also gets tossed to the end of MY_HWOPTS.

Shouldn't external devices have their modules loaded last?  That way any dev nodes constructed for internal devices are guaranteed to be somewhat stable( i.e. sda for the first scsi or sata disk vs. maybe being sdb if a usb or firewire external device is powered up, or maybe being sda if the device isn't powered up).

I'm more than willing to do the work to implement this and create a patch, so if the genkernel team is interested, I'd be more than happy to take input on how you want this done.

Here are the ways I was thinking of doing it:
For the initial comment #1, simply allow a --modulesload=<file> argument, and the ability to override it in /etc/genkernel.conf as well.

For this comment, either I was pretty much thinking of allowing MY_HWOPTS in /etc/genkernel.conf to override the order.

Anyways, if you guys are interested in implementing these solutions let me know how you want to approach and I can do the work.
Comment 2 Chris Gianelloni (RETIRED) gentoo-dev 2007-03-14 00:54:17 UTC
I'd prefer we set the location for config.sh and modules_load in genkernel.conf (with the defaults being their current locations).  As for the order of the device types, I'm open for suggestions on how to rearrange them.  I would prefer just fix genkernel so it loads them in a proper order all the time, which means we'll need to add scsi to HWOPTS and make genkernel properly respect the order, even when things like "doscsi" are used.  I don't really have a problem with allowing MY_HWOPTS to be set in genkernel.conf, either.
Comment 3 Sylvain BERTRAND 2007-11-16 18:49:20 UTC
What do you think of a user provided list of modules (command line and/or text file) instead of the modules statically provided in genkernel files? There would be an additional flag to tell genkernel it's a ordered list for loading.
Comment 4 Chris Gianelloni (RETIRED) gentoo-dev 2007-11-20 19:43:24 UTC
The file would still have to be in the same format as modules_load, and that is exactly what I'm talking about.
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2007-11-21 02:57:11 UTC
Amongst the previous patches I posted in bugzilla for genkernel, there is a patch for this, but it accomplishes it in a better way, so it's due to go into genkernel-3.5.x, not into the 3.4.x series.
Comment 6 Chris Gianelloni (RETIRED) gentoo-dev 2008-02-26 00:45:18 UTC

*** This bug has been marked as a duplicate of bug 186652 ***