efi-boot-shim/debian/generate_dbx_list
Steve McIntyre de3def7f53 Improve how the dbx hashes are handled
Only include the hashes for the architecture we're building for - no
point in adding bloat and delay here.

Add a script "block_signed_deb" to scan a set of .deb files, extract
the hashes for .efi binaries and list them in the format wanted for
the dbx hashes file.

Split out the code to use that file from the rules file into a
separate helper.
2021-03-23 23:33:04 +00:00

28 lines
664 B
Bash
Executable File

#!/bin/sh
#
# Helper script - generate a DBX file for inclusion into a shim build
#
# Takes an input file (e.g. debian-dbx.hashes) with data in the form
#
# <hex-encoded sha256 checksums> <arch>
#
# and generates a siglist of the hashes for just the architecture we
# want. No point including all the hashes for all the arches, it just
# bloats things and slows things down.
set -e
ARCH=$1
IN=$2
OUT=$3
rm -f $OUT
for HASH in $(grep -E "[[:xdigit:]]{32} $ARCH" < $IN | \
awk '{print $1}' | sort | uniq); do
echo " Adding $HASH to dbx list"
efisiglist -o $OUT -a -h $HASH
done
# If we have an empty hashes file, create an empty DBX file
touch $OUT