UBUNTU: [Packaging] checks/module-signature-check: Add 'skip_checks' argument

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@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
This commit is contained in:
Juerg Haefliger
2023-01-09 15:59:35 +01:00
committed by Paolo Pisati
parent 9532b18cac
commit 2e5e631350
2 changed files with 23 additions and 7 deletions
+2 -1
View File
@@ -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-%
+21 -6
View File
@@ -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