From abb48e44cea9c514d6d75577e4c64582f814f2c1 Mon Sep 17 00:00:00 2001 From: Philip Meulengracht Date: Tue, 19 Nov 2024 07:50:49 +0100 Subject: [PATCH] hooks: always write the FIPS preference for FIPS builds --- hooks/001-extra-packages.chroot | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hooks/001-extra-packages.chroot b/hooks/001-extra-packages.chroot index 0e48eb9..f639cb9 100755 --- a/hooks/001-extra-packages.chroot +++ b/hooks/001-extra-packages.chroot @@ -118,7 +118,7 @@ FSbrQ9ACQFlqN49Ogbl47J6TZ7BrjDpROote55ixmrU= EOF # write FIPS PPA files if the current build is a local FIPS build -# for private builds a conf file is neccessary, setup for PPA access if provided +# for private builds a conf file is necessary, setup for PPA access if provided if [ -e etc/apt/auth.conf.d/01-fips.conf ]; then echo "deb https://private-ppa.launchpadcontent.net/fips-cc-stig/fips-under-certification/ubuntu $CODENAME main" > /etc/apt/sources.list.d/fips.list cat >etc/apt/trusted.gpg.d/fips-cc-stig.asc <<'EOF' @@ -153,7 +153,11 @@ UNuHk+m6RrdnU0GhZFiccabKzM11OElMcupvOQeIRA== =MKdQ -----END PGP PUBLIC KEY BLOCK----- EOF - +fi + +# always install the preference though, both for LP and +# local +if [[ ${SNAP_FIPS_BUILD+x} ]]; then mkdir -p etc/apt/preferences.d/ cat >etc/apt/preferences.d/fips.pref <<'EOF' Package: *