]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut: construct PATH with resolved symlinks
authorHarald Hoyer <harald@redhat.com>
Tue, 7 Feb 2012 16:11:58 +0000 (17:11 +0100)
committerHarald Hoyer <harald@redhat.com>
Tue, 7 Feb 2012 16:11:58 +0000 (17:11 +0100)
dracut

diff --git a/dracut b/dracut
index f74432e58d25996cf8961b800d9ea8b69e11dd7f..4b1859a4d87e8c70dc0a4e3c2c540222df8b7c36 100755 (executable)
--- a/dracut
+++ b/dracut
@@ -279,7 +279,13 @@ if ! [[ $kernel ]]; then
 fi
 [[ $outfile ]] || outfile="/boot/initramfs-$kernel.img"
 
-PATH=/sbin:/bin:/usr/sbin:/usr/bin
+for i in /usr/bin /bin /usr/sbin /sbin; do
+    rl=$i
+    if [ -L "$i" ]; then
+        rl=$(readlink -f $i)
+    fi
+    PATH="$PATH:$rl"
+done
 export PATH
 unset LD_LIBRARY_PATH
 unset GREP_OPTIONS