Blame 0037-dracut.sh-remember-0-for-regenerate-all.patch

Harald Hoyer 0840a3
From e8f19bcf26304282301c7aa34dff10f51d5f6172 Mon Sep 17 00:00:00 2001
Harald Hoyer 0840a3
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 0840a3
Date: Thu, 9 Jul 2015 18:22:15 +0200
Harald Hoyer 0840a3
Subject: [PATCH] dracut.sh: remember $0 for --regenerate-all
Harald Hoyer 0840a3
Harald Hoyer 0840a3
---
Harald Hoyer 0840a3
 dracut.sh | 11 ++++++-----
Harald Hoyer 0840a3
 1 file changed, 6 insertions(+), 5 deletions(-)
Harald Hoyer 0840a3
Harald Hoyer 0840a3
diff --git a/dracut.sh b/dracut.sh
Harald Hoyer 0840a3
index 21d29bf..77da887 100755
Harald Hoyer 0840a3
--- a/dracut.sh
Harald Hoyer 0840a3
+++ b/dracut.sh
Harald Hoyer 0840a3
@@ -23,6 +23,7 @@
Harald Hoyer 0840a3
 
Harald Hoyer 0840a3
 # store for logging
Harald Hoyer 0840a3
 dracut_args=( "$@" )
Harald Hoyer 0840a3
+readonly dracut_cmd="$(readlink -f $0)"
Harald Hoyer 0840a3
 
Harald Hoyer 0840a3
 set -o pipefail
Harald Hoyer 0840a3
 
Harald Hoyer 0840a3
@@ -34,7 +35,7 @@ usage() {
Harald Hoyer 0840a3
 
Harald Hoyer 0840a3
 #                                                       80x25 linebreak here ^
Harald Hoyer 0840a3
     cat << EOF
Harald Hoyer 0840a3
-Usage: $0 [OPTION]... [<initramfs> [<kernel-version>]]
Harald Hoyer 0840a3
+Usage: $dracut_cmd [OPTION]... [<initramfs> [<kernel-version>]]
Harald Hoyer 0840a3
 
Harald Hoyer 0840a3
 Version: $DRACUT_VERSION
Harald Hoyer 0840a3
 
Harald Hoyer 0840a3
@@ -59,7 +60,7 @@ long_usage() {
Harald Hoyer 0840a3
 
Harald Hoyer 0840a3
 #                                                       80x25 linebreak here ^
Harald Hoyer 0840a3
     cat << EOF
Harald Hoyer 0840a3
-Usage: $0 [OPTION]... [<initramfs> [<kernel-version>]]
Harald Hoyer 0840a3
+Usage: $dracut_cmd [OPTION]... [<initramfs> [<kernel-version>]]
Harald Hoyer 0840a3
 
Harald Hoyer 0840a3
 Version: $DRACUT_VERSION
Harald Hoyer 0840a3
 
Harald Hoyer 0840a3
@@ -586,7 +587,7 @@ if [[ $regenerate_all == "yes" ]]; then
Harald Hoyer 0840a3
     cd /lib/modules
Harald Hoyer 0840a3
     for i in *; do
Harald Hoyer 0840a3
         [[ -f $i/modules.dep ]] || [[ -f $i/modules.dep.bin ]] || continue
Harald Hoyer 0840a3
-        dracut --kver="$i" "${dracut_args[@]}"
Harald Hoyer 0840a3
+        "$dracut_cmd" --kver="$i" "${dracut_args[@]}"
Harald Hoyer 0840a3
         ((ret+=$?))
Harald Hoyer 0840a3
     done
Harald Hoyer 0840a3
     exit $ret
Harald Hoyer 0840a3
@@ -814,7 +815,7 @@ if [[ -f $dracutbasedir/dracut-init.sh ]]; then
Harald Hoyer 0840a3
 else
Harald Hoyer 0840a3
     printf "%s\n" "dracut: Cannot find $dracutbasedir/dracut-init.sh." >&2
Harald Hoyer 0840a3
     printf "%s\n" "dracut: Are you running from a git checkout?" >&2
Harald Hoyer 0840a3
-    printf "%s\n" "dracut: Try passing -l as an argument to $0" >&2
Harald Hoyer 0840a3
+    printf "%s\n" "dracut: Try passing -l as an argument to $dracut_cmd" >&2
Harald Hoyer 0840a3
     exit 1
Harald Hoyer 0840a3
 fi
Harald Hoyer 0840a3
 
Harald Hoyer 0840a3
@@ -866,7 +867,7 @@ for ((i=0; i < ${#dracut_args[@]}; i++)); do
Harald Hoyer 0840a3
         #" keep vim happy
Harald Hoyer 0840a3
 done
Harald Hoyer 0840a3
 
Harald Hoyer 0840a3
-dinfo "Executing: $0 ${dracut_args[@]}"
Harald Hoyer 0840a3
+dinfo "Executing: $dracut_cmd ${dracut_args[@]}"
Harald Hoyer 0840a3
 
Harald Hoyer 0840a3
 [[ $do_list = yes ]] && {
Harald Hoyer 0840a3
     for mod in $dracutbasedir/modules.d/*; do