sys-boot/shim: Add a use flag to use a DER files for shim builds

Signed-off-by: Sayan Chowdhury <schowdhury@microsoft.com>
This commit is contained in:
Sayan Chowdhury 2024-09-05 22:57:55 +05:30 committed by James Le Cuirot
parent d18a373cb7
commit b8f290bae4
No known key found for this signature in database
GPG Key ID: 1226415D00DD3137

View File

@ -11,7 +11,7 @@ KEYWORDS="amd64 arm64"
LICENSE="BSD"
SLOT="0"
IUSE=""
IUSE="official"
RDEPEND=""
# TODO: Would be ideal to depend on sys-boot/gnu-efi package, but
@ -41,8 +41,16 @@ src_compile() {
elif use arm64; then
emake_args+=( ARCH=aarch64 )
fi
emake_args+=( ENABLE_SBSIGN=1 )
emake_args+=( ENABLE_SBSIGN=1 )
if use official; then
if [ -z "${SHIM_SIGNING_CERTIFICATE}" ]; then
die "use production flag needs env SHIM_SIGNING_CERTIFICATE"
fi
emake_args+=( VENDOR_CERT_FILE="${SHIM_SIGNING_CERTIFICATE}" )
else
emake_args+=( VENDOR_CERT_FILE="/usr/share/sb_keys/shim.der" )
fi
emake "${emake_args[@]}" || die
}