Author: arekm
Date: Fri Mar  9 15:34:49 2007
New Revision: 8370

Modified:
   geninitrd/trunk/geninitrd
Log:
debuginitrd option in /proc/cmdline handled.

Modified: geninitrd/trunk/geninitrd
==============================================================================
--- geninitrd/trunk/geninitrd   (original)
+++ geninitrd/trunk/geninitrd   Fri Mar  9 15:34:49 2007
@@ -992,8 +992,12 @@
 
 cat > "$s" <<EOF
 #! /bin/sh
-
-set -x
+mount -t proc none /proc"
+if [ "$(awk ' /debuginitrd/  { print "yes"; } ' /proc/cmdline)" = "yes" ]; then
+       export DEBUG=yes
+       set -x
+fi
+umount /proc
 EOF
 chmod 755 "$s"
 
@@ -1184,14 +1188,10 @@
 [ "$1" != "bound" ] && exit
 [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
 [ -n "$subnet" ] && NETMASK="netmask $subnet"
-set -x
 ifconfig $interface $ip $BROADCAST $NETMASK up
-set +x
 if [ -n "$router" ]; then
        for r in $router; do
-               set -x
                route add default gw $r dev $interface
-               set +x
        done
 fi
 
@@ -1206,15 +1206,11 @@
 umount /proc
 
 if [ -n "$rootpath" ]; then
-       set -x
        mount -n -t nfs -o ro,nolock,posix,tcp,wsize=8192,rsize=8192 $rootpath 
/newroot
-       set +x
 else
-       set +x
        echo "Missing rootpath in what DHCP server sent to us. Failing..."
        echo "All seen variables are listed below:"
        set
-       set -x
 fi
 EOF
        chmod 755 "$MNTIMAGE/bin/setdhcp"
@@ -1282,7 +1278,6 @@
                # disable noise from lvm accessing devices that aren't ready.
                printk=\$(cat /proc/sys/kernel/printk)
                echo 0 > /proc/sys/kernel/printk
-               set -x
 
                : 'Scanning for Volume Groups'
                LVM_SYSTEM_DIR=/tmp lvm vgscan --ignorelockingfailure 
2>/dev/null
@@ -1322,7 +1317,6 @@
        fi
 fi
 umount /proc
-set -x
 EOF
 }
 
@@ -1398,7 +1392,6 @@
                partition, maj, min);
 }
 ' /proc/partitions)"
-set -x
 if [ ! -b $device ]; then
        mknod $device b $maj $min
 fi
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to