]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(dracut.sh): don't override path with foreign sysroot
authorZoltán Böszörményi <zboszor@pr.hu>
Sun, 7 Feb 2021 12:30:53 +0000 (13:30 +0100)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Tue, 9 Feb 2021 07:09:28 +0000 (07:09 +0000)
Don't override PATH with foreign sysroot and
trim the sysroot prefix from NPATH elements.

Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
dracut.sh

index ffaa53d5364ebf9e3c3250527d22e9ce2d8538ed..c6ff8369ca0358033e7b74f37636c3913d3d19ff 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -748,11 +748,12 @@ for i in $DRACUT_PATH; do
     if [ -L "$dracutsysrootdir$i" ]; then
         rl=$(readlink -f $dracutsysrootdir$i)
     fi
+    rl="${rl#$dracutsysrootdir}"
     if [[ "$NPATH" != *:$rl* ]] ; then
         NPATH+=":$rl"
     fi
 done
-export PATH="${NPATH#:}"
+[[ -z "$dracutsysrootdir" ]] && export PATH="${NPATH#:}"
 unset NPATH
 
 # these options add to the stuff in the config file