diff mbox series

[v2,12/14] selftests/nolibc: add tinyconfig target

Message ID 6c58b9bec8fdf593d5dd1d5ba55aabddb0ce02d1.1689759351.git.falcon@tinylab.org (mailing list archive)
State New
Headers show
Series selftests/nolibc: add minimal kernel config support - part1 | expand

Commit Message

Zhangjin Wu July 19, 2023, 1:30 p.m. UTC
The original tinyconfig target only enables minimal kernel config
options, it can speed up the kernel build and nolibc test a lot and also
brings us with smaller kernel image size.

But the default enabled options are not enough for qemu boot and console
print, some additional config options should be added for every
architecture individually.

Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
---
 tools/testing/selftests/nolibc/Makefile | 3 +++
 1 file changed, 3 insertions(+)

Comments

Willy Tarreau July 22, 2023, 1:07 p.m. UTC | #1
On Wed, Jul 19, 2023 at 09:30:30PM +0800, Zhangjin Wu wrote:
> The original tinyconfig target only enables minimal kernel config
> options, it can speed up the kernel build and nolibc test a lot and also
> brings us with smaller kernel image size.
> 
> But the default enabled options are not enough for qemu boot and console
> print, some additional config options should be added for every
> architecture individually.
> 
> Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
> ---
>  tools/testing/selftests/nolibc/Makefile | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
> index eec2935672ad..f42782fa78a9 100644
> --- a/tools/testing/selftests/nolibc/Makefile
> +++ b/tools/testing/selftests/nolibc/Makefile
> @@ -218,6 +218,9 @@ mrproper:
>  defconfig:
>  	$(Q)$(MAKE_KERNEL) $(DEFCONFIG) prepare
>  
> +tinyconfig:
> +	$(Q)$(MAKE_KERNEL) tinyconfig prepare

So for the same reasons as defconfig above, I'd actually keep mrproper
here. And if we figure that tinyconfig is never called by the user
directly but as a dependency from the makefile itself or scripts,
then we likely don't even need to create a visible entry for it.

Willy
Zhangjin Wu July 25, 2023, 3:13 p.m. UTC | #2
> On Wed, Jul 19, 2023 at 09:30:30PM +0800, Zhangjin Wu wrote:
> > The original tinyconfig target only enables minimal kernel config
> > options, it can speed up the kernel build and nolibc test a lot and also
> > brings us with smaller kernel image size.
> > 
> > But the default enabled options are not enough for qemu boot and console
> > print, some additional config options should be added for every
> > architecture individually.
> > 
> > Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
> > ---
> >  tools/testing/selftests/nolibc/Makefile | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
> > index eec2935672ad..f42782fa78a9 100644
> > --- a/tools/testing/selftests/nolibc/Makefile
> > +++ b/tools/testing/selftests/nolibc/Makefile
> > @@ -218,6 +218,9 @@ mrproper:
> >  defconfig:
> >  	$(Q)$(MAKE_KERNEL) $(DEFCONFIG) prepare
> >  
> > +tinyconfig:
> > +	$(Q)$(MAKE_KERNEL) tinyconfig prepare
> 
> So for the same reasons as defconfig above, I'd actually keep mrproper
> here.

Ok, let's add mrproper back here, since tinyconfig is fast enough, so, a
mrproper is not that time cost and a cleanup is really good prepare.

> And if we figure that tinyconfig is never called by the user
> directly but as a dependency from the makefile itself or scripts,
> then we likely don't even need to create a visible entry for it.
>

Great idea,

At first, tinyconfig can be triggered by something like:

    $ make run defconfig DEFCONFIG=tinyconfig

Perhaps we can let $(KERNEL_CONFIG) depends on the top-level
'tinyconfig' and trigger it by default:

    $(KERNEL_CONFIG):
	$(Q)if [ ! -f "$(KERNEL_CONFIG)" ]; then $(MAKE_KERNEL) --no-print-directory mrproper tinyconfig prepare; fi

Of course, we should triger the extra config above.

But this change must delay after we add tinyconfig support for all of
the nolibc supported architectures. before that, we should use
'defconfig' as we do currently.

So, it may be ok for us to drop this patch, but we also need to update
some commit messages who uses tinyconfig target directly.

Thanks,
Zhangjin

> Willy
diff mbox series

Patch

diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index eec2935672ad..f42782fa78a9 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -218,6 +218,9 @@  mrproper:
 defconfig:
 	$(Q)$(MAKE_KERNEL) $(DEFCONFIG) prepare
 
+tinyconfig:
+	$(Q)$(MAKE_KERNEL) tinyconfig prepare
+
 PHONY += $(KERNEL_CONFIG)
 $(KERNEL_CONFIG):
 	$(Q)if [ ! -f "$(KERNEL_CONFIG)" ]; then $(MAKE) --no-print-directory defconfig; fi