]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut.sh: add DRACUT_PATH
authorHarald Hoyer <harald@redhat.com>
Tue, 22 Jul 2014 12:43:33 +0000 (14:43 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 22 Jul 2014 13:09:02 +0000 (15:09 +0200)
DRACUT_PATH can now be used to specify the PATH used by dracut
to search for binaries instead of the default
/usr/sbin:/sbin:/usr/bin:/bin

This should be set in the distribution config file
/usr/lib/dracut/dracut.conf.d/01-dist.conf

dracut.sh

index 3e1bf443adc8df063c1969c1cd7d58b9d746c4ed..1844336f5b556c03fe47df621a71a8466c502881 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -626,21 +626,10 @@ if ! [[ $outfile ]]; then
     fi
 fi
 
-for i in /usr/sbin /sbin /usr/bin /bin; do
-    rl=$i
-    if [ -L "$i" ]; then
-        rl=$(readlink -f $i)
-    fi
-    if [[ "$NPATH" != *:$rl* ]] ; then
-        NPATH+=":$rl"
-    fi
-done
-export PATH="${NPATH#:}"
 unset LC_MESSAGES
 unset LC_CTYPE
 export LC_ALL=C
 export LANG=C
-unset NPATH
 unset LD_LIBRARY_PATH
 unset LD_PRELOAD
 unset GREP_OPTIONS
@@ -685,6 +674,20 @@ for f in $(dropindirs_sort ".conf" "$confdir" "$dracutbasedir/dracut.conf.d"); d
     [[ -e $f ]] && . "$f"
 done
 
+DRACUT_PATH=${DRACUT_PATH:-/usr/sbin /sbin /usr/bin /bin}
+
+for i in $DRACUT_PATH; do
+    rl=$i
+    if [ -L "$i" ]; then
+        rl=$(readlink -f $i)
+    fi
+    if [[ "$NPATH" != *:$rl* ]] ; then
+        NPATH+=":$rl"
+    fi
+done
+export PATH="${NPATH#:}"
+unset NPATH
+
 # these optins add to the stuff in the config file
 if (( ${#add_dracutmodules_l[@]} )); then
     while pop add_dracutmodules_l val; do