From: Yosry Ahmed <yosry.ahmed@linux.dev>
To: Shuah Khan <skhan@linuxfoundation.org>
Cc: Shuah Khan <shuah@kernel.org>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests/run_kselftest.sh: Use readlink if realpath is not available
Date: Tue, 6 May 2025 09:19:48 +0000 [thread overview]
Message-ID: <aBnUNFPz6buIdV-W@google.com> (raw)
In-Reply-To: <4424b86b-b80d-4fdc-ba56-5cea5dc0b9a4@linuxfoundation.org>
On Fri, Mar 28, 2025 at 02:05:43PM -0600, Shuah Khan wrote:
> On 3/18/25 10:05, Yosry Ahmed wrote:
> > 'realpath' is not always available, fallback to 'readlink -f' if is not
> > available. They seem to work equally well in this context.
>
> Can you add more specifics on "realpath" is not always available,"
>
> No issues with the patch itself. I would like to know the cases
> where "realpath" command is missing.
I think I already responded but I can't find my response, anyway:
Not all distros have realpath. In my case, it was an internal distro we
use on some test machines, so I can't really share much details about
it.
Are there any other questions that I can help answer about this patch?
>
>
> >
> > Signed-off-by: Yosry Ahmed <yosry.ahmed@linux.dev>
> > ---
> > tools/testing/selftests/run_kselftest.sh | 9 ++++++++-
> > 1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/testing/selftests/run_kselftest.sh b/tools/testing/selftests/run_kselftest.sh
> > index 50e03eefe7ac7..0443beacf3621 100755
> > --- a/tools/testing/selftests/run_kselftest.sh
> > +++ b/tools/testing/selftests/run_kselftest.sh
> > @@ -3,7 +3,14 @@
> > #
> > # Run installed kselftest tests.
> > #
> > -BASE_DIR=$(realpath $(dirname $0))
> > +
> > +# 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
> > +
> > cd $BASE_DIR
> > TESTS="$BASE_DIR"/kselftest-list.txt
> > if [ ! -r "$TESTS" ] ; then
>
> thanks,
> -- Shuah
>
prev parent reply other threads:[~2025-05-06 9:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-18 16:05 [PATCH] selftests/run_kselftest.sh: Use readlink if realpath is not available Yosry Ahmed
2025-03-28 20:05 ` Shuah Khan
2025-03-29 19:48 ` Yosry Ahmed
2025-05-06 9:19 ` Yosry Ahmed [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aBnUNFPz6buIdV-W@google.com \
--to=yosry.ahmed@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.