SVN: geninitrd/trunk: geninitrd mod-ide.sh mod-scsi.sh

glen glen at pld-linux.org
Thu Jan 5 20:43:33 CET 2012


Author: glen
Date: Thu Jan  5 20:43:32 2012
New Revision: 12458

Modified:
   geninitrd/trunk/geninitrd
   geninitrd/trunk/mod-ide.sh
   geninitrd/trunk/mod-scsi.sh
Log:
filter out comments in modprobe_conf_cache rather in some places of code to get 100% accuracy

Modified: geninitrd/trunk/geninitrd
==============================================================================
--- geninitrd/trunk/geninitrd	(original)
+++ geninitrd/trunk/geninitrd	Thu Jan  5 20:43:32 2012
@@ -478,10 +478,11 @@
 
 	if [ -n "$modulefile" ]; then
 		debug "Using $modulefile for modules config"
-		modprobe_conf_cache=$(cat $modulefile)
+		modprobe_conf_cache=$(cat $modulefile | awk '!/^[\t ]*#/ { print }')
+
 	else
 		debug "Using modprobe -c to get modules config"
-		modprobe_conf_cache=$(modprobe -c --set-version $kernel)
+		modprobe_conf_cache=$(modprobe -c --set-version $kernel | awk '!/^[\t ]*#/ { print }')
 	fi
 }
 
@@ -566,7 +567,7 @@
 	if [[ "$devpath" == /dev/ataraid/* ]]; then
 		find_modules_ide
 		find_module "ataraid"
-		ataraidmodules=$(modprobe_conf | awk '/ataraid_hostadapter/ && ! /^[\t ]*#/ { print $3; }')
+		ataraidmodules=$(modprobe_conf | awk '/ataraid_hostadapter/ { print $3 }')
 		if [ -n "$ataraidmodules" ]; then
 			# FIXME: think about modules compiled in kernel
 			die "ataraid_hostadapter alias not defined in modprobe.conf! Please set it and run $PROGRAM again."

Modified: geninitrd/trunk/mod-ide.sh
==============================================================================
--- geninitrd/trunk/mod-ide.sh	(original)
+++ geninitrd/trunk/mod-ide.sh	Thu Jan  5 20:43:32 2012
@@ -51,9 +51,9 @@
 		for n in $PREIDEMODS; do
 			if [ "X$n" = "Xunknown" ]; then
 				debug "Finding IDE modules using ide_hostadapter"
-				local mod idemodules=$(modprobe_conf | awk '/ide_hostadapter/ && ! /^[\t ]*#/ { print $3; }')
+				local mod idemodules=$(modprobe_conf | awk '/ide_hostadapter/ { print $3 }')
 				for mod in $idemodules; do
-					tryauto=0;
+					tryauto=0
 					find_module "$mod"
 				done
 

Modified: geninitrd/trunk/mod-scsi.sh
==============================================================================
--- geninitrd/trunk/mod-scsi.sh	(original)
+++ geninitrd/trunk/mod-scsi.sh	Thu Jan  5 20:43:32 2012
@@ -40,7 +40,7 @@
 	for n in $PRESCSIMODS; do
 		if [ "X$n" = "Xunknown" ]; then
 			debug "Finding SCSI modules using scsi_hostadapter"
-			local mod scsimodules=$(modprobe_conf | awk '/scsi_hostadapter/ && ! /^[\t ]*#/ { print $3; }')
+			local mod scsimodules=$(modprobe_conf | awk '/scsi_hostadapter/ { print $3 }')
 			for mod in $scsimodules; do
 				# for now allow scsi modules to come from anywhere. There are some
 				# RAID controllers with drivers in block


More information about the pld-cvs-commit mailing list