From: Victor Lowther Date: Fri, 5 Jun 2009 02:35:31 +0000 (-0500) Subject: Make debugging much more useful. X-Git-Tag: 0.1~105^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c36ce3347920a7cbfc38fe7cce8bf15055b64580;p=thirdparty%2Fdracut.git Make debugging much more useful. Since we are explicitly using bash, we can have nice, useful value for PS4 --- diff --git a/dracut b/dracut index d9b77413e..16eae1a44 100755 --- 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"