Bug 125990
Summary: | depmod under 2.6.x does not look first in "updates/" directory | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Fernando Lopez-Lezcano <nando> | ||||||
Component: | module-init-tools | Assignee: | Bill Nottingham <notting> | ||||||
Status: | CLOSED RAWHIDE | QA Contact: | |||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | 2 | CC: | axel.thimm, florin, pmatilai, rvokal | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2004-10-11 16:57:40 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 123268 | ||||||||
Attachments: |
|
Description
Fernando Lopez-Lezcano
2004-06-14 21:51:23 UTC
Created attachment 101132 [details]
one possible patch to fix the problem
This patch changes grab_dir so that it always scans the "updates" directory
last (last scan means first output). It seems to work fine in limited tests,
modules installed in the "updates" directory take precedence to the ones in the
normal kernel tree.
I'm certain this could be done more efficiently :-) I'm using scandir which
does a sort that is not really necessary (and then just a linear scan searching
for the "updates" directory)....
I'm not checking the recursion depth so any "updates" directory at any level in
the tree should take precedence - not tested (I don't know if that was the
behavior in 2.4.x).
Created attachment 101154 [details]
a better patch (I think)
Another approach. Just uses readdir again (no unneeded sort happens, no
duplicate scans). I add a parameter to grab_dir to ignore the "updates"
directory on the scan that parses the whole module tree. This patch only
considers an "updates" directory in the top level of the modules tree (ie:
/lib/modules/`uname -r`/updates), any other "updates" directories are treated
as standard subdirectories. This could be easily changed.
I think I'll use this patch unless somebody finds any problems with it. I would
appreciate additional eyes to check for stupid typos or logic flaws. Seems to
be working fine.
Hi, I checked your second patch, but I don't think it's correct. Basically you discard the first list (which is a memleak, but not that important), and only keep the second list (from updates/) I looked at the problem, and created a new patch that also fixes modinfo, and seems to me to have the right logic. I verified that it works with my pwcx kernel module packages and looking at the modules.dep files generated. The patch is up at http://thomas.apestaart.org/download/patches/modutils/module-init-tools-update/ and the modutils rpm with the fix is at http://thomas.apestaart.org/download/pkg/fedora-2-i386-fedora-stable/modutils-2.4.26-16.fdr.1.2/ together with a module for pwc/pwcx that you could try it out with: http://thomas.apestaart.org/download/pkg/fedora-2-i386-fedora-stable/kernel-module-pwcx-9.0-0.0.beta.2.fdr.3.2/ (You don't need to have the webcam, just install and look at the generated .deps files) Thanks Thomas! Your patch is better because it removes the duplicates. I don't know if that matters at all, it does not seem to make a difference here (I have not looked at the code but I'm guessing modprobe does a linear scan and uses the first matching module it finds, that matches the behavior I have observed). I do think my patch works (with the caveat that it does not remove duplicate entries). The first list is not discarded. grab_dir eventually calls grab_module and that creates a new struct and links from it to whatever it receives as the parameter "next" (a null for the first one). So, the second call (which is the one that scans the updates directory) merely adds to the beginning of the list and thus overrides whatever was scanned by the first call, which does everything except for the updates directory. If I grep modules.dep for the modules I'm overriding I see both the updates (first) and the original (second) (plus everything works after a reboot, otherwise things like eth0 would not load). Should be fixed in current module-init-tools. |