]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Make debugging much more useful.
authorVictor Lowther <victor.lowther@gmail.com>
Fri, 5 Jun 2009 02:35:31 +0000 (21:35 -0500)
committerVictor Lowther <victor.lowther@gmail.com>
Fri, 5 Jun 2009 03:01:34 +0000 (22:01 -0500)
Since we are explicitly using bash, we can have nice, useful value for PS4

dracut

diff --git a/dracut b/dracut
index d9b77413ef7cc2349034c011aa4ce1fce4bd5358..16eae1a44b757341c0230ef440419c05bf9c6757 100755 (executable)
--- a/dracut
+++ b/dracut
@@ -47,7 +47,7 @@ while (($# > 0)); do
        -o|--omit) omit_dracutmodules_l="$2"; shift;;
        -d|--drivers) drivers_l="$2"; shift;;
        -h|--help) usage; exit 1 ;;
-       --debug) debug="yes"; set -x;;
+       --debug) debug="yes";;
        -v|--verbose) beverbose="yes";;
        -c|--conf) conffile="$2"; shift;;
        -l|--local) allowlocal="yes" ;;
@@ -59,6 +59,11 @@ while (($# > 0)); do
     shift
 done
 
+[[ $debug ]] && { 
+    export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
+    set -x
+}
+
 # if we were not passed a config file, try the default one
 [[ ! -f $conffile ]] && conffile="/etc/dracut.conf"