🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.kernel
Article #497

Re: [PATCH v1 04/10] kconfig: Introduce checkconfig target

#497
From: Nathan Chancellor
Date: Mon, 09 Nov 2026 01:10
76 lines
5725 bytes
On Sun, Nov 08, 2026 at 06:59:45PM +0000, Julian Braha wrote:
> On 11/6/26 09:19, Ahmed S. Darwish wrote:
> > Add a checkconfig target to validate the current kernel .config against a
> > set of rules.  Select the rules using a mandatory RULES= make variable.
> > 
> > Example usage:
> > 
> >    make RULES=preempt_rt checkconfig
> > 
> > Use the kconfig-checker to perform all sanity checks.
> > 
> > Document the new target at the 'make help' text.
> > 
> > Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
> > ---
> >  scripts/kconfig/Makefile | 23 +++++++++++++++++++++++
> >  1 file changed, 23 insertions(+)
> > 
> > diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
> > index 5baf1c44ffa2..d67a23730259 100644
> > --- a/scripts/kconfig/Makefile
> > +++ b/scripts/kconfig/Makefile
> > @@ -125,6 +125,26 @@ testconfig: $(obj)/conf
> >  	$(if $(findstring 1,$(KBUILD_VERBOSE)),--capture=no)
> >  clean-files += tests/.cache
> >  
> > +checkconfig := $(PYTHON3) -B $(srctree)/tools/kconfig-checker/check.py
> > +list_checkconfig_rules =						\
> > +	echo -n >&2 "Available RULES: ";				\
> > +	$(checkconfig) list-rules >&2;					\
> > +	echo >&2
> > +
> > +PHONY += checkconfig
> > +checkconfig:
> > +	$(Q)if [ -z "$(RULES)" ]; then					\
> > +		echo >&2 "Usage: make RULES=<profile> checkconfig";	\
> > +		$(list_checkconfig_rules);				\
> > +		exit 2;							\
> > +	fi
> > +	$(Q)if ! $(checkconfig) list-rules | grep -qw "$(RULES)"; then	\
> > +		echo >&2 "Unknown RULES profile = $(RULES)";		\
> > +		$(list_checkconfig_rules);				\
> > +		exit 2;							\
> > +	fi
> > +	$(Q)$(checkconfig) check -r "$(RULES)" -c "$(KCONFIG_CONFIG)"
> > +
> >  # Help text used by make help
> >  help:
> >  	@echo  'Configuration targets:'
> > @@ -154,6 +174,9 @@ help:
> >  	@echo  '                    default value without prompting'
> >  	@echo  '  tinyconfig	  - Configure the tiniest possible kernel'
> >  	@echo  '  testconfig	  - Run Kconfig unit tests (requires python3 and pytest)'
> > +	@echo  '  checkconfig	  - Check current config against sanity rules specified by RULES'
> > +	@echo  '                    Example usage: "make RULES=preempt_rt checkconfig"'
> > +	@echo  '                    (requires python3, PyYAML, and jsonschema)'
> >  	@echo  ''
> >  	@echo  'Configuration topic targets:'
> >  	@$(foreach f, $(all-config-fragments), \
> > -- 2.56.0
> > 
> 
> I think this tool may belong in scripts/ due to the kbuild integration,
> as was mentioned in the past on another tool review:
> 
> https://lore.kernel.org/linux-kbuild/20260428183101.GA3304253@ax162/

Yeah, while I would prefer for the script to live in scripts/ due to
being called from Kbuild, I am not sure if the rules/schemas belong
there? It might be better to keep everything in tools/ for that reason,
especially if this may be called externally, but I am open to other
thoughts.

-- 
Cheers,
Nathan
Technical Details
Message-ID: <NXm3v-aILv-3@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news.szaf.org!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
References: <NWoK5-aaez-7@gated-at.bofh.it> <NWoK5-aaez-5@gated-at.bofh.it> <NXm3v-aILv-5@gated-at.bofh.it>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news.szaf.org!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Nathan Chancellor <nathan@kernel.org>
Newsgroups: linux.debian.kernel,linux.kernel
Subject: Re: [PATCH v1 04/10] kconfig: Introduce checkconfig target
Date: Mon, 09 Nov 2026 02:10:01 +0100
Message-ID: <NXm3v-aILv-3@gated-at.bofh.it>
References: <NWoK5-aaez-7@gated-at.bofh.it> <NWoK5-aaez-5@gated-at.bofh.it> <NXm3v-aILv-5@gated-at.bofh.it>
X-Mailbox-Line: From debian-kernel-request@lists.debian.org  Mon Nov  9 01:03:24 2026
Old-Return-Path: <nathan@kernel.org>
X-Amavis-Spam-Status: No, score=-0.901 tagged_above=-10000 required=5.3
 tests=[BAYES_00=-2, CC_TOO_MANY=3, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MONEY=0.5,
 MURPHY_SCAM1=0.1, RCVD_IN_DNSWL_MED=-2.3] autolearn=no autolearn_force=no
X-Policyd-Weight: using cached result; rate:hard: -5.5
X-Greylist: delayed 478 seconds by postgrey-1.37 at bendel; Mon, 09 Nov 2026 00:45:53 UTC
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-Mailing-List: <debian-kernel@lists.debian.org> archive/latest/158147
List-ID: <debian-kernel.lists.debian.org>
List-URL: <https://lists.debian.org/debian-kernel/>
List-Archive: https://lists.debian.org/msgid-search/20261109003909.GB3429615@ax162
Approved: robomod@news.nic.it
Lines: 76
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Cc: "Ahmed S. Darwish" <darwi@linutronix.de>,
	Clark Williams <clrkwllms@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>, Nicolas Schier <nsc@kernel.org>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Frederic Weisbecker <frederic@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jonathan Corbet <corbet@lwn.net>,
	John Ogness <john.ogness@linutronix.de>,
	Derek Barbosa <debarbos@redhat.com>,
	Zbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>,
	Daan De Meyer <daan.j.demeyer@gmail.com>,
	Luca Boccassi <luca.boccassi@gmail.com>,
	linux-rt-devel@lists.linux.dev, debian-kernel@lists.debian.org,
	linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
X-Original-Date: Sun, 8 Nov 2026 19:39:09 -0500
X-Original-Message-ID: <20261109003909.GB3429615@ax162>
X-Original-References: <20261106091922.7560-1-darwi@linutronix.de>
 <20261106091922.7560-5-darwi@linutronix.de>
 <3dd2bb0d-8486-4630-b496-e92e4ac37c29@gmail.com>