Package: dracut
Version: 020-1
Severity: important
Tags: patch

Currently, when running dracut on a kernel which is not the running
kernel, the following command is used in dracut_kernel_post() (see
dracut-functions.sh) to get the list of files needed for a given module:

    modprobe -a -d / --ignore-install --show-depends <module name>

dracut does not specify the kernel version, which results in modprobe
assuming the request is for the currently running kernel. Basically,
running dracut for kernel version "verB" while running on kernel
version "verA" results in the following output:

    # dracut -v /boot/initrd.img-verB verB
    [...]
    I: *** Installing kernel module dependencies and firmware ***
    D: Installing //lib/modules/verA/kernel/drivers/ata/acard-ahci.ko
    D: Installing //lib/modules/verA/kernel/drivers/ata/ahci.ko
    [etc...]

As a result, the modules for the currently running kernel are installed
into the initrd as opposed to the modules for the target kernel. This
is obviously wrong and will most likely result in an unbootable system.

The solution is to use the --set-version option of modprobe, like this:

    modprobe -a -d / --setversion verB --ignore-install --show-depends <module 
name>

The following patch does just that:

    --- dracut-functions.sh.old     2012-08-15 19:18:03.116533000 +0200
    +++ dracut-functions.sh 2012-08-15 19:53:35.649868000 +0200
    @@ -1182,7 +1182,7 @@
         local _moddirname=${srcmods%%/lib/modules/*}
    
         if [[ -f "$initdir/.kernelmodseen/lazylist" ]]; then
    -        xargs modprobe -a ${_moddirname+-d ${_moddirname}/} 
--ignore-install --show-depends \
    +        xargs modprobe -a ${_moddirname+-d ${_moddirname}/} --set-version 
$kernel --ignore-install --show-depends \
                 < "$initdir/.kernelmodseen/lazylist" 2>/dev/null \
                 | sort -u \
                 | while read _cmd _modpath _options; do

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-3-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages dracut depends on:
ii  cpio               2.11-8
ii  kbd-compat [kbd]   1:0.2.3dbs-70
ii  kpartx             0.4.9+git0.4dfdaf2b-6
ii  module-init-tools  9-1
ii  udev               175-6
ii  util-linux         2.20.1-5.1

Versions of packages dracut recommends:
ii  cryptsetup  2:1.4.3-2
pn  dmraid      <none>
ii  dmsetup     2:1.02.74-4
pn  lvm2        <none>
pn  mdadm       <none>

Versions of packages dracut suggests:
pn  dracut-network  <none>

-- Configuration Files:
/etc/dracut.conf changed [not included]

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to