SVN: geninitrd/trunk/geninitrd

glen glen at pld-linux.org
Mon Nov 26 19:09:56 CET 2007


Author: glen
Date: Mon Nov 26 19:09:56 2007
New Revision: 9095

Modified:
   geninitrd/trunk/geninitrd
Log:
- reuse $CMDLINE

Modified: geninitrd/trunk/geninitrd
==============================================================================
--- geninitrd/trunk/geninitrd	(original)
+++ geninitrd/trunk/geninitrd	Mon Nov 26 19:09:56 2007
@@ -1022,16 +1022,25 @@
 	else
 		inst /usr/sbin/resume /bin/resume
 	fi
-	echo "resume" | add_linuxrc
+
+	add_linuxrc <<-'EOF'
+	resume
+	EOF
 }
 
 initrd_gen_tuxonice() {
 	mount_sys
 	add_linuxrc <<-'EOF'
-		if [ "$(echo "$CMDLINE" | awk ' /resume2=/  { print "yes"; } ' /proc/cmdline)" = "yes" ]; then
+		resume2=no
+		for arg in $CMDLINE; do
+			if [ "${arg##resume2=}" != "${arg}" ]; then
+				resume2=yes
+			fi
+		done
+		if [ "$resume2" = "yes" ]; then
 			[ -e /proc/suspend2/do_resume ] && echo > /proc/suspend2/do_resume
 			[ -e /sys/power/suspend2/do_resume ] && echo > /sys/power/suspend2/do_resume
-			[ -e /sys/power/tuxonice/do_resume ] && echo >  /sys/power/tuxonice/do_resume
+			[ -e /sys/power/tuxonice/do_resume ] && echo > /sys/power/tuxonice/do_resume
 		fi
 	EOF
 }
@@ -1455,7 +1464,7 @@
 initrd_gen_procdata() {
 	debug "Adding rootfs finding based on kernel cmdline root= option support."
 	add_linuxrc <<-'EOF'
-		root="$(busybox awk ' /root=\/dev\// { gsub(/.*root=\/dev\//,NIL,$0); gsub(/ .*/,NIL,$0); print $0; } ' /proc/cmdline)"
+		root="$(echo "$CMDLINE" | busybox awk ' /root=\/dev\// { gsub(/.*root=\/dev\//,NIL,$0); gsub(/ .*/,NIL,$0); print $0; } ')"
 		if [ -n "$root" ]; then
 			rootnr="$(busybox awk -v root="$root" ' { if ($4 == root) { print 256*$1+$2; } } ' /proc/partitions)"
 			if [ -n "$rootnr" ]; then


More information about the pld-cvs-commit mailing list