[Unstable/Lunar][PATCH 5/5] UBUNTU: [Packaging] checks/module-signature-check: Add 'skip_checks' argument

Juerg Haefliger juerg.haefliger at canonical.com
Wed Jan 11 08:58:39 UTC 2023


Add an optional 'skip_checks' argument to match the other checker scripts.
This is used for mainline builds to not fail a build even if the checker
script finds problems.

Signed-off-by: Juerg Haefliger <juerg.haefliger at canonical.com>
---
 debian/rules.d/4-checks.mk                   |  3 ++-
 debian/scripts/checks/module-signature-check | 27 +++++++++++++++-----
 2 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/debian/rules.d/4-checks.mk b/debian/rules.d/4-checks.mk
index 4afe42fa629f..791ba7a0a30a 100644
--- a/debian/rules.d/4-checks.mk
+++ b/debian/rules.d/4-checks.mk
@@ -15,7 +15,8 @@ module-signature-check-%: $(stampdir)/stamp-install-%
 	@echo Debug: $@
 	$(DROOT)/scripts/checks/module-signature-check "$*" \
 		"$(DROOT)/$(mods_pkg_name)-$*" \
-		"$(DROOT)/$(mods_extra_pkg_name)-$*"
+		"$(DROOT)/$(mods_extra_pkg_name)-$*" \
+		$(skip_checks)
 
 # Check the reptoline jmp/call functions against the last release.
 retpoline-check-%: $(stampdir)/stamp-install-%
diff --git a/debian/scripts/checks/module-signature-check b/debian/scripts/checks/module-signature-check
index 67736c289820..2df07a4c324e 100755
--- a/debian/scripts/checks/module-signature-check
+++ b/debian/scripts/checks/module-signature-check
@@ -4,6 +4,12 @@ flavor="${1}"
 mods_dir="${2}"
 mods_extra_dir="${3}"
 
+skip_checks=${4:-}
+case "${skip_checks,,}" in
+        1|true|yes) skip_checks=1 ;;
+        *) skip_checks=0 ;;
+esac
+
 echo "II: Checking signature of staging modules for ${flavor}..."
 
 root=$(dirname "$(realpath -e "${0}")")/../../..
@@ -30,6 +36,11 @@ fi
 if ! [ -d "${mods_dir}" ] ; then
 	echo "EE: Modules directory missing:"
 	echo "    ${mods_dir}"
+	if [ ${skip_checks} -eq 1 ] ; then
+		echo "WW: Explicitly asked to ignore failures"
+		echo "II: Done"
+		exit 0
+	fi
 	exit 1
 fi
 
@@ -67,10 +78,14 @@ done < <(find "${mods_dirs[@]}" -path '*/drivers/staging/*.ko' | sort)
 
 echo "II: Checked $((pass + fail)) modules : ${pass} PASS, ${fail} FAIL"
 
-if [ ${fail} -eq 0 ] ; then
-	echo "II: Done"
-	exit 0
-else
-	echo "EE: Modules signature failures"
-	exit 1
+if [ ${fail} -ne 0 ] ; then
+	if [ ${skip_checks} -eq 1 ] ; then
+		echo "WW: Explicitly asked to ignore failures"
+	else
+		echo "EE: Modules signature failures"
+		exit 1
+	fi
 fi
+
+echo "II: Done"
+exit 0
-- 
2.34.1




More information about the kernel-team mailing list