dracut.sh: add DRACUT_PATH

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
master
Harald Hoyer 2014-07-22 14:43:33 +02:00
parent ece72160ce
commit eab9b75c8a
1 changed files with 14 additions and 11 deletions

View File

@ -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