[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#676439: buggy manual_add_modules hook function



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 <josh@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 <josh@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


Reply to: