* [PATCH] selftests/kexec: fix test_kexec_jump build and ignore generated binary
@ 2025-06-24 20:14 Moon Hee Lee
2025-07-01 19:53 ` Shuah Khan
0 siblings, 1 reply; 3+ messages in thread
From: Moon Hee Lee @ 2025-06-24 20:14 UTC (permalink / raw)
To: shuah
Cc: dwmw, mingo, linux-kselftest, linux-kernel, linux-kernel-mentees,
Moon Hee Lee
The test_kexec_jump program builds correctly when invoked from the top-level
selftests/Makefile, which explicitly sets the OUTPUT variable. However,
building directly in tools/testing/selftests/kexec fails with:
make: *** No rule to make target '/test_kexec_jump', needed by 'test_kexec_jump.sh'. Stop.
This failure occurs because the Makefile rule relies on $(OUTPUT), which is
undefined in direct builds.
Fix this by listing test_kexec_jump in TEST_GEN_PROGS, the standard way to
declare generated test binaries in the kselftest framework. This ensures the
binary is built regardless of invocation context and properly removed by
make clean.
Also add the binary to .gitignore to avoid tracking it in version control.
Signed-off-by: Moon Hee Lee <moonhee.lee.ca@gmail.com>
---
tools/testing/selftests/kexec/.gitignore | 2 ++
tools/testing/selftests/kexec/Makefile | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
create mode 100644 tools/testing/selftests/kexec/.gitignore
diff --git a/tools/testing/selftests/kexec/.gitignore b/tools/testing/selftests/kexec/.gitignore
new file mode 100644
index 000000000000..5f3d9e089ae8
--- /dev/null
+++ b/tools/testing/selftests/kexec/.gitignore
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+test_kexec_jump
diff --git a/tools/testing/selftests/kexec/Makefile b/tools/testing/selftests/kexec/Makefile
index e3000ccb9a5d..874cfdd3b75b 100644
--- a/tools/testing/selftests/kexec/Makefile
+++ b/tools/testing/selftests/kexec/Makefile
@@ -12,7 +12,7 @@ include ../../../scripts/Makefile.arch
ifeq ($(IS_64_BIT)$(ARCH_PROCESSED),1x86)
TEST_PROGS += test_kexec_jump.sh
-test_kexec_jump.sh: $(OUTPUT)/test_kexec_jump
+TEST_GEN_PROGS := test_kexec_jump
endif
include ../lib.mk
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] selftests/kexec: fix test_kexec_jump build and ignore generated binary
2025-06-24 20:14 [PATCH] selftests/kexec: fix test_kexec_jump build and ignore generated binary Moon Hee Lee
@ 2025-07-01 19:53 ` Shuah Khan
2025-07-02 16:07 ` Moonhee Lee
0 siblings, 1 reply; 3+ messages in thread
From: Shuah Khan @ 2025-07-01 19:53 UTC (permalink / raw)
To: Moon Hee Lee, kexec
Cc: dwmw, mingo, linux-kselftest, linux-kernel, linux-kernel-mentees,
shuah, Shuah Khan
On 6/24/25 14:14, Moon Hee Lee wrote:
> The test_kexec_jump program builds correctly when invoked from the top-level
> selftests/Makefile, which explicitly sets the OUTPUT variable. However,
> building directly in tools/testing/selftests/kexec fails with:
>
> make: *** No rule to make target '/test_kexec_jump', needed by 'test_kexec_jump.sh'. Stop.
>
> This failure occurs because the Makefile rule relies on $(OUTPUT), which is
> undefined in direct builds.
>
> Fix this by listing test_kexec_jump in TEST_GEN_PROGS, the standard way to
> declare generated test binaries in the kselftest framework. This ensures the
> binary is built regardless of invocation context and properly removed by
> make clean.
The change looks good to me.
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
>
> Also add the binary to .gitignore to avoid tracking it in version control.
There is another patch that adds the executable to .gitignore
https://lore.kernel.org/r/20250623232549.3263273-1-dyudaken@gmail.com
I think you are missing kexec@lists.infradead.org - added it
>
> Signed-off-by: Moon Hee Lee <moonhee.lee.ca@gmail.com>
> ---
> tools/testing/selftests/kexec/.gitignore | 2 ++
> tools/testing/selftests/kexec/Makefile | 2 +-
> 2 files changed, 3 insertions(+), 1 deletion(-)
> create mode 100644 tools/testing/selftests/kexec/.gitignore
>
> diff --git a/tools/testing/selftests/kexec/.gitignore b/tools/testing/selftests/kexec/.gitignore
> new file mode 100644
> index 000000000000..5f3d9e089ae8
> --- /dev/null
> +++ b/tools/testing/selftests/kexec/.gitignore
> @@ -0,0 +1,2 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +test_kexec_jump
> diff --git a/tools/testing/selftests/kexec/Makefile b/tools/testing/selftests/kexec/Makefile
> index e3000ccb9a5d..874cfdd3b75b 100644
> --- a/tools/testing/selftests/kexec/Makefile
> +++ b/tools/testing/selftests/kexec/Makefile
> @@ -12,7 +12,7 @@ include ../../../scripts/Makefile.arch
>
> ifeq ($(IS_64_BIT)$(ARCH_PROCESSED),1x86)
> TEST_PROGS += test_kexec_jump.sh
> -test_kexec_jump.sh: $(OUTPUT)/test_kexec_jump
> +TEST_GEN_PROGS := test_kexec_jump
> endif
>
> include ../lib.mk
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] selftests/kexec: fix test_kexec_jump build and ignore generated binary
2025-07-01 19:53 ` Shuah Khan
@ 2025-07-02 16:07 ` Moonhee Lee
0 siblings, 0 replies; 3+ messages in thread
From: Moonhee Lee @ 2025-07-02 16:07 UTC (permalink / raw)
To: Shuah Khan
Cc: kexec, dwmw, mingo, linux-kselftest, linux-kernel,
linux-kernel-mentees, shuah
Hi Shuah,
On Tue, Jul 1, 2025 at 12:53 PM Shuah Khan <skhan@linuxfoundation.org> wrote:
> The change looks good to me.
>
> Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Thank you, Shuah. I'll carry your Acked-by tag in v2.
> There is another patch that adds the executable to .gitignore
> https://lore.kernel.org/r/20250623232549.3263273-1-dyudaken@gmail.com
>
I missed that patch. Thank you for pointing it out.
I'll drop this change in v2.
> I think you are missing kexec@lists.infradead.org - added it
Thanks, I’ll add kexec@lists.infradead.org manually in future patches since
get_maintainer.pl didn’t include it.
$ ./scripts/get_maintainer.pl --scm tools/testing/selftests/kexec
Shuah Khan <shuah@kernel.org> (maintainer:KERNEL SELFTEST FRAMEWORK)
David Woodhouse <dwmw@amazon.co.uk> (commit_signer:1/1=100%,authored:1/1=100%)
Ingo Molnar <mingo@kernel.org> (commit_signer:1/1=100%)
linux-kselftest@vger.kernel.org (open list:KERNEL SELFTEST FRAMEWORK)
linux-kernel@vger.kernel.org (open list)
git git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git
git git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Regards,
Moonhee
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-02 16:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-24 20:14 [PATCH] selftests/kexec: fix test_kexec_jump build and ignore generated binary Moon Hee Lee
2025-07-01 19:53 ` Shuah Khan
2025-07-02 16:07 ` Moonhee Lee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).