[PATCH 5/5] selftests/nolibc: generate config automatically

Thomas Weißschuh posted 5 patches 2 years, 2 months ago
There is a newer version of this series
[PATCH 5/5] selftests/nolibc: generate config automatically
Posted by Thomas Weißschuh 2 years, 2 months ago
This new target generates a .config if none exists yet.

Also drop the defconfig target with its hidden call to 'mrproper' which
is fairly invasive.
If users want to overwrite their kernel existing kernel configuration
they can do so easily from the toplevel directory.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 tools/testing/selftests/nolibc/Makefile | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index 21e3f7da2ecf..5a3623680f1a 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -173,7 +173,7 @@ all: run
 
 sysroot: sysroot/$(ARCH)/include
 
-sysroot/$(ARCH)/include:
+sysroot/$(ARCH)/include: $(objtree)/.config
 	$(Q)rm -rf sysroot/$(ARCH) sysroot/sysroot
 	$(QUIET_MKDIR)mkdir -p sysroot
 	$(Q)$(MAKE) -C $(srctree) outputmakefile
@@ -216,13 +216,13 @@ initramfs: nolibc-test
 	$(call QUIET_INSTALL, initramfs/init)
 	$(Q)cp nolibc-test initramfs/init
 
-defconfig:
-	$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) mrproper $(DEFCONFIG) prepare
+$(objtree)/.config:
+	$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) $(DEFCONFIG)
 
-kernel:
+kernel: $(objtree)/.config
 	$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) $(IMAGE_NAME)
 
-kernel-standalone: initramfs
+kernel-standalone: $(objtree)/.config initramfs
 	$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) $(IMAGE_NAME) CONFIG_INITRAMFS_SOURCE=$(CURDIR)/initramfs
 
 # run the tests after building the kernel

-- 
2.42.0

Re: [PATCH 5/5] selftests/nolibc: generate config automatically
Posted by Willy Tarreau 2 years, 2 months ago
On Tue, Oct 10, 2023 at 02:34:00PM +0200, Thomas Weißschuh wrote:
> This new target generates a .config if none exists yet.
> 
> Also drop the defconfig target with its hidden call to 'mrproper' which
> is fairly invasive.
> If users want to overwrite their kernel existing kernel configuration
> they can do so easily from the toplevel directory.

Hmmm I'm not sure about that one, I pretty much remember seeing failing
arm64 builds when mrproper and prepare were missing.

I would argue that someone starting "make defconfig" does expect the
config to be dropped, hence mrproper to be called as well.

What specific issue did you face with it ? Maybe we can restrict it to
only a few cases ?

Willy
Re: [PATCH 5/5] selftests/nolibc: generate config automatically
Posted by Thomas Weißschuh 2 years, 2 months ago
Oct 22, 2023 11:37:05 Willy Tarreau <w@1wt.eu>:

> On Tue, Oct 10, 2023 at 02:34:00PM +0200, Thomas Weißschuh wrote:
>> This new target generates a .config if none exists yet.
>>
>> Also drop the defconfig target with its hidden call to 'mrproper' which
>> is fairly invasive.
>> If users want to overwrite their kernel existing kernel configuration
>> they can do so easily from the toplevel directory.
>
> Hmmm I'm not sure about that one, I pretty much remember seeing failing
> arm64 builds when mrproper and prepare were missing.
>
> I would argue that someone starting "make defconfig" does expect the
> config to be dropped, hence mrproper to be called as well.
>
> What specific issue did you face with it ? Maybe we can restrict it to
> only a few cases ?

It was mostly a quality improvement for my testscript, where the config was generated
automatically.

And then I dropped the combined defconfig target
because it seemed unnecessary.

Let's drop this patch.

Thomas