problem with kernel cmdline

Waldemar Brodkorb fai at waldemar-brodkorb.de
Wed Apr 21 19:42:24 CEST 2010


Hi,

when using following kernel command line to finetune some
NFS options:
append initrd=initrd.img-2.6.32-21-generic ip=dhcp NFSOPTS="-o
nolock,ro,wsize=2048,rsize=2048" root=/dev/nfs
nfsroot=/srv/fai/nfsroot boot=live FAI_FLAGS=verbose,sshd,createvt
FAI_ACTION=install

The function eval_cmdline will fail. Attached patch from 
Thorsten Glaser <tg at debian.org> fixed it for me.

May be something for 3.4?

bye
 Waldemar


-------------- next part --------------
Index: lib/subroutines
===================================================================
--- lib/subroutines	(revision 5773)
+++ lib/subroutines	(working copy)
@@ -633,18 +633,22 @@
     echo -n "Kernel currently running: "
     uname -rsmo
     echo -n "Kernel parameters: "; cat /proc/cmdline
-    for word in $(cat /proc/cmdline) ; do
-	case $word in
-	    FAI_CLASSES=*)
-                eval "$word"
-		for class in ${FAI_CLASSES//,/ }; do
-		    echo $class >>/tmp/l
-		done
+    eval "cmdline=($(</proc/cmdline))"
+    echo "Kernel parameters: ${cmdline[*]}"
+    for word in "${cmdline[@]}"; do
+        case $word in
+            FAI_CLASSES=*)
+		word=${word#*=}
+		eval "classes=(${word//,/ })"
+		printf '%s\n' "${classes[@]}" >>/tmp/l
 		unset FAI_CLASSES
 		;;
 
 	    [a-zA-Z]*=*)
-		eval "export $word"
+		varname=${word%%=*}
+		word=${word#*=}
+		eval $varname=\$word
+		eval export $varname
 		;;
 	esac
     done


More information about the linux-fai-devel mailing list