]> git.pld-linux.org Git - projects/geninitrd.git/commitdiff
debuginitrd option in /proc/cmdline handled.
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Fri, 9 Mar 2007 14:34:49 +0000 (14:34 +0000)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Fri, 9 Mar 2007 14:34:49 +0000 (14:34 +0000)
svn-id: @8370

geninitrd

index 82c545541f8f68fb345b2d09857bc69edd70f98d..02e7b028a5f9510ec88acba51c293db2768eb9e6 100755 (executable)
--- a/geninitrd
+++ b/geninitrd
@@ -992,8 +992,12 @@ fi
 
 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 @@ initrd_gen_nfs() {
 [ "$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 @@ done
 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 @@ initrd_gen_lvm() {
                # 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 @@ if [ -n "$root" ]; then
        fi
 fi
 umount /proc
-set -x
 EOF
 }
 
@@ -1398,7 +1392,6 @@ END {
                partition, maj, min);
 }
 ' /proc/partitions)"
-set -x
 if [ ! -b $device ]; then
        mknod $device b $maj $min
 fi
This page took 0.150047 seconds and 4 git commands to generate.