Bug 564392 - mkinitrd ignores /etc/modprobe.d/*.conf
Summary: mkinitrd ignores /etc/modprobe.d/*.conf
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: mkinitrd
Version: 5.5
Hardware: All
OS: Linux
urgent
urgent
Target Milestone: rc
: ---
Assignee: Brian Lane
QA Contact: Release Test Team
URL:
Whiteboard:
: 596531 (view as bug list)
Depends On:
Blocks: 590060 rhel57rtt 694052
TreeView+ depends on / blocked
 
Reported: 2010-02-12 16:02 UTC by Buck Huppmann
Modified: 2018-12-02 15:27 UTC (History)
11 users (show)

Fixed In Version: mkinitrd-5.1.19.6-69.el5
Doc Type: Bug Fix
Doc Text:
Clone Of: 242463
Environment:
Last Closed: 2011-07-21 07:48:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
patch for mkinitrd to look at /etc/modprobe.d/* (1.51 KB, patch)
2010-05-26 21:54 UTC, Jeff Bastian
no flags Details | Diff
patch for mkinitrd to look at /etc/modprobe.d/* (1.52 KB, patch)
2011-03-23 21:17 UTC, Jeff Bastian
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1017 0 normal SHIPPED_LIVE mkinitrd bug fix update 2011-07-20 15:44:31 UTC

Description Buck Huppmann 2010-02-12 16:02:24 UTC
Add to the below that module options that appear any place but
/etc/modules.conf or /etc/conf.modules aren't picked up.  That's
actually what Fedora BZ 457870 fixes (and what i'm mainly inter-
ested in seeing fixed)

+++ This bug was initially created as a clone of Bug #242463 +++

Description of problem:
The mkinitrd script will only check the modules.conf file for needed modules. If
this file has includes defined they WONT be checked. Also if a modprobe.d
directory exists it WONT be checked


Version-Release number of selected component (if applicable):
mkinitrd-5.1.19.6-54

How reproducible:
use includes in the modprobe.conf or use modprobe.d
  
Actual results:
scsi_hostadapter entries in the included files or modprobe.d files aren't
included in the created initrd.

Expected results:
That the listed modules are included in the new initrd

--- Additional comment from johan.huysmans on 2007-07-17 05:38:17 EDT ---

I want to implement this myself, but i need some info about the functionality
and the expected behavior.
like: check modprobe.d only when modprobe.conf doesn't exists or also when it
exists, ...

--- Additional comment from buckh on 2010-02-12 10:56:44 EST ---

(In reply to comment #1)
> I want to implement this myself, but i need some info about the functionality
> and the expected behavior.
> like: check modprobe.d only when modprobe.conf doesn't exists or also when it
> exists, ...    

this is the same as Fedora bz 457870, which it says was closed as of Fedora 11,
so you can grab the mkinitrd out of a Fedora 11 distribution

but i vote for backporting this from Fedora, pretty please

i'll try adding a BZ for RHEL 5

Comment 1 Jeff Bastian 2010-05-26 21:50:37 UTC
*** Bug 596531 has been marked as a duplicate of this bug. ***

Comment 2 Jeff Bastian 2010-05-26 21:54:25 UTC
Created attachment 417045 [details]
patch for mkinitrd to look at /etc/modprobe.d/*

Attached is a patch to let mkinitrd look in /etc/modprobe.d/*

Steps to Reproduce:
1. (if necessary) edit /etc/modprobe.conf and add a line to use the cciss
module:
       alias scsi_hostadapter2 cciss
2. mv /etc/modprobe.conf /etc/modprobe.d/
3. mkinitrd -f --nocompress /tmp/initrd-testing.img `uname -r`
4. cpio -t < /tmp/initrd-testing.img | grep cciss

Actual results:
cciss module is not included in /tmp/initrd-testing.img

Expected results:
cciss module is included
   # cpio -t < /tmp/initrd-testing.img | grep cciss
   17077 blocks
   lib/cciss.ko

Comment 12 Brian Lane 2011-03-23 17:54:16 UTC
(In reply to comment #2)
> Created attachment 417045 [details]
> patch for mkinitrd to look at /etc/modprobe.d/*
> 

Shouldn't this be limited to *.conf? Sometimes users rename config files to turn them off.

Comment 13 Jeff Bastian 2011-03-23 19:03:06 UTC
You're probably right.

dracut (which has replaced mkinitrd) only looks at *.conf files:

install() {
    [ -f /etc/modprobe.conf ] && dracut_install /etc/modprobe.conf
    dracut_install $(find /etc/modprobe.d/ -type f -name '*.conf')
    ...

http://git.kernel.org/?p=boot/dracut/dracut.git;a=blob;f=modules.d/90kernel-modules/module-setup.sh;h=5f0e4a75c5f3fa073281a8340898c069fba6f899;hb=HEAD#l46

Comment 15 Jeff Bastian 2011-03-23 21:17:20 UTC
Created attachment 487149 [details]
patch for mkinitrd to look at /etc/modprobe.d/*

This is a very minor change to the patch:

-+    modulefile=( $(ls /etc/modprobe.d/* ) )
++    modulefile=( $(ls /etc/modprobe.d/*.conf ) )

Comment 23 Jan Stodola 2011-05-05 11:19:42 UTC
Changes made in this bug cause unwanted messages printed when /sbin/mkinitrd is called during installation or upgrade of kernel and kernel-debug packages:

...
Transaction Test Succeeded
Running Transaction
  Installing     : kernel-debug                     1/1 
Modulefile is /etc/modprobe.conf

Installed:
  kernel-debug.s390x 0:2.6.18-259.el5


Proposed fix:

diff -ur a/mkinitrd b/mkinitrd
--- a/mkinitrd  2011-05-05 07:20:48.000000000 -0400
+++ b/mkinitrd  2011-05-05 07:20:12.000000000 -0400
@@ -1179,7 +1179,7 @@
     modulefile=( $(ls /etc/modprobe.d/*.conf ) )
 fi
 
-echo "Modulefile is ${modulefile[@]}"
+vecho "Modulefile is ${modulefile[@]}"
 
 # find a temporary directory which doesn't use tmpfs
 if [ -z "$loopfs" ]; then

Moving back to ASSIGNED

Comment 25 Alexander Todorov 2011-05-25 11:59:51 UTC
Testing comment #2 with module-init-tools-3.3-0.pre3.1.60.el5_5.1

# cat /etc/modprobe.conf 
alias eth0 tg3
alias eth1 tg3
alias scsi_hostadapter mptbase
alias scsi_hostadapter1 mptsas
alias scsi_hostadapter2 cciss

# cat /etc/modprobe.d/usb.conf 
alias scsi_hostadapter3 usb-storage

# mkinitrd -f --nocompress /tmp/initrd-testing.img `uname -r`
# cpio -t < /tmp/initrd-testing.img | grep usb-storage
37988 blocks
#

usb-storage is not included. 


# mv /etc/modprobe.conf /etc/modprobe.conf.disabled
# mkinitrd -f --nocompress /tmp/initrd-testing.img `uname -r`
# cpio -t < /tmp/initrd-testing.img | grep usb-storage
35857 blocks
lib/usb-storage.ko

When modprobe.conf is not present modprobe.d is taken into account.

Comment 26 Alexander Todorov 2011-05-25 12:02:18 UTC
comment #25 is inline with the proposed patch (i.e. look at modprobe.d if modprobe.conf doesn't exist). The fix from comment #23 is also included. Moving to VERIFIED.

Comment 27 errata-xmlrpc 2011-07-21 07:48:35 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1017.html


Note You need to log in before you can comment on or make changes to this bug.