Bug 996245 - dracut fails to include dm and dmraid even when specified in dracut.conf (after latest update)
dracut fails to include dm and dmraid even when specified in dracut.conf (aft...
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: dracut (Show other bugs)
rawhide
x86_64 Linux
unspecified Severity high
: ---
: ---
Assigned To: dracut-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-12 14:23 EDT by Peter Trenholme
Modified: 2013-08-15 02:51 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-15 02:51:29 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Requested dracut --debug log file (gziped) (101.57 KB, application/gzip)
2013-08-14 19:39 EDT, Peter Trenholme
no flags Details

  None (edit)
Description Peter Trenholme 2013-08-12 14:23:03 EDT
Description of problem: The initramfs file cannot boot from a raid1 drive without the dm and dmraid modules.


Version-Release number of selected component (if applicable):
031-24.git20130809.fc20031-24.git20130809.fc20

How reproducible:
Every time

Steps to Reproduce:
1.dracut --force --kver 3.11.0-0.rc4.git5.1.fc20.x86_64
2.
3.

Actual results:
# lsinitrd /boot/initramfs-3.11.0-0.rc4.git5.1.fc20.x86_64.img | head -17
Image: /boot/initramfs-3.11.0-0.rc4.git5.1.fc20.x86_64.img: 9.0M
========================================================================
dracut-031-24.git20130809.fc20 with dracut modules:
caps
i18n
drm
plymouth
kernel-modules
rootfs-block
terminfo
udev-rules
biosdevname
systemd
base
fs-lib
shutdown
========================================================================


Expected results:
# lsinitrd /boot/initramfs-3.11.0-0.rc4.git2.1.fc20.x86_64.img | head -19
Image: /boot/initramfs-3.11.0-0.rc4.git2.1.fc20.x86_64.img: 9.9M
========================================================================
dracut-031-7.git20130801.fc20 with dracut modules:
i18n
drm
plymouth
dm
dmraid
kernel-modules
mdraid
rootfs-block
terminfo
udev-rules
biosdevname
systemd
base
fs-lib
shutdown
========================================================================


Additional info:
I've been running yum -y --skip-broken update daily, and only the git2 kernel is bootable.
Comment 1 Peter Trenholme 2013-08-12 14:44:48 EDT
Oops! I just noticed that I'd forgotten to remove the comment from the "add_drivers" command. After correcting that, the dm modules ARE included. (I haven't yet tried booting, but I expect it will work.)

So the problem is that, with 'hostonly="yes",' the needed raid drives are, apparently, not included.
Comment 2 Peter Trenholme 2013-08-12 16:48:58 EDT
Well, that didn't work: dm and dmraid were there, but mdraid was not included. I tried adding it:

$ grep -v '#' /etc/dracut.conf | grep -v '^[[:space:]]*$'
add_dracutmodules+="dm dmraid"
add_drivers+="mdraid"
hostonly="yes"
mdadmconf="yes"
lvmconf="no"

but all I got was:

$ sudo dracut --force -kver 3.11.0-0.rc4.git2.1.fc20.x86_64
/usr/lib/dracut/dracut-functions.sh: line 78: vercmp: command not found
/usr/lib/dracut/dracut-functions.sh: line 129: 14 > 3 7: syntax error in expression (error token is "7")
/usr/lib/dracut/dracut-functions.sh: line 130: 14 < 3 7: syntax error in expression (error token is "7")
/usr/lib/dracut/dracut-functions.sh: line 129: 14 > 3 7: syntax error in expression (error token is "7")
/usr/lib/dracut/dracut-functions.sh: line 130: 14 < 3 7: syntax error in expression (error token is "7")
Failed to install module mdraid

So I tried to fix the vercmp function, after repositioning its use to follow its definition:

# Version comparison function.  Assumes Linux style version scheme.
# $1 = version a
# $2 = comparison op (gt, ge, eq, le, lt, ne)
# $3 = version b
vercmp() {
    local _n1=${1//./""/} _op=$2 _n2=${3//./""/} _i _res

    for ((_i=0; ; _i++))
    do
        if [[ ! ${_n1[_i]}${_n2[_i]} ]]; then _res=0
        elif ((${_n1[_i]:-0} > ${_n2[_i]:-0})); then _res=1
        elif ((${_n1[_i]:-0} < ${_n2[_i]:-0})); then _res=2
        else continue
        fi
        break
    done

    case $_op in
        gt) ((_res == 1));;
        ge) ((_res != 2));;
        eq) ((_res == 0));;
        le) ((_res != 1));;
        lt) ((_res == 2));;
        ne) ((_res != 0));;
    esac
}

This "fixed" it so that no error message was generated, but the mdraid module sill is not loaded.

I think that someone more attuned to the details on the "standard" versioning system may do better. (And I suspect that the new version of bash is not doing what the author of this function expected with the _n1=${1//./ }.
Comment 3 Harald Hoyer 2013-08-14 06:48:23 EDT
Thanks for finding the "vercmp()" bug!

Please attach the output of:

# sudo dracut --force -kver 3.11.0-0.rc4.git2.1.fc20.x86_64 --debug
Comment 4 Peter Trenholme 2013-08-14 19:39:47 EDT
Created attachment 786726 [details]
Requested dracut --debug log file (gziped)

OK, here it is, but the error seems to have been fixed. (Note the update to -29 made yesterday.)

$ sudo grep dracut /var/log/yum.log | grep 'Aug'
Aug 11 10:04:43 Updated: dracut-031-24.git20130809.fc20.x86_64
Aug 11 10:05:08 Updated: dracut-network-031-24.git20130809.fc20.x86_64
Aug 11 10:05:09 Updated: dracut-config-rescue-031-24.git20130809.fc20.x86_64
Aug 13 15:37:57 Updated: dracut-031-29.git20130812.fc20.x86_64
Aug 13 15:41:05 Updated: dracut-network-031-29.git20130812.fc20.x86_64
Aug 13 15:41:06 Updated: dracut-caps-031-29.git20130812.fc20.x86_64
Aug 13 15:41:07 Updated: dracut-config-rescue-031-29.git20130812.fc20.x86_64

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