From patchwork Wed Jan 8 12:34:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13930844 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 382021F893B; Wed, 8 Jan 2025 12:34:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736339687; cv=none; b=EkT4Z6Ivk6cZjdsPfFgBsEMd2Pf2kuqxEuMtGetgwCSEuDSei5MCwPePHWNueEdQULsmF9fm3uoTk+NkqVL/36Bfdy3YzzpmiPim5MQy7jcOo9jx7Pl93tJCoIWPXfzFX6rgjyMq+7gE+S/ga5476MA0ums48oIqhFOqmoZiuuk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736339687; c=relaxed/simple; bh=j66gD95If1V7rLlG4SXXf7QqhU5PkFrIZZE9CHa3Bn0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=u9WQP8Z6BbskZ2yKz0bQjjbFIec51Cp/jZ8x3A9t9FDad2hxNEEs5wbEYXju3p7uiCYyxaCPPT5yiA/A+9KXXGxfSv4EZ8rrCWVTFtxG53YWDxV4p6HXC1VfVbgsW0Pt1GrCBukiBMOI5wDiOkZQzW0Hxp0a0D5rcfHfXLOd1po= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=AeAqOg11; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=9N6+Y2qf; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="AeAqOg11"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="9N6+Y2qf" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1736339684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zG/VKkeXbPRVyyZufxWVimpdiaJHj3WpHkAHreHDIAA=; b=AeAqOg11j+mWHQnUeep4+g+6kXaSvetgtIKKL1ANGRy1mQ8cpK6rlcmnsKDashmtpYN161 r6ynlmBEGPuIdMxhFEYWTFAcgRGW6Tkd5PNCYx5KJv2fVJfLmpwlc/xks9iffh8AgfWfl5 KheHZOnohJxC+Y5gSFV/TvP4bQeBemmh1eHy6pbsZn1UTvajjkRsugPvle95peQgpQRlGe 9I7RW4sH5+vl/sx3IrYY8RBFJO2UXZFN3WVv8iY02L6nSQnBnNZHHY154xKD7XpGnZuUT2 FxnhaDv6uJ+E5uUOTDzsgrC3hwTvs0noX+6mA5+uNIsODm2lx6vZVk33fPKSgw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1736339684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zG/VKkeXbPRVyyZufxWVimpdiaJHj3WpHkAHreHDIAA=; b=9N6+Y2qfVndcU3gpijOnWxa6RIX8v9hjoJnNSvQZKLfZUcM4kps/8g2W39CgzVirEC9tWt S3Xn+S/AURa5MtAQ== Date: Wed, 08 Jan 2025 13:34:28 +0100 Subject: [PATCH 1/2] MAINTAINERS: Add kconfig utility scripts Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250108-diffconfig-validate-v1-1-4b3d8ee489da@linutronix.de> References: <20250108-diffconfig-validate-v1-0-4b3d8ee489da@linutronix.de> In-Reply-To: <20250108-diffconfig-validate-v1-0-4b3d8ee489da@linutronix.de> To: Masahiro Yamada Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, =?utf-8?q?Th?= =?utf-8?q?omas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1736339682; l=890; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=j66gD95If1V7rLlG4SXXf7QqhU5PkFrIZZE9CHa3Bn0=; b=uIcd0GpuHSixW45HfDXjQW12IXBorBp7xPEq1UI5fek4Ba7lT/q/umbEWNEHPefXCzZa9iVKP ehYhREStp4ACB0KZqN47RtRWHaKbSMso3QvxEcogpWXVU/YjheIiZRJ X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= There are various utilities in scripts/ which work with kconfig files. These have currently no maintainer. As most patches for them are applied through kconfig/kbuild anyways, add an explicit maintainership entry. Signed-off-by: Thomas Weißschuh Reviewed-by: Nicolas Schier --- MAINTAINERS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 30cbc3d44cd53e6b1a81d56161004d7ab825d7a9..2bd414fb3e6d6515b57a57a5f3d4d735137edcce 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12385,6 +12385,9 @@ Q: https://patchwork.kernel.org/project/linux-kbuild/list/ T: git git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kbuild F: Documentation/kbuild/kconfig* F: scripts/Kconfig.include +F: scripts/checkkconfigsymbols.py +F: scripts/config +F: scripts/diffconfig F: scripts/kconfig/ KCOV From patchwork Wed Jan 8 12:34:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13930845 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC27D1F8AD3; Wed, 8 Jan 2025 12:34:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736339688; cv=none; b=gCII4AbQaTgK4d5+xEOtSe9ai1bG398Wi1OjDAr3Tsu68MW7uuboVf3PrG1HQSyQtSED+u5x5E3qxBVMIRynv7aqcH/l5bEq0oKBNxvz0QHAHTHE6WyrcQb8j2cZ3faIF2UtGSyBhf+UT/YOuE1he1wPRAd9EmF5NmY9AUOnm9U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736339688; c=relaxed/simple; bh=mfRXr8X6hivXNLW5/+JavOgTmHO5jVioJNhZARGBpyQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IIbQ7j/1ySi8E8YgTG7f4JuiWB9tL/2e82Vtknij74gYTPXPvcNLjPH+dcwVFYDad8LXQJ8NxQq8AvRD01O3fuIlfx/wHzzOwD1vmmIKRjdda2UViq2Ynw/bghpI3+serzOhKrOx8P3hM27z5mADSUEaY70OpuIM2ejilXOHIEY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=lXv3FJ6n; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=J1guJe8x; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="lXv3FJ6n"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="J1guJe8x" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1736339685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i/p4ELp2/ZQmNrcsyqgwATapI6kF52rb6hc0Ubjr/Ss=; b=lXv3FJ6nUJRL/cAQwYGVEaHJcAhLhkLOm5mfKM7+qInIpVWMdQtiCuERDssFvUfO2DXNbw ILC6nQVgjTY6y9k9PhFnMIsd+1JsHkwSS+SdPv2M5TnDNiEWyBgPtxj4vM4/lvb1WLbz4y c0bjJEzCNv/wWHuirA4Idy1u2Lp1DRqZMul/G/VyQ3RRwfANTFFvSNoRYRA77r23Gy6f/q sK0skwHOpvOeQc8JwGPCONWHb6JMscWwxREE+MCWacJ2xYAtMPr4mBIbvuuUanUo19hZ8f ULq3G0hgPu45i3M1seh3IOFifhC4g/CsNx6/G1nUE8lqvDTf2N7J+Xg4IDnlJg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1736339685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i/p4ELp2/ZQmNrcsyqgwATapI6kF52rb6hc0Ubjr/Ss=; b=J1guJe8xouSvY/ETMM6e2El5iuQ0BV2qygAi6IVyz/cguP8MuyWd8ANRLOZr2u3N9F3wbI Uoi2GbUiswPpgaCg== Date: Wed, 08 Jan 2025 13:34:29 +0100 Subject: [PATCH 2/2] diffconfig: add verification mode Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250108-diffconfig-validate-v1-2-4b3d8ee489da@linutronix.de> References: <20250108-diffconfig-validate-v1-0-4b3d8ee489da@linutronix.de> In-Reply-To: <20250108-diffconfig-validate-v1-0-4b3d8ee489da@linutronix.de> To: Masahiro Yamada Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, =?utf-8?q?Th?= =?utf-8?q?omas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1736339682; l=2426; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=mfRXr8X6hivXNLW5/+JavOgTmHO5jVioJNhZARGBpyQ=; b=b8mG9u6Xs1Xky0fkxtSVpI5EzRWpUCk3B3hvtSdwkEP4J2R/tbhguCiiEyb6gG/lqIIEEpHF2 ZQvHYv8YRsBAwUyOchueNmeRvrB+/VrKEhD+uV4gF9nVL8D8tROiwuJ X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= When creating kconfig files from defconfig files or snippets some items from the reference config may be silently omitted when dependency constraints are not met. Manual validation is necessary to make sure that the expected items are present in the new configuration. As the constraints can change over time, this validation has to be repeated. Extend the diffconfig script with a validation mode that can be used to perform those validation easily and in an automated manner. Signed-off-by: Thomas Weißschuh Reviewed-by: Nicolas Schier --- scripts/diffconfig | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/scripts/diffconfig b/scripts/diffconfig index 43f0f3d273ae7178086f03038780ba103fd9970b..95cb0282f6db2873ef32804d361ef6db8a7bc8ce 100755 --- a/scripts/diffconfig +++ b/scripts/diffconfig @@ -24,6 +24,10 @@ Changed items show the old and new values on a single line. If -m is specified, then output will be in "merge" style, which has the changed and new values in kernel config option format. +If -v is specified, then diffconfig will validate that config2 is a superset of +of config1. Only items from config1 not in config2 are printed. +If items are missing from config2 diffconfig will exit with code 2. + If no config files are specified, .config and .config.old are used. Example usage: @@ -77,6 +81,11 @@ def show_diff(): merge_style = 1 sys.argv.remove("-m") + validate = 0 + if "-v" in sys.argv: + validate = 1 + sys.argv.remove("-v") + argc = len(sys.argv) if not (argc==1 or argc == 3): print("Error: incorrect number of arguments or unrecognized option") @@ -123,11 +132,15 @@ def show_diff(): print_config("->", config, a[config], b[config]) del b[config] - # now print items in b but not in a - # (items from b that were in a were removed above) - new = sorted(b.keys()) - for config in new: - print_config("+", config, None, b[config]) + if not validate: + # now print items in b but not in a + # (items from b that were in a were removed above) + new = sorted(b.keys()) + for config in new: + print_config("+", config, None, b[config]) + + if validate and (old or changed): + sys.exit(2) def main(): try: