SVN: geninitrd/trunk/geninitrd

arekm arekm at pld-linux.org
Fri Jan 4 21:33:36 CET 2013


Author: arekm
Date: Fri Jan  4 21:33:36 2013
New Revision: 12612

Modified:
   geninitrd/trunk/geninitrd
Log:
libcrc32c (kernel 3.8+) needs some crc32 library but it doesn't depend on it directly (since there are different implementations like crc32c-intel or crc32c generic). Simulate dependency for now.

Modified: geninitrd/trunk/geninitrd
==============================================================================
--- geninitrd/trunk/geninitrd	(original)
+++ geninitrd/trunk/geninitrd	Fri Jan  4 21:33:36 2013
@@ -332,6 +332,15 @@
 	/lib/geninitrd/extract-ikconfig /boot/vmlinuz-$kernel
 }
 
+# @param    $module
+basename_module() {
+	local module=$1
+
+	module=${module##*/}
+	module=${module%$modext*}
+	echo $module
+}
+
 # Finds module dependencies
 #
 # @param	$module
@@ -366,9 +375,23 @@
 		warn "If $module isn't compiled in kernel then this initrd may not start your system."
 	fi
 
+	local smodule
+
 	echo "$modprobe" | \
 	while read insmod modpath options; do
-		[ "$insmod" = "insmod" ] && echo $modpath
+		if [ "$insmod" = "insmod" ]; then
+
+			# XXX: find a away to autodetect
+			smodule=$(basename_module $modpath)
+			case "$smodule" in
+				libcrc32c)
+					find_depmod "-crc32c-intel"
+					find_depmod "-crc32c"
+					;;
+			esac
+
+			echo $modpath
+		fi
 	done
 	return 0
 }


More information about the pld-cvs-commit mailing list