diff mbox series

[5/6] selftests/nolibc: extraconfig support

Message ID 20231105-nolibc-mips-be-v1-5-6c2ad3e50a1f@weissschuh.net (mailing list archive)
State New
Headers show
Series tools/nolibc: MIPS bugfixes and refactoring | expand

Commit Message

Thomas Weißschuh Nov. 5, 2023, 10:09 a.m. UTC
Allow some postprocessing of defconfig files.

Suggested-by: Zhangjin Wu <falcon@tinylab.org>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 tools/testing/selftests/nolibc/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Willy Tarreau Nov. 5, 2023, 10:35 a.m. UTC | #1
On Sun, Nov 05, 2023 at 11:09:59AM +0100, Thomas Weißschuh wrote:
> Allow some postprocessing of defconfig files.
> 
> Suggested-by: Zhangjin Wu <falcon@tinylab.org>
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
>  tools/testing/selftests/nolibc/Makefile | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
> index f8fea9fa0263..02c074e73a28 100644
> --- a/tools/testing/selftests/nolibc/Makefile
> +++ b/tools/testing/selftests/nolibc/Makefile
> @@ -81,6 +81,8 @@ DEFCONFIG_s390       = defconfig
>  DEFCONFIG_loongarch  = defconfig
>  DEFCONFIG            = $(DEFCONFIG_$(XARCH))
>  
> +EXTRACONFIG           = $(EXTRACONFIG_$(XARCH))
> +
>  # optional tests to run (default = all)
>  TEST =
>  
> @@ -227,6 +229,10 @@ 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) oldconfig < /dev/null; \

You should instead use "olddefconfig" for this. It reuses defconfig but
uses defaults for new questions. I've already experienced issues from
time to time using /dev/null with oldconfig as you did above, with a
process looping forever (probably on a non acceptable choice I guess),
and never met such issues anymore since I switched to olddefconfig
instead.

Willy
diff mbox series

Patch

diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index f8fea9fa0263..02c074e73a28 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -81,6 +81,8 @@  DEFCONFIG_s390       = defconfig
 DEFCONFIG_loongarch  = defconfig
 DEFCONFIG            = $(DEFCONFIG_$(XARCH))
 
+EXTRACONFIG           = $(EXTRACONFIG_$(XARCH))
+
 # optional tests to run (default = all)
 TEST =
 
@@ -227,6 +229,10 @@  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) oldconfig < /dev/null; \
+	fi
 
 kernel:
 	$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) $(IMAGE_NAME)