Blame 0022-build-initramfs-unclear-_mpargs-in-instmods.patch

Harald Hoyer 55891e
From f4ca564ba67d5821b756727689664604e76d1cdf Mon Sep 17 00:00:00 2001
Harald Hoyer 55891e
From: John Reiser <jreiser@bitwagon.com>
Harald Hoyer 55891e
Date: Mon, 29 Aug 2011 14:42:15 -0700
Harald Hoyer 55891e
Subject: [PATCH] build initramfs: unclear _mpargs in instmods()
Harald Hoyer 55891e
Harald Hoyer 55891e
The local variable _mpargs in function instmods() in file dracut-functions
Harald Hoyer 55891e
looks peculiar.  The documentation is non-existent, but still ...
Harald Hoyer 55891e
Harald Hoyer 55891e
First, $_mpargs is not passed to modprobe via for_each_kmod_dep.
Harald Hoyer 55891e
This is strange because my guess is that "_mpargs" means
Harald Hoyer 55891e
"extra arguments for modprobe".
Harald Hoyer 55891e
Harald Hoyer 55891e
Second, the leading "--" will be lopped when a leading pathname
Harald Hoyer 55891e
is stripped via
Harald Hoyer 55891e
	_mod=${_mod##*/}
Harald Hoyer 55891e
It seems to me that a leading "--" should inhibit modification.
Harald Hoyer 55891e
Harald Hoyer 55891e
Here's the corresponding patch to current HEAD (from dracut-013.)
Harald Hoyer 55891e
---
Harald Hoyer 55891e
 dracut-functions |    3 +--
Harald Hoyer 55891e
 1 files changed, 1 insertions(+), 2 deletions(-)
Harald Hoyer 55891e
Harald Hoyer 55891e
diff --git a/dracut-functions b/dracut-functions
Harald Hoyer 55891e
index a3340e4..c28766e 100755
Harald Hoyer 55891e
--- a/dracut-functions
Harald Hoyer 55891e
+++ b/dracut-functions
Harald Hoyer 55891e
@@ -919,7 +919,6 @@ instmods() {
Harald Hoyer 55891e
                 fi
Harald Hoyer 55891e
                 ;;
Harald Hoyer 55891e
             --*)
Harald Hoyer 55891e
-                _mod=${_mod##*/}
Harald Hoyer 55891e
                 _mpargs+=" $_mod";;
Harald Hoyer 55891e
             i2o_scsi) shift; continue;; # Do not load this diagnostic-only module
Harald Hoyer 55891e
             *)  _mod=${_mod##*/}
Harald Hoyer 55891e
@@ -942,7 +941,7 @@ instmods() {
Harald Hoyer 55891e
                 # ok, load the module, all its dependencies, and any firmware
Harald Hoyer 55891e
                 # it may require
Harald Hoyer 55891e
                 for_each_kmod_dep install_kmod_with_fw $_mod \
Harald Hoyer 55891e
-                    --set-version $kernel ${_moddirname}
Harald Hoyer 55891e
+                    --set-version $kernel ${_moddirname} $_mpargs
Harald Hoyer 55891e
                 ((_ret+=$?))
Harald Hoyer 55891e
                 ;;
Harald Hoyer 55891e
         esac