Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 90703 - sys-apps/module-init-tools: depmod ignores first file when not in 'scan everything' mode
Summary: sys-apps/module-init-tools: depmod ignores first file when not in 'scan every...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-28 04:43 UTC by ajs
Modified: 2005-05-21 23:59 UTC (History)
0 users

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


Attachments
Patch that fixes depmod in module-init-tools 3.0 (module-init-tools-3.0-depmod-optind-off-by-one.patch,478 bytes, patch)
2005-04-28 04:50 UTC, ajs
Details | Diff
Patch that fixes depmod in module-init-tools 3.1 (module-init-tools-3.1-depmod-optind-off-by-one.patch,483 bytes, patch)
2005-04-28 04:52 UTC, ajs
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ajs 2005-04-28 04:43:45 UTC
The depmod tool, in all ebuilds from the module-init-tools package, has an off-by-one bug in the command-line option parsing. This means that when you tell it to scan a set of specific modules (instead of the default where everything is scanned), it always skips the first module.

Reproducible: Always
Steps to Reproduce:
% depmod -n `uname -r` foo bar > /dev/null

Actual Results:  
WARNING: Can't read module /bar: No such file or directory


Expected Results:  
WARNING: Can't read module /foo: No such file or directory
WARNING: Can't read module /bar: No such file or directory

I've confirmed this bug is in the module-init-tools-3.0-r2 and module-init-tools-3.1-r1 ebuilds. The 
fix is trivial, and will be included shortly (once I test my patch).
Comment 1 ajs 2005-04-28 04:50:17 UTC
Created attachment 57466 [details, diff]
Patch that fixes depmod in module-init-tools 3.0

The optind variable is set by the getopt functions. It points to the next
parameter that should be parsed. It therefore does not need to be adjusted to
find the start of the list of files to scan.

 - Andrew
Comment 2 ajs 2005-04-28 04:52:50 UTC
Created attachment 57467 [details, diff]
Patch that fixes depmod in module-init-tools 3.1

As remarked in earlier patch, optind is set by getopt to the next parameter to
process. As such it does not need to be offset to find the first file to scan.
Comment 3 SpanKY gentoo-dev 2005-04-28 20:10:51 UTC
i just checked module-init-tools-3.2-pre2 and it still could use this patch ... could you e-mail rusty@rustcorp.com.au about getting this resolved in upstream module-init-tools first ?
Comment 4 ajs 2005-04-29 02:22:11 UTC
I've sent an email (and the patch) to Rusty as suggested, with a CC to you.

I've also downgraded the bug, since I discovered this tool doesn't do what I wanted it to anyway. Instead I'm now using modprobe -n --set-version --show-deps to generate a list of modules for an initramfs, although depmod -e -F with a module list will be useful at the end to check the generated list is consistent.

Cheers,

 - Andrew
Comment 5 ajs 2005-05-02 01:21:01 UTC
I just received the following reply from Rusty:
> OK, I've also fixed the relative path bug (it doesn't handle relative
> paths, and prepends a "/"), and written a test case.
> 
> 3.2-pre3 will include this.
> 
> Thanks!
> Rusty.

That means the fix will be in 3.2. I don't know what the policy is for 'backporting' fixes is, especially for unreleased upstream packages, but am happy to leave this to the judgement of the wranglers.

Hope this helps,

 - Andrew
Comment 6 SpanKY gentoo-dev 2005-05-02 05:49:25 UTC
if you feel like grabbing the fix from the newer version, i'll add it to 3.1, otherwise we can just close the bug and wait for the new release since it doesnt seem like too critical an issue ...

thanks for e-mailing rusty btw !
Comment 7 SpanKY gentoo-dev 2005-05-21 23:59:17 UTC
erm forgot to close ...