UBUNTU: [Packaging] Move final-checks script to debian/scripts/checks
Move the final-checks script to debian/scripts/checks so that all the checker scripts are in one place. Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
This commit is contained in:
committed by
Paolo Pisati
parent
65586f290d
commit
2a272fbe40
Vendored
-107
@@ -1,107 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
debian="$1"
|
||||
abi="$2"
|
||||
|
||||
archs=$(awk '/^Architecture:/ { $1=""; for (i=1; i<=NF; i++) { if ($i != "all") { print $i }}}' debian/control | sort -u)
|
||||
|
||||
fail=0
|
||||
|
||||
failure()
|
||||
{
|
||||
echo "EE: $@" 1>&2
|
||||
fail=1
|
||||
}
|
||||
|
||||
abi_check()
|
||||
{
|
||||
local abidir="$1"
|
||||
local arch="$2"
|
||||
local flavour="$3"
|
||||
|
||||
local abidir="$abidir/$arch"
|
||||
|
||||
if [ ! -f "$abidir/$flavour" -a \
|
||||
! -f "$abidir/$flavour.ignore" -a \
|
||||
! -f "$abidir/ignore" ]
|
||||
then
|
||||
failure "$arch/$flavour ABI symbol file missing"
|
||||
fi
|
||||
|
||||
if [ ! -f "$abidir/$flavour.modules" -a \
|
||||
! -f "$abidir/$flavour.ignore.modules" -a \
|
||||
! -f "$abidir/ignore.modules" ]
|
||||
then
|
||||
failure "$arch/$flavour ABI modules file missing"
|
||||
fi
|
||||
|
||||
if [ ! -f "$abidir/$flavour.retpoline" -a \
|
||||
! -f "$abidir/$flavour.ignore.retpoline" -a \
|
||||
! -f "$abidir/ignore.retpoline" ]
|
||||
then
|
||||
failure "$arch/$flavour ABI retpoline file missing"
|
||||
fi
|
||||
}
|
||||
|
||||
abi_version="$debian/abi/version"
|
||||
if ! [ -f "$abi_version" ]
|
||||
then
|
||||
failure "$abi_version ABI version file missing"
|
||||
fi
|
||||
|
||||
version=$(cat "$abi_version")
|
||||
if [ "$abi" != "$version" ]
|
||||
then
|
||||
failure "$abi_version ABI version mismatch ($abi != $version)"
|
||||
fi
|
||||
|
||||
if [ -e $debian/config/config.common.ubuntu ]; then
|
||||
if [ -d debian/certs ]; then
|
||||
if ! grep -q '^CONFIG_SYSTEM_TRUSTED_KEYS="debian/canonical-certs.pem"$' $debian/config/config.common.ubuntu; then
|
||||
failure "'CONFIG_SYSTEM_TRUSTED_KEYS="debian/canonical-certs.pem"' is required"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -d debian/revoked-certs ]; then
|
||||
if ! grep -q '^CONFIG_SYSTEM_REVOCATION_KEYS="debian/canonical-revoked-certs.pem"$' $debian/config/config.common.ubuntu; then
|
||||
failure "'CONFIG_SYSTEM_REVOCATION_KEYS="debian/canonical-revoked-certs.pem"' is required"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
for arch in $archs
|
||||
do
|
||||
image_pkg=$(awk -F '\\s*=\\s*' '$1 == "do_flavour_image_package" { print $2 }' $debian/rules.d/$arch.mk)
|
||||
if [ "$image_pkg" = "false" ]; then
|
||||
continue
|
||||
fi
|
||||
if [ ! -f "$debian/rules.d/$arch.mk" ]; then
|
||||
continue
|
||||
fi
|
||||
flavours=$(
|
||||
awk '/^\s*flavours\s*=/{
|
||||
sub(/^\s*flavours\s*=\s*/, "");
|
||||
print
|
||||
}' "$debian/rules.d/$arch.mk")
|
||||
for flavour in $flavours
|
||||
do
|
||||
flavour=$(echo "$flavour" | sed -e 's@.*/config.flavour.@@')
|
||||
if [ ! -e $debian/config/config.common.ubuntu ]; then
|
||||
if [ -d debian/certs ]; then
|
||||
python3 debian/scripts/misc/annotations --export -c CONFIG_SYSTEM_TRUSTED_KEYS --arch $arch --flavour $flavour | grep -q '^CONFIG_SYSTEM_TRUSTED_KEYS="debian/canonical-certs.pem"$'
|
||||
if [ $? -ne 0 ]; then
|
||||
failure "'CONFIG_SYSTEM_TRUSTED_KEYS="debian/canonical-certs.pem"' is required"
|
||||
fi
|
||||
fi
|
||||
if [ -d debian/revoked-certs ]; then
|
||||
python3 debian/scripts/misc/annotations --export -c CONFIG_SYSTEM_REVOCATION_KEYS --arch $arch --flavour $flavour | grep -q '^CONFIG_SYSTEM_REVOCATION_KEYS="debian/canonical-revoked-certs.pem"$'
|
||||
if [ $? -ne 0 ]; then
|
||||
failure "'CONFIG_SYSTEM_REVOCATION_KEYS="debian/canonical-revoked-certs.pem"' is required"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
abi_check "$debian/abi" "$arch" "$flavour"
|
||||
done
|
||||
done
|
||||
|
||||
exit "$fail"
|
||||
Reference in New Issue
Block a user