Bug#676439: buggy manual_add_modules hook function

2012-06-06 Thread Jamie Heilman
Package: initramfs-tools
Version: 0.104

The change to manual_add_modules() to always call modprobe --all
--set-version=${version} --ignore-install --quiet --show-depends $@
ends up not working too well when $@ is empty  (Error: missing parameters.
See -h.)

In my case it happens because my kernels don't have any of the modules
from the hidden_dep_add_modules() function.  I'll leave it up to you
to decide if its better to never call manual_add_modules without
arguments, or make manual_add_modules a nop if it is.

-- 
Jamie Heilman http://audible.transient.net/~jamie/



-- 
To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/20120606221938.ga4...@cucamonga.audible.transient.net



Bug#676439: buggy manual_add_modules hook function

2012-06-06 Thread Josh Triplett
tags 676439 + confirmed patch
thanks

The attached patch fixes this bug.

- Josh Triplett
From d1c06cf84b918b6d9949a9b2915c77f529a72e3d Mon Sep 17 00:00:00 2001
From: Josh Triplett j...@joshtriplett.org
Date: Wed, 6 Jun 2012 16:39:01 -0700
Subject: [PATCH] initramfs-tools: Make manual_add_modules a no-op with no
 arguments

manual_add_modules can potentially get called with no arguments, such as
if all the modules hidden_dep_add_modules wants to add don't exist in
the target kernel.  Check for that case to avoid triggering an error by
calling modprobe with no arguments.

Closes: 676439
Signed-off-by: Josh Triplett j...@joshtriplett.org
---
 hook-functions |4 
 1 file changed, 4 insertions(+)

diff --git a/hook-functions b/hook-functions
index d9225c9..36d0250 100644
--- a/hook-functions
+++ b/hook-functions
@@ -45,6 +45,10 @@ manual_add_modules()
 {
 	local prefix kmod options firmware
 
+	if [ $# -eq 0 ]; then
+		return
+	fi
+
 	modprobe --all --set-version=${version} --ignore-install --quiet --show-depends $@ |
 	while read prefix kmod options ; do
 		if [ ${prefix} != insmod ]; then
-- 
1.7.10