MODULES=dep does not handle modprobe install directives

Bug #31318 reported by Thomas J. Moore
10
Affects Status Importance Assigned to Milestone
initramfs-tools (Debian)
Fix Released
Unknown
initramfs-tools (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

manual_add_modules blindly assumes that modprobe returns "insmod <path> [<options>]". However, the default alsa configuration for ubuntu overrides the install command for snd and some related modules. The install directives are printed verbatim by modprobe, causing several problems:

  1) the second word is "modprobe", so an invalid link to modprobe is created in / on the initrd. This could easily be fixed by filtering modprobe's output with "grep '^insmod'".

  2) naturally, any activity done by the install command is ignored.

I'd like to see #1 fixed. #2 is harder, and can wait. It's impossible to get #2 truly right, since install commands are arbitrary, but a good compromise would be to parse out "modprobe" words, and find the next non-option argument after that word. Unfortunately, I can't think of a way to do this in the shell without either creating an infinite loop or introducing a global variable:

printed_modules=

mod_dep() {
  modprobe --show-depends "$@" 2>/dev/null | while read x y z; do
    if [ install = "$x" ]; then
      dump_install "$y $z"
    elif [ insmod = "$x" ]; then
      echo $y
    fi
  done | sort -u
}

dump_install() {
  set -- `echo "$1"`
  while [ $# -gt 0 ]; do
    case "$1" in
      modprobe|*/modprobe)
        shift
        while [ "x${1#-}" != "x$1" -a $# -gt 0 ]; do
          shift
        done
        if [ $# -gt 0 -a "${printed_modules#*#$1#}" = "${printed_modules}" ]; then
          printed_modules="${printed_modules}#$1#"
          mod_dep --ignore-install "$1"
        fi
        ;;
    esac
    shift
  done
}

Revision history for this message
In , maximilian attems (maks-debian) wrote : Bug#342616: fixed in initramfs-tools 0.50c

Source: initramfs-tools
Source-Version: 0.50c

We believe that the bug you reported is fixed in the latest version of
initramfs-tools, which is due to be installed in the Debian FTP archive:

initramfs-tools_0.50c.dsc
  to pool/main/i/initramfs-tools/initramfs-tools_0.50c.dsc
initramfs-tools_0.50c.tar.gz
  to pool/main/i/initramfs-tools/initramfs-tools_0.50c.tar.gz
initramfs-tools_0.50c_all.deb
  to pool/main/i/initramfs-tools/initramfs-tools_0.50c_all.deb

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to <email address hidden>,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
maximilian attems <email address hidden> (supplier of updated initramfs-tools package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing <email address hidden>)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sat, 14 Jan 2006 17:40:48 +0100
Source: initramfs-tools
Binary: initramfs-tools
Architecture: source all
Version: 0.50c
Distribution: unstable
Urgency: low
Maintainer: Debian kernel team <email address hidden>
Changed-By: maximilian attems <email address hidden>
Description:
 initramfs-tools - tools for generating an initramfs
Closes: 340258 342616
Changes:
 initramfs-tools (0.50c) unstable; urgency=low
 .
   "E so io muoio da partigiano"
 .
   * hook-functions: Fix MODULES=dep as `modprobe --show-depends' prints not
     only the insmod commands, but also the install ones. Thanks for the patch
     to Jean Charles Delepine <email address hidden>. (Closes: #342616)
 .
   * hooks/evms, scripts/local-top/evms: EVMS takes care of it's own hooks, rm.
     Thanks Steinar H. Gunderson <email address hidden>. (Closes: 340258)
Files:
 fc78a9e180f98a3860a87eb27f9d17d8 631 utils optional initramfs-tools_0.50c.dsc
 5977d3ed14b0a45183bfaaf012c86861 30485 utils optional initramfs-tools_0.50c.tar.gz
 5f11ac451cd2224cd3d61cbe3c0b20cb 35346 utils optional initramfs-tools_0.50c_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDyY9iXKRQ3lK3SH4RAnc0AJ0XrGoM0gW1pB4mBNA3l81Fqdc4mwCfT0nZ
7cXgBCXkSscdsDHZY+ped2o=
=NtOH
-----END PGP SIGNATURE-----

Revision history for this message
Thomas J. Moore (dark-mama) wrote :

manual_add_modules blindly assumes that modprobe returns "insmod <path> [<options>]". However, the default alsa configuration for ubuntu overrides the install command for snd and some related modules. The install directives are printed verbatim by modprobe, causing several problems:

  1) the second word is "modprobe", so an invalid link to modprobe is created in / on the initrd. This could easily be fixed by filtering modprobe's output with "grep '^insmod'".

  2) naturally, any activity done by the install command is ignored.

I'd like to see #1 fixed. #2 is harder, and can wait. It's impossible to get #2 truly right, since install commands are arbitrary, but a good compromise would be to parse out "modprobe" words, and find the next non-option argument after that word. Unfortunately, I can't think of a way to do this in the shell without either creating an infinite loop or introducing a global variable:

printed_modules=

mod_dep() {
  modprobe --show-depends "$@" 2>/dev/null | while read x y z; do
    if [ install = "$x" ]; then
      dump_install "$y $z"
    elif [ insmod = "$x" ]; then
      echo $y
    fi
  done | sort -u
}

dump_install() {
  set -- `echo "$1"`
  while [ $# -gt 0 ]; do
    case "$1" in
      modprobe|*/modprobe)
        shift
        while [ "x${1#-}" != "x$1" -a $# -gt 0 ]; do
          shift
        done
        if [ $# -gt 0 -a "${printed_modules#*#$1#}" = "${printed_modules}" ]; then
          printed_modules="${printed_modules}#$1#"
          mod_dep --ignore-install "$1"
        fi
        ;;
    esac
    shift
  done
}

Matt Zimmerman (mdz)
Changed in initramfs-tools:
assignee: nobody → adconrad
Revision history for this message
bojohan (bojohan+launchpad) wrote :
Adam Conrad (adconrad)
Changed in initramfs-tools:
assignee: adconrad → nobody
Revision history for this message
Carlos Diener / emonkey (emonkey) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in it recently. We were wondering is this still an issue for you? Can you try with latest Ubuntu release? Thanks in advance.

Changed in initramfs-tools:
status: New → Incomplete
Changed in initramfs-tools:
status: Unknown → Fix Released
Revision history for this message
Thomas J. Moore (dark-mama) wrote : Re: [Bug 31318] Re: MODULES=dep does not handle modprobe install directives

On 10/18/08 03:58, Carlos Diener / emonkey wrote:
> Thank you for taking the time to report this bug and helping to make
> Ubuntu better. You reported this bug a while ago and there hasn't been
> any activity in it recently. We were wondering is this still an issue
> for you? Can you try with latest Ubuntu release? Thanks in advance.

It's been over 2 years. I don't care any more. I'm not the package
"maintainer", so I don't feel the need to work on this any more.

Revision history for this message
Pablo Castellano (pablocastellano) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!

Changed in initramfs-tools:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.