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

Bug#588770: [PATCH initramfs-tools 1/2] hook-functions: Clean up split between dep_add_modules and dep_add_modules_mount



Much of the code in dep_add_modules is unrelated to any particular mount
point and should only be run once.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 hook-functions | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/hook-functions b/hook-functions
index bbb4d7e..6790d76 100644
--- a/hook-functions
+++ b/hook-functions
@@ -318,7 +318,6 @@ add_loaded_modules()
 dep_add_modules_mount()
 {
 	local dir dev_node FSTYPE
-	local modules=
 
 	dir="$1"
 
@@ -400,9 +399,18 @@ dep_add_modules_mount()
 	fi
 
 	# Add filesystem
-	modules="$modules ${FSTYPE}"
+	manual_add_modules ${FSTYPE}
 
 	block_dev_mod_add "$dev_node"
+}
+
+dep_add_modules()
+{
+	local device
+	local modules=
+
+	dep_add_modules_mount /
+	dep_add_modules_mount /usr
 
 	# sys walk some important device classes
 	for class in gpio phy regulator rtc; do
@@ -462,12 +470,6 @@ dep_add_modules_mount()
 	manual_add_modules $modules
 }
 
-dep_add_modules()
-{
-	dep_add_modules_mount /
-	dep_add_modules_mount /usr
-}
-
 # The modules "most" classes added per default to the initramfs
 auto_add_modules()
 {

Attachment: signature.asc
Description: Digital signature


Reply to: