mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
selftests/run_kselftest.sh: Resolve BASE_DIR with pwd -P
run_kselftest.sh only needs to canonicalize the directory containing the script itself. Use shell-native path resolution for that by changing into the directory and calling pwd -P. This avoids depending on either realpath or readlink -f while still producing a physical absolute path for BASE_DIR. Signed-off-by: Ricardo B. Marlière <rbm@suse.com> Link: https://lore.kernel.org/r/20260320-selftests-fixes-v1-3-79144f76be01@suse.com Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
parent
dbb6153c13
commit
a82e076f4a
|
|
@ -4,12 +4,7 @@
|
|||
# Run installed kselftest tests.
|
||||
#
|
||||
|
||||
# Fallback to readlink if realpath is not available
|
||||
if which realpath > /dev/null; then
|
||||
BASE_DIR=$(realpath $(dirname $0))
|
||||
else
|
||||
BASE_DIR=$(readlink -f $(dirname $0))
|
||||
fi
|
||||
BASE_DIR=$(cd "$(dirname "$0")" && pwd -P)
|
||||
|
||||
cd $BASE_DIR
|
||||
TESTS="$BASE_DIR"/kselftest-list.txt
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user