* [PATCH v2 1/5] selftests/nolibc: drop custom EXTRACONFIG functionality
2025-01-23 7:37 [PATCH v2 0/5] selftests/nolibc: test kernel configuration cleanups Thomas Weißschuh
@ 2025-01-23 7:37 ` Thomas Weißschuh
2025-02-01 10:13 ` Willy Tarreau
2025-01-23 7:37 ` [PATCH v2 2/5] selftests/nolibc: drop call to prepare target Thomas Weißschuh
` (3 subsequent siblings)
4 siblings, 1 reply; 13+ messages in thread
From: Thomas Weißschuh @ 2025-01-23 7:37 UTC (permalink / raw)
To: Willy Tarreau, Shuah Khan
Cc: linux-kselftest, linux-kernel, Thomas Weißschuh
kbuild already contains logic to merge predefines snippets into a
defconfig file. This already works nicely with the current "defconfig"
target. Make use of the snippet and drop the custom logic.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
tools/testing/selftests/nolibc/Makefile | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index 7d14a7c0cb62608f328b251495264517d333db2e..ba044c8a042ce345ff90bdd35569de4b5acd117d 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -82,7 +82,7 @@ DEFCONFIG_x86 = defconfig
DEFCONFIG_arm64 = defconfig
DEFCONFIG_arm = multi_v7_defconfig
DEFCONFIG_mips32le = malta_defconfig
-DEFCONFIG_mips32be = malta_defconfig
+DEFCONFIG_mips32be = malta_defconfig generic/eb.config
DEFCONFIG_ppc = pmac32_defconfig
DEFCONFIG_ppc64 = powernv_be_defconfig
DEFCONFIG_ppc64le = powernv_defconfig
@@ -93,9 +93,6 @@ DEFCONFIG_s390 = defconfig
DEFCONFIG_loongarch = defconfig
DEFCONFIG = $(DEFCONFIG_$(XARCH))
-EXTRACONFIG_mips32be = -d CONFIG_CPU_LITTLE_ENDIAN -e CONFIG_CPU_BIG_ENDIAN
-EXTRACONFIG = $(EXTRACONFIG_$(XARCH))
-
# optional tests to run (default = all)
TEST =
@@ -265,10 +262,6 @@ initramfs: nolibc-test
defconfig:
$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) mrproper $(DEFCONFIG) prepare
- $(Q)if [ -n "$(EXTRACONFIG)" ]; then \
- $(srctree)/scripts/config --file $(objtree)/.config $(EXTRACONFIG); \
- $(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) olddefconfig < /dev/null; \
- fi
kernel:
$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) $(IMAGE_NAME) < /dev/null
--
2.48.1
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH v2 1/5] selftests/nolibc: drop custom EXTRACONFIG functionality
2025-01-23 7:37 ` [PATCH v2 1/5] selftests/nolibc: drop custom EXTRACONFIG functionality Thomas Weißschuh
@ 2025-02-01 10:13 ` Willy Tarreau
2025-02-01 10:17 ` Thomas Weißschuh
0 siblings, 1 reply; 13+ messages in thread
From: Willy Tarreau @ 2025-02-01 10:13 UTC (permalink / raw)
To: Thomas Weißschuh; +Cc: Shuah Khan, linux-kselftest, linux-kernel
On Thu, Jan 23, 2025 at 08:37:37AM +0100, Thomas Weißschuh wrote:
> kbuild already contains logic to merge predefines snippets into a
> defconfig file. This already works nicely with the current "defconfig"
> target. Make use of the snippet and drop the custom logic.
>
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
> tools/testing/selftests/nolibc/Makefile | 9 +--------
> 1 file changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
> index 7d14a7c0cb62608f328b251495264517d333db2e..ba044c8a042ce345ff90bdd35569de4b5acd117d 100644
> --- a/tools/testing/selftests/nolibc/Makefile
> +++ b/tools/testing/selftests/nolibc/Makefile
> @@ -82,7 +82,7 @@ DEFCONFIG_x86 = defconfig
> DEFCONFIG_arm64 = defconfig
> DEFCONFIG_arm = multi_v7_defconfig
> DEFCONFIG_mips32le = malta_defconfig
> -DEFCONFIG_mips32be = malta_defconfig
> +DEFCONFIG_mips32be = malta_defconfig generic/eb.config
> DEFCONFIG_ppc = pmac32_defconfig
> DEFCONFIG_ppc64 = powernv_be_defconfig
> DEFCONFIG_ppc64le = powernv_defconfig
> @@ -93,9 +93,6 @@ DEFCONFIG_s390 = defconfig
> DEFCONFIG_loongarch = defconfig
> DEFCONFIG = $(DEFCONFIG_$(XARCH))
>
> -EXTRACONFIG_mips32be = -d CONFIG_CPU_LITTLE_ENDIAN -e CONFIG_CPU_BIG_ENDIAN
> -EXTRACONFIG = $(EXTRACONFIG_$(XARCH))
> -
> # optional tests to run (default = all)
> TEST =
>
> @@ -265,10 +262,6 @@ initramfs: nolibc-test
>
> defconfig:
> $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) mrproper $(DEFCONFIG) prepare
> - $(Q)if [ -n "$(EXTRACONFIG)" ]; then \
> - $(srctree)/scripts/config --file $(objtree)/.config $(EXTRACONFIG); \
> - $(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) olddefconfig < /dev/null; \
> - fi
OK it's no longer needed thanks to your change above, but to we really
want to get rid of that feature allowing anyone to add their own extra
config ? I'm not sure. For example maybe the current build script helps
on bare metal, when trying to add support for new archs or other features
not yet in defconfig ? We could leave EXTRACONFIG_* empty by default and
user-defined, as I don't feel like it blocks anything to keep it.
Just my two cents,
Willy
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/5] selftests/nolibc: drop custom EXTRACONFIG functionality
2025-02-01 10:13 ` Willy Tarreau
@ 2025-02-01 10:17 ` Thomas Weißschuh
2025-02-01 10:20 ` Willy Tarreau
0 siblings, 1 reply; 13+ messages in thread
From: Thomas Weißschuh @ 2025-02-01 10:17 UTC (permalink / raw)
To: Willy Tarreau; +Cc: Shuah Khan, linux-kselftest, linux-kernel
On 2025-02-01 11:13:05+0100, Willy Tarreau wrote:
> On Thu, Jan 23, 2025 at 08:37:37AM +0100, Thomas Weißschuh wrote:
> > kbuild already contains logic to merge predefines snippets into a
> > defconfig file. This already works nicely with the current "defconfig"
> > target. Make use of the snippet and drop the custom logic.
> >
> > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> > ---
> > tools/testing/selftests/nolibc/Makefile | 9 +--------
> > 1 file changed, 1 insertion(+), 8 deletions(-)
> >
> > diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
> > index 7d14a7c0cb62608f328b251495264517d333db2e..ba044c8a042ce345ff90bdd35569de4b5acd117d 100644
> > --- a/tools/testing/selftests/nolibc/Makefile
> > +++ b/tools/testing/selftests/nolibc/Makefile
> > @@ -82,7 +82,7 @@ DEFCONFIG_x86 = defconfig
> > DEFCONFIG_arm64 = defconfig
> > DEFCONFIG_arm = multi_v7_defconfig
> > DEFCONFIG_mips32le = malta_defconfig
> > -DEFCONFIG_mips32be = malta_defconfig
> > +DEFCONFIG_mips32be = malta_defconfig generic/eb.config
> > DEFCONFIG_ppc = pmac32_defconfig
> > DEFCONFIG_ppc64 = powernv_be_defconfig
> > DEFCONFIG_ppc64le = powernv_defconfig
> > @@ -93,9 +93,6 @@ DEFCONFIG_s390 = defconfig
> > DEFCONFIG_loongarch = defconfig
> > DEFCONFIG = $(DEFCONFIG_$(XARCH))
> >
> > -EXTRACONFIG_mips32be = -d CONFIG_CPU_LITTLE_ENDIAN -e CONFIG_CPU_BIG_ENDIAN
> > -EXTRACONFIG = $(EXTRACONFIG_$(XARCH))
> > -
> > # optional tests to run (default = all)
> > TEST =
> >
> > @@ -265,10 +262,6 @@ initramfs: nolibc-test
> >
> > defconfig:
> > $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) mrproper $(DEFCONFIG) prepare
> > - $(Q)if [ -n "$(EXTRACONFIG)" ]; then \
> > - $(srctree)/scripts/config --file $(objtree)/.config $(EXTRACONFIG); \
> > - $(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) olddefconfig < /dev/null; \
> > - fi
>
> OK it's no longer needed thanks to your change above, but to we really
> want to get rid of that feature allowing anyone to add their own extra
> config ? I'm not sure. For example maybe the current build script helps
> on bare metal, when trying to add support for new archs or other features
> not yet in defconfig ? We could leave EXTRACONFIG_* empty by default and
> user-defined, as I don't feel like it blocks anything to keep it.
Makes sense, let's keep it.
It's currently not possible for kbuild to pick up config snippets
outside of a few special locations.
I'll fix this up locally and apply the series directly.
Thomas
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/5] selftests/nolibc: drop custom EXTRACONFIG functionality
2025-02-01 10:17 ` Thomas Weißschuh
@ 2025-02-01 10:20 ` Willy Tarreau
0 siblings, 0 replies; 13+ messages in thread
From: Willy Tarreau @ 2025-02-01 10:20 UTC (permalink / raw)
To: Thomas Weißschuh; +Cc: Shuah Khan, linux-kselftest, linux-kernel
On Sat, Feb 01, 2025 at 11:17:28AM +0100, Thomas Weißschuh wrote:
> On 2025-02-01 11:13:05+0100, Willy Tarreau wrote:
> > On Thu, Jan 23, 2025 at 08:37:37AM +0100, Thomas Weißschuh wrote:
> > > kbuild already contains logic to merge predefines snippets into a
> > > defconfig file. This already works nicely with the current "defconfig"
> > > target. Make use of the snippet and drop the custom logic.
> > >
> > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> > > ---
> > > tools/testing/selftests/nolibc/Makefile | 9 +--------
> > > 1 file changed, 1 insertion(+), 8 deletions(-)
> > >
> > > diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
> > > index 7d14a7c0cb62608f328b251495264517d333db2e..ba044c8a042ce345ff90bdd35569de4b5acd117d 100644
> > > --- a/tools/testing/selftests/nolibc/Makefile
> > > +++ b/tools/testing/selftests/nolibc/Makefile
> > > @@ -82,7 +82,7 @@ DEFCONFIG_x86 = defconfig
> > > DEFCONFIG_arm64 = defconfig
> > > DEFCONFIG_arm = multi_v7_defconfig
> > > DEFCONFIG_mips32le = malta_defconfig
> > > -DEFCONFIG_mips32be = malta_defconfig
> > > +DEFCONFIG_mips32be = malta_defconfig generic/eb.config
> > > DEFCONFIG_ppc = pmac32_defconfig
> > > DEFCONFIG_ppc64 = powernv_be_defconfig
> > > DEFCONFIG_ppc64le = powernv_defconfig
> > > @@ -93,9 +93,6 @@ DEFCONFIG_s390 = defconfig
> > > DEFCONFIG_loongarch = defconfig
> > > DEFCONFIG = $(DEFCONFIG_$(XARCH))
> > >
> > > -EXTRACONFIG_mips32be = -d CONFIG_CPU_LITTLE_ENDIAN -e CONFIG_CPU_BIG_ENDIAN
> > > -EXTRACONFIG = $(EXTRACONFIG_$(XARCH))
> > > -
> > > # optional tests to run (default = all)
> > > TEST =
> > >
> > > @@ -265,10 +262,6 @@ initramfs: nolibc-test
> > >
> > > defconfig:
> > > $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) mrproper $(DEFCONFIG) prepare
> > > - $(Q)if [ -n "$(EXTRACONFIG)" ]; then \
> > > - $(srctree)/scripts/config --file $(objtree)/.config $(EXTRACONFIG); \
> > > - $(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) olddefconfig < /dev/null; \
> > > - fi
> >
> > OK it's no longer needed thanks to your change above, but to we really
> > want to get rid of that feature allowing anyone to add their own extra
> > config ? I'm not sure. For example maybe the current build script helps
> > on bare metal, when trying to add support for new archs or other features
> > not yet in defconfig ? We could leave EXTRACONFIG_* empty by default and
> > user-defined, as I don't feel like it blocks anything to keep it.
>
> Makes sense, let's keep it.
> It's currently not possible for kbuild to pick up config snippets
> outside of a few special locations.
Yes but when facing difficulties, users can be creative (e.g. inject
semi-colon and commands in EXTRACONFIG ;-)).
> I'll fix this up locally and apply the series directly.
Thank you!
Willy
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 2/5] selftests/nolibc: drop call to prepare target
2025-01-23 7:37 [PATCH v2 0/5] selftests/nolibc: test kernel configuration cleanups Thomas Weißschuh
2025-01-23 7:37 ` [PATCH v2 1/5] selftests/nolibc: drop custom EXTRACONFIG functionality Thomas Weißschuh
@ 2025-01-23 7:37 ` Thomas Weißschuh
2025-02-01 10:03 ` Willy Tarreau
2025-01-23 7:37 ` [PATCH v2 3/5] selftests/nolibc: drop call to mrproper target Thomas Weißschuh
` (2 subsequent siblings)
4 siblings, 1 reply; 13+ messages in thread
From: Thomas Weißschuh @ 2025-01-23 7:37 UTC (permalink / raw)
To: Willy Tarreau, Shuah Khan
Cc: linux-kselftest, linux-kernel, Thomas Weißschuh
The "prepare" target does not need to be run manually.
kbuild knows when to use it on its own and the target is not even
documented.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
tools/testing/selftests/nolibc/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index ba044c8a042ce345ff90bdd35569de4b5acd117d..464165e3d9175d283ec0ed14765df29427b6de38 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -261,7 +261,7 @@ initramfs: nolibc-test
$(Q)cp nolibc-test initramfs/init
defconfig:
- $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) mrproper $(DEFCONFIG) prepare
+ $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) mrproper $(DEFCONFIG)
kernel:
$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) $(IMAGE_NAME) < /dev/null
--
2.48.1
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH v2 2/5] selftests/nolibc: drop call to prepare target
2025-01-23 7:37 ` [PATCH v2 2/5] selftests/nolibc: drop call to prepare target Thomas Weißschuh
@ 2025-02-01 10:03 ` Willy Tarreau
0 siblings, 0 replies; 13+ messages in thread
From: Willy Tarreau @ 2025-02-01 10:03 UTC (permalink / raw)
To: Thomas Weißschuh; +Cc: Shuah Khan, linux-kselftest, linux-kernel
On Thu, Jan 23, 2025 at 08:37:38AM +0100, Thomas Weißschuh wrote:
> The "prepare" target does not need to be run manually.
> kbuild knows when to use it on its own and the target is not even
> documented.
>
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
> tools/testing/selftests/nolibc/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
> index ba044c8a042ce345ff90bdd35569de4b5acd117d..464165e3d9175d283ec0ed14765df29427b6de38 100644
> --- a/tools/testing/selftests/nolibc/Makefile
> +++ b/tools/testing/selftests/nolibc/Makefile
> @@ -261,7 +261,7 @@ initramfs: nolibc-test
> $(Q)cp nolibc-test initramfs/init
>
> defconfig:
> - $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) mrproper $(DEFCONFIG) prepare
> + $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) mrproper $(DEFCONFIG)
I'm pretty sure that in the past I had to manually do it for certain
rebuilds (out of the nolibc-test context), but I cannot say for sure
when, but I did definitely discover it when trying to fix some build
issues. It's very possible that the issues that it used to fix have
long been fixed and that it remained in fingers memory, so I'm fine
with dropping it and we'll see. If we ever discover we need to bring
it back, at least we'll explain why in a commit message this time.
Acked-by: Willy Tarreau <w@1wt.eu>
Willy
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 3/5] selftests/nolibc: drop call to mrproper target
2025-01-23 7:37 [PATCH v2 0/5] selftests/nolibc: test kernel configuration cleanups Thomas Weißschuh
2025-01-23 7:37 ` [PATCH v2 1/5] selftests/nolibc: drop custom EXTRACONFIG functionality Thomas Weißschuh
2025-01-23 7:37 ` [PATCH v2 2/5] selftests/nolibc: drop call to prepare target Thomas Weißschuh
@ 2025-01-23 7:37 ` Thomas Weißschuh
2025-02-01 10:07 ` Willy Tarreau
2025-01-23 7:37 ` [PATCH v2 4/5] selftests/nolibc: execute defconfig before other targets Thomas Weißschuh
2025-01-23 7:37 ` [PATCH v2 5/5] selftests/nolibc: always keep test kernel configuration up to date Thomas Weißschuh
4 siblings, 1 reply; 13+ messages in thread
From: Thomas Weißschuh @ 2025-01-23 7:37 UTC (permalink / raw)
To: Willy Tarreau, Shuah Khan
Cc: linux-kselftest, linux-kernel, Thomas Weißschuh
"mrproper" unnecessarily cleans a lot of files.
kbuild is smart enough to handle changed configurations,
so the cleanup is not necessary and only leads to excessive rebuilds.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
tools/testing/selftests/nolibc/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index 464165e3d9175d283ec0ed14765df29427b6de38..d3afb71b4c6b7fc51b89f034c826692e76122864 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -261,7 +261,7 @@ initramfs: nolibc-test
$(Q)cp nolibc-test initramfs/init
defconfig:
- $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) mrproper $(DEFCONFIG)
+ $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) $(DEFCONFIG)
kernel:
$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) $(IMAGE_NAME) < /dev/null
--
2.48.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v2 3/5] selftests/nolibc: drop call to mrproper target
2025-01-23 7:37 ` [PATCH v2 3/5] selftests/nolibc: drop call to mrproper target Thomas Weißschuh
@ 2025-02-01 10:07 ` Willy Tarreau
0 siblings, 0 replies; 13+ messages in thread
From: Willy Tarreau @ 2025-02-01 10:07 UTC (permalink / raw)
To: Thomas Weißschuh; +Cc: Shuah Khan, linux-kselftest, linux-kernel
On Thu, Jan 23, 2025 at 08:37:39AM +0100, Thomas Weißschuh wrote:
> "mrproper" unnecessarily cleans a lot of files.
> kbuild is smart enough to handle changed configurations,
> so the cleanup is not necessary and only leads to excessive rebuilds.
Generally for me the mrproper has been needed when switching between archs
or configs that leave generated files that pollute the build of others.
Also a typical case is during certain bisects. It has happened to me many
times to completely fail a bisect due to not cleaning everything. With
that said I agree that cleaning by default is painful and I also hate doing
that.
So maybe better get rid of it indeed, and leave it to the user to decide to
clean or not.
Acked-by: Willy Tarreau <w@1wt.eu>
Willy
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 4/5] selftests/nolibc: execute defconfig before other targets
2025-01-23 7:37 [PATCH v2 0/5] selftests/nolibc: test kernel configuration cleanups Thomas Weißschuh
` (2 preceding siblings ...)
2025-01-23 7:37 ` [PATCH v2 3/5] selftests/nolibc: drop call to mrproper target Thomas Weißschuh
@ 2025-01-23 7:37 ` Thomas Weißschuh
2025-02-01 10:09 ` Willy Tarreau
2025-01-23 7:37 ` [PATCH v2 5/5] selftests/nolibc: always keep test kernel configuration up to date Thomas Weißschuh
4 siblings, 1 reply; 13+ messages in thread
From: Thomas Weißschuh @ 2025-01-23 7:37 UTC (permalink / raw)
To: Willy Tarreau, Shuah Khan
Cc: linux-kselftest, linux-kernel, Thomas Weißschuh
Some targets use the test kernel configuration.
Executing defconfig in the same make invocation as those targets results
in errors as the configuration may be in an inconsistent state during
reconfiguration.
Avoid this by introducing ordering dependencies between the defconfig
and some other targets.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
tools/testing/selftests/nolibc/Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index d3afb71b4c6b7fc51b89f034c826692e76122864..b74fa74e5ce296f032bec76ce9b3f5a3debe2b40 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -217,7 +217,7 @@ all: run
sysroot: sysroot/$(ARCH)/include
-sysroot/$(ARCH)/include:
+sysroot/$(ARCH)/include: | defconfig
$(Q)rm -rf sysroot/$(ARCH) sysroot/sysroot
$(QUIET_MKDIR)mkdir -p sysroot
$(Q)$(MAKE) -C $(srctree) outputmakefile
@@ -263,10 +263,10 @@ initramfs: nolibc-test
defconfig:
$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) $(DEFCONFIG)
-kernel:
+kernel: | defconfig
$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) $(IMAGE_NAME) < /dev/null
-kernel-standalone: initramfs
+kernel-standalone: initramfs | defconfig
$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) $(IMAGE_NAME) CONFIG_INITRAMFS_SOURCE=$(CURDIR)/initramfs < /dev/null
# run the tests after building the kernel
--
2.48.1
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH v2 5/5] selftests/nolibc: always keep test kernel configuration up to date
2025-01-23 7:37 [PATCH v2 0/5] selftests/nolibc: test kernel configuration cleanups Thomas Weißschuh
` (3 preceding siblings ...)
2025-01-23 7:37 ` [PATCH v2 4/5] selftests/nolibc: execute defconfig before other targets Thomas Weißschuh
@ 2025-01-23 7:37 ` Thomas Weißschuh
2025-02-01 10:13 ` Willy Tarreau
4 siblings, 1 reply; 13+ messages in thread
From: Thomas Weißschuh @ 2025-01-23 7:37 UTC (permalink / raw)
To: Willy Tarreau, Shuah Khan
Cc: linux-kselftest, linux-kernel, Thomas Weißschuh
Avoid using a stale test kernel configuration by always synchronizing
it to the current source tree.
kbuild is smart enough to avoid spurious rebuilds.
Shuffle the code around a bit to keep all the commands with side-effects
together.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
tools/testing/selftests/nolibc/run-tests.sh | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/nolibc/run-tests.sh b/tools/testing/selftests/nolibc/run-tests.sh
index 9c5160c5388122deeeb59ecfced7633000d69b10..bc4e92b4f1b98278a0a72345a5cd67f1a429b6a2 100755
--- a/tools/testing/selftests/nolibc/run-tests.sh
+++ b/tools/testing/selftests/nolibc/run-tests.sh
@@ -157,10 +157,6 @@ test_arch() {
fi
MAKE=(make -j"${nproc}" XARCH="${arch}" CROSS_COMPILE="${cross_compile}" LLVM="${llvm}" O="${build_dir}")
- mkdir -p "$build_dir"
- if [ "$test_mode" = "system" ] && [ ! -f "${build_dir}/.config" ]; then
- swallow_output "${MAKE[@]}" defconfig
- fi
case "$test_mode" in
'system')
test_target=run
@@ -173,6 +169,9 @@ test_arch() {
exit 1
esac
printf '%-15s' "$arch:"
+
+ mkdir -p "$build_dir"
+ swallow_output "${MAKE[@]}" defconfig
swallow_output "${MAKE[@]}" CFLAGS_EXTRA="$CFLAGS_EXTRA" "$test_target" V=1
cp run.out run.out."${arch}"
"${MAKE[@]}" report | grep passed
--
2.48.1
^ permalink raw reply related [flat|nested] 13+ messages in thread