SVN: geninitrd/trunk/geninitrd

glen glen at pld-linux.org
Tue Oct 30 16:53:38 CET 2007


Author: glen
Date: Tue Oct 30 16:53:38 2007
New Revision: 8900

Modified:
   geninitrd/trunk/geninitrd
Log:
- really commit debuginitrd=sh functionality

Modified: geninitrd/trunk/geninitrd
==============================================================================
--- geninitrd/trunk/geninitrd	(original)
+++ geninitrd/trunk/geninitrd	Tue Oct 30 16:53:38 2007
@@ -1250,19 +1250,24 @@
 	#!/bin/sh
 	mount -t proc none /proc
 	export CMDLINE="$(cat /proc/cmdline)"
-	if [ "$(awk '/debuginitrd/ { print "yes" }' /proc/cmdline)" = "yes" ]; then
-		export DEBUGINITRD=yes
+	umount /proc
+
+	export DEBUGINITRD=$(echo "$CMDLINE" | awk '{ for (i=1; i<=NF; i++) { if ($i == "debuginitrd") { print "yes"; exit }; if ($i ~ /^debuginitrd=/) { gsub(/^debuginitrd=/, NIL, $i); print $i; exit; } } }')
+
+	# make debugshell() invoke subshell if $DEBUGINITRD=sh
+	if [ "$DEBUGINITRD" = "sh" ]; then
 		debugshell() {
-			: 'Entering debug shell. Type Ctrl-D to exit it.'
 			sh
 		}
-		set -x
 	else
 		debugshell() {
 			:
 		}
 	fi
-	umount /proc
+
+	if [ "$DEBUGINITRD" ]; then
+		set -x
+	fi
 EOF
 
 modules_add_linuxrc "$MODULES"


More information about the pld-cvs-commit mailing list