diff mbox series

[Unstable/Lunar] UBUNTU: [Packaging] scripts/misc/kernelconfig: Disable config checks for mainline builds

Message ID 20230118072307.96973-1-juerg.haefliger@canonical.com
State New
Headers show
Series [Unstable/Lunar] UBUNTU: [Packaging] scripts/misc/kernelconfig: Disable config checks for mainline builds | expand

Commit Message

Juerg Haefliger Jan. 18, 2023, 7:23 a.m. UTC
For mainline builds, all checks need to be disabled since failures can't
be tolerated/handled. For that, do_skip_checks is set to 'true' but the
new kernelconfig script doesn't honor that. Fix it.

While at it, add a header comment listing all supported environment
variables.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
---
 debian/rules.d/1-maintainer.mk   |  3 ++-
 debian/scripts/misc/kernelconfig | 46 +++++++++++++++++++++-----------
 2 files changed, 32 insertions(+), 17 deletions(-)

Comments

Andrea Righi Jan. 18, 2023, 8:22 a.m. UTC | #1
On Wed, Jan 18, 2023 at 08:23:07AM +0100, Juerg Haefliger wrote:
> For mainline builds, all checks need to be disabled since failures can't
> be tolerated/handled. For that, do_skip_checks is set to 'true' but the
> new kernelconfig script doesn't honor that. Fix it.
> 
> While at it, add a header comment listing all supported environment
> variables.
> 
> Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>

Makes sense to me. Applied to lunar/linux and lunar/linux-unstable.

Thanks,
-Andrea
diff mbox series

Patch

diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk
index 4d327ec3c478..a58004893dd1 100644
--- a/debian/rules.d/1-maintainer.mk
+++ b/debian/rules.d/1-maintainer.mk
@@ -48,7 +48,8 @@  $(configs-targets):
 	if [ -e "$(DEBIAN)/config/config.common.ubuntu" ]; then \
 		conc_level=$(conc_level) $(SHELL) $(DROOT)/scripts/misc/old-kernelconfig $@; \
 	else \
-		conc_level=$(conc_level) $(SHELL) $(DROOT)/scripts/misc/kernelconfig $@; \
+		skip_checks=$(do_skip_checks) conc_level=$(conc_level) \
+			$(SHELL) $(DROOT)/scripts/misc/kernelconfig $@; \
 	fi;
 	rm -rf build
 
diff --git a/debian/scripts/misc/kernelconfig b/debian/scripts/misc/kernelconfig
index 0c412af2ec8e..b4b08ad83d29 100755
--- a/debian/scripts/misc/kernelconfig
+++ b/debian/scripts/misc/kernelconfig
@@ -1,4 +1,12 @@ 
 #!/bin/bash -u
+#
+# Manage kernel config annotations
+#
+# Supported environment variales:
+#   conc_level  : Concurrency level for upstream make (-jX)
+#   skip_checks : Skip config checks if set to 'true'
+#   gcc         : Default gcc to use (mandatory)
+#
 
 function cleanup()
 {
@@ -104,25 +112,31 @@  EOF
 	mv build/.config "${tmp_conf_file}"
 done
 
-echo
-echo "Running config-check for all configurations ..."
-fail=0
-for arch_flavour in ${FLAVOURS} ; do
-	arch=${arch_flavour%%-*}
-	flavour=${arch_flavour#*-}
-	tmp_conf_file=${TMP_DIR}/${arch}-config.flavour.${flavour}
+rc=0
 
+if [ "${skip_checks:-}" = "true" ] ; then
 	echo
-	echo "* Run config-check for ${arch}-${flavour} ..."
-	python3 debian/scripts/misc/annotations -f "${annotations_file}" \
-			--arch "${arch}" --flavour "${flavour}" --check "${tmp_conf_file}" || \
-		fail=$((fail + 1))
-done
+	echo "Skipping config-check (skip_checks=${skip_checks}) ..."
+else
+	echo
+	echo "Running config-check for all configurations ..."
+	fail=0
+	for arch_flavour in ${FLAVOURS} ; do
+		arch=${arch_flavour%%-*}
+		flavour=${arch_flavour#*-}
+		tmp_conf_file=${TMP_DIR}/${arch}-config.flavour.${flavour}
 
-rc=0
-if [ ${fail} -gt 0 ] ; then
-	rc=1
-	echo "ERROR: ${fail} config-check failures detected" >&2
+		echo
+		echo "* Run config-check for ${arch}-${flavour} ..."
+		python3 debian/scripts/misc/annotations -f "${annotations_file}" \
+				--arch "${arch}" --flavour "${flavour}" --check "${tmp_conf_file}" || \
+			fail=$((fail + 1))
+	done
+
+	if [ ${fail} -gt 0 ] ; then
+		rc=1
+		echo "ERROR: ${fail} config-check failures detected" >&2
+	fi
 fi
 
 if [ ${#warning_partial[@]} -gt 0 ] ; then