Bug 1389554 - dracut fails to insert mlx4_en module in initramfs for kernel-rt
Summary: dracut fails to insert mlx4_en module in initramfs for kernel-rt
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: rdma
Version: 6.8
Hardware: x86_64
OS: Linux
high
low
Target Milestone: beta
: 6.9
Assignee: Jarod Wilson
QA Contact: Mike Stowell
URL:
Whiteboard:
Depends On:
Blocks: 1346447 1401858
TreeView+ depends on / blocked
 
Reported: 2016-10-27 21:07 UTC by João Avelino Bellomo Filho
Modified: 2020-02-14 18:04 UTC (History)
12 users (show)

Fixed In Version: rdma-6.9_4.1-3.el6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1401858 (view as bug list)
Environment:
Last Closed: 2017-03-21 10:44:43 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0688 0 normal SHIPPED_LIVE rdma bug fix update 2017-03-21 12:37:57 UTC

Description João Avelino Bellomo Filho 2016-10-27 21:07:33 UTC
Description of problem:

The dracut scripts fail to insert the mlx4_en module in iniramfs file when the kernel is a 3.10 kernel-rt.

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


How reproducible:


Steps to Reproduce:
1. Install a normal RHEL 6.8 system and register it:

subscription-manager register --auto-attach

2. Install a 3.10 kernel-rt support, for example:

yum -y --enablerepo rhel-6-server-realtime-rpms groupinstall "MRG Realtime"

3. Check if the 'mlx4_en.ko' file is on initramfs file:

# lsinitrd /boot/initramfs-3.10.*.img | grep mlx4_en

Actual results:

An empty line.

Expected results:

-rwxr--r--. 1 root root 164080 Oct 21 01:47 /lib/modules/3.10.0-327.rt56.198.el6rt.x86_64/kernel/drivers/net/ethernet/mellanox/mlx4/mlx4_en.ko

Additional info:

The 'mlx4_en.ko' file is on initramfs file of the 2.6 kernel:

# lsinitrd /boot/initramfs-2.6.*.img | grep mlx4_en
-rwxr--r--   1 root     root       165048 May 12 17:51 lib/modules/2.6.32-642.el6.x86_64/kernel/drivers/net/mlx4/mlx4_en.ko

The dracut command was executed with verbose and debug enabled:

dracut -v --debug /boot/initramfs-3.10.0-327.rt56.190.el6rt.x86_64.new.img 3.10.0-327.rt56.190.el6rt.x86_64 &> dracut.3.output

The 'dracut.3.output' shows the call to the function 'instmods' with the correct arguments, where one of them is the 'mlx4' driver:

---- 'dracut.3.output' ----
...
  4033 //usr/share/dracut/modules.d/10rdma/installkernel@2(): instmods =drivers/infiniband =drivers/net/mlx4 =drivers/net/mlx5 cxgb3 cxgb4
...

The function instmods executes the 'find' command to search for the driver on a directory:

--- '/usr/share/dracut/dracut-functions' ---
...
606 # install kernel modules along with all their dependencies.
607 instmods() {
608     [[ $no_kernel = yes ]] && return
609     local mod mpargs modpath modname cmd
610     local ret=0
611     while (($# > 0)); do
612         mod=${1%.ko*}
613         case $mod in
614             =*) # This introduces 2 incompatible meanings for =* arguments
615                 # to instmods.  We need to decide which one to keep.
616                 if [[ $mod = =ata && -f $srcmods/modules.block ]] ; then
617                     instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.    block")
618                 elif [ -f $srcmods/modules.${mod#=} ]; then
619                     instmods $mpargs $(cat ${srcmods}/modules.${mod#=} )
620                 else
621                     instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*")  <--------------------- HERE
622                 fi
623                 ;;
...

The 'find' command works for 2.6 kernel, but it fails for 3.10 kernel, there is no argument on line #7544:
...
  7543 ///usr/share/dracut/dracut-functions@621(instmods): find /lib/modules/3.10.0-327.rt56.190.el6rt.x       86_64/ -path '*/drivers/net/mlx4/*'
  7544 //usr/share/dracut/dracut-functions@621(instmods): instmods
  7545 //usr/share/dracut/dracut-functions@608(instmods): [[ '' = yes ]]
...

The cause of the problem is that the dracut script was created to deal with 2.6 kernel, where the mlx4 kernel driver is located on directory '/lib/modules/2.6.*/kernel/drivers/net/mlx4', but the 3.10 kernel stores the mlx4 kernel driver on a 'mellanox' directory: '/lib/modules/3.10.*/kernel/drivers/net/ethernet/mellanox/mlx4'.

Comment 10 Jarod Wilson 2016-11-22 17:17:17 UTC
Simple one-line fix here.

Comment 23 errata-xmlrpc 2017-03-21 10:44:43 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0688.html


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