-d, --drivers [LIST] Specify a space-separated list of kernel modules to
include in the initramfs
-h, --help This message
- -d, --debug Output debug information of the build process
+ --debug Output debug information of the build process
-v, --verbose Verbose output during the build process
-c, --conf [FILE] Specify configuration file to use.
Default: /etc/dracut.conf
-m|--modules) dracutmodules_l="$2"; shift;;
-d|--drivers) modules_l="$2"; shift;;
-h|--help) usage; exit 1 ;;
- -d|--debug) set -x;;
+ --debug) debug="yes"; set -x;;
-v|--verbose) beverbose="yes";;
-c|--conf) conffile="$2"; shift;;
-l|--local) allowlocal="yes" ;;
readonly initdir=$(mktemp -d -t initramfs.XXXXXX)
trap 'rm -rf "$initdir"' 0 # clean up after ourselves no matter how we die.
-export initdir hookdirs dsrc dracutmodules modules
+export initdir hookdirs dsrc dracutmodules modules debug
# Create some directory structure first
for d in bin sbin usr/bin usr/sbin usr/lib etc proc sys sysroot dev/pts; do
[[ -f $1 ]] || return 1
local line
read -r -n 80 line <"$1"
+ # If debug is set, clean unprintable chars to prevent messing up the term
+ [[ $debug ]] && line=$(echo -n "$line" | tr -c -d '[:print:][:space:]')
[[ $line =~ (#! *)(/[^ ]+).* ]] || return 1
inst "${BASH_REMATCH[2]}" && inst_simple "$@"
}