🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.kernel
Article #944

[PATCH v2 10/11] kconfig: Introduce auditconfig target

#944
From: Ahmed S. Darwish
Date: Thu, 03 Dec 2026 23:10
61 lines
4327 bytes
Add an auditconfig target to check the current .config against a selected
kconfig-audit policy.  Accept an optional overlay through OVERLAY=.

Use kconfig-audit to perform all sanity checks.

List the target and its usage in make help.

Example usage:

   make POLICY=preempt_rt auditconfig

Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
---
 scripts/kconfig/Makefile | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 5baf1c44ffa2..b216761c534f 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -125,6 +125,28 @@ testconfig: $(obj)/conf
 	$(if $(findstring 1,$(KBUILD_VERBOSE)),--capture=no)
 clean-files += tests/.cache
 
+auditconfig := $(PYTHON3) -B $(srctree)/tools/kconfig-audit/audit.py
+auditconfig_overlay = $(if $(OVERLAY),-o "$(OVERLAY)")
+
+list_auditconfig_rules =						\
+	echo -n >&2 "Available POLICY: ";				\
+	$(auditconfig) list-policies >&2;				\
+	echo >&2
+
+PHONY += auditconfig
+auditconfig:
+	$(Q)if [ -z "$(POLICY)" ]; then					\
+		echo >&2 "Usage: make POLICY=<profile> [OVERLAY=<overlay>] auditconfig"; \
+		$(list_auditconfig_rules);				\
+		exit 2;							\
+	fi
+	$(Q)if ! $(auditconfig) list-policies | grep -qw "$(POLICY)"; then	\
+		echo >&2 "Unknown POLICY profile = $(POLICY)";		\
+		$(list_auditconfig_rules);				\
+		exit 2;							\
+	fi
+	$(Q)$(auditconfig) check -c "$(KCONFIG_CONFIG)" -p "$(POLICY)" $(auditconfig_overlay)
+
 # Help text used by make help
 help:
 	@echo  'Configuration targets:'
@@ -154,6 +176,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  '  auditconfig	  - Check current config against sanity rules specified by POLICY'
+	@echo  '                    Example usage: "make POLICY=preempt_rt auditconfig"'
+	@echo  '                    (requires python3, PyYAML, and jsonschema)'
 	@echo  ''
 	@echo  'Configuration topic targets:'
 	@$(foreach f, $(all-config-fragments), \
-- 
2.56.0
Technical Details
Message-ID: <O6o65-fPfD-17@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
References: <O6o65-fPfD-3@gated-at.bofh.it>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: "Ahmed S. Darwish" <darwi@linutronix.de>
Newsgroups: linux.debian.kernel,linux.kernel
Subject: [PATCH v2 10/11] kconfig: Introduce auditconfig target
Date: Fri, 04 Dec 2026 00:10:01 +0100
Message-ID: <O6o65-fPfD-17@gated-at.bofh.it>
References: <O6o65-fPfD-3@gated-at.bofh.it>
X-Mailbox-Line: From debian-kernel-request@lists.debian.org  Thu Dec  3 23:08:04 2026
Old-Return-Path: <darwi@linutronix.de>
X-Amavis-Spam-Status: No, score=-4.4 tagged_above=-10000 required=5.3
 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
 DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham autolearn_force=no
X-Policyd-Weight: using cached result; rate: -4.6
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Mailing-List: <debian-kernel@lists.debian.org> archive/latest/158721
List-ID: <debian-kernel.lists.debian.org>
List-URL: <https://lists.debian.org/debian-kernel/>
List-Archive: https://lists.debian.org/msgid-search/20261203224916.118064-11-darwi@linutronix.de
Approved: robomod@news.nic.it
Lines: 61
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Frederic Weisbecker <frederic@kernel.org>,
	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,
	"Ahmed S. Darwish" <darwi@linutronix.de>
X-Original-Date: Thu,  3 Dec 2026 23:49:11 +0100
X-Original-Message-ID: <20261203224916.118064-11-darwi@linutronix.de>
X-Original-References: <20261203224916.118064-1-darwi@linutronix.de>