Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 208593 - /sbin/modprobe does not work with multiple kernels
Summary: /sbin/modprobe does not work with multiple kernels
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-02 16:08 UTC by fdupoux
Modified: 2008-02-14 04:32 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 fdupoux 2008-02-02 16:08:52 UTC
I have a problem with the /usr/share/genkernel/generic/modprobe (the modprobe script implementation for busybox) script that comes with genkernel-3.4.9 (final version). This script has a problem when we have more than one set of kernel modules in /lib/modules. The insmod may fail because the script uses 'find /lib/modules' to get the full path to the kernel module in real_mod_path().

The problem is when you have vmlinuz2 loaded into memory and you want to load the 'xxx' module, the script will load /lib/modules/vmlinuz1/xxx.ko instead of /lib/modules/vmlinuz2/xxx.ko. Just because the wrong 'vmlinuz1' subdirectory will be found before the right 'vmlinuz2' subdirectory by the find command.

All you have to do is to search in the right subdirectory.
To fix the bug, edit the modprobe script and do that:
replace
   find /lib/modules | grep /"${1}${KSUFF}"
with
   find /lib/modules/${KV} | grep /"${1}${KSUFF}"


Reproducible: Always

Steps to Reproduce:
1. make an initramfs that can work with more than one kernel
2.
3.
Comment 1 Andrew Gaffney (RETIRED) gentoo-dev 2008-02-02 16:36:09 UTC
Well, you are using genkernel's initramfs in an unsupported way. You can't really complain that it breaks :P However, the proposed fix is simple and appears harmless even for "supported" configurations.
Comment 2 fdupoux 2008-02-02 16:49:41 UTC
Hi Andrew,

Thanks for your quick reply. That's right this is an unsupported usage, but it's always better to have a program that works in all conditions. That's just a small contribution to improve genkernel. Hope you can include this patch in the next genkernel version.

Thanks.
Comment 3 Andrew Gaffney (RETIRED) gentoo-dev 2008-02-02 17:34:34 UTC
This is fixed in SVN. Thanks.
Comment 4 Chris Gianelloni (RETIRED) gentoo-dev 2008-02-14 04:32:41 UTC
I just released genkernel 3.4.10_pre1, which has this fix included.  Feel free to REOPEN this bug or make a comment if it is not resolved.