Skip to content

Commit

Permalink
Merge branch 'core24' into use_meta_pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
Meulengracht authored Nov 18, 2024
2 parents 094e3b1 + 75a45d9 commit 59fbf7f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
20 changes: 11 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# dir that contans the filesystem that must be checked
TESTDIR ?= "prime/"
SNAP_NAME=core24
BUILDDIR=/build/$(SNAP_NAME)
SNAP_BUILD_NAME=core24
CODENAME:="$(shell . /etc/os-release; echo "$$VERSION_CODENAME")"

# include any fips environmental setup if the file exists.
# Variables:
# - SNAP_FIPS_BUILD
# - SNAP_BUILD_NAME
-include .fips-env
ifdef SNAP_FIPS_BUILD
export SNAP_FIPS_BUILD
export SNAP_BUILD_NAME
endif

.PHONY: all
Expand All @@ -28,9 +30,9 @@ install:
# ensure resolving works inside the chroot
cat /etc/resolv.conf > $(DESTDIR)/etc/resolv.conf
# copy-in launchpad's build archive
if grep -q ftpmaster.internal /etc/apt/sources.list; then \
cp /etc/apt/sources.list $(DESTDIR)/etc/apt/sources.list; \
cp /etc/apt/trusted.gpg $(DESTDIR)/etc/apt/ || true; \
if grep -q ftpmaster.internal /etc/apt/sources.list.d/lp-buildd.sources; then \
cp /etc/apt/sources.list $(DESTDIR)/etc/apt/sources.list || true; \
cp /etc/apt/sources.list.d/lp-buildd.sources $(DESTDIR)/etc/apt/sources.list.d/lp-buildd.sources || true; \
cp -r /etc/apt/trusted.gpg.d $(DESTDIR)/etc/apt/ || true; \
fi

Expand Down Expand Up @@ -82,7 +84,7 @@ endif
# a git repository
if git rev-parse HEAD && [ -e "/snap/$(SNAP_NAME)/current/usr/share/snappy/dpkg.yaml" ]; then \
CHG_PARAMS=; \
if [ -e /build/$(SNAP_NAME) ]; then \
if [ -e /build/$(SNAP_BUILD_NAME) ]; then \
CHG_PARAMS=--launchpad; \
fi; \
./tools/generate-changelog.py \
Expand All @@ -95,11 +97,11 @@ endif
fi

# only generate manifest and dpkg.yaml files for lp build
if [ -e $(BUILDDIR) ]; then \
/bin/cp $(DESTDIR)/usr/share/snappy/dpkg.list $(BUILDDIR)/$(SNAP_NAME)-$$(date +%Y%m%d%H%M)_$(DPKG_ARCH).manifest; \
/bin/cp $(DESTDIR)/usr/share/snappy/dpkg.yaml $(BUILDDIR)/$(SNAP_NAME)-$$(date +%Y%m%d%H%M)_$(DPKG_ARCH).dpkg.yaml; \
if [ -e /build/$(SNAP_BUILD_NAME) ]; then \
/bin/cp $(DESTDIR)/usr/share/snappy/dpkg.list /build/$(SNAP_BUILD_NAME)/$(SNAP_NAME)-$$(date +%Y%m%d%H%M)_$(DPKG_ARCH).manifest; \
/bin/cp $(DESTDIR)/usr/share/snappy/dpkg.yaml /build/$(SNAP_BUILD_NAME)/$(SNAP_NAME)-$$(date +%Y%m%d%H%M)_$(DPKG_ARCH).dpkg.yaml; \
if [ -e $(DESTDIR)/usr/share/doc/ChangeLog ]; then \
/bin/cp $(DESTDIR)/usr/share/doc/ChangeLog $(BUILDDIR)/$(SNAP_NAME)-$$(date +%Y%m%d%H%M)_$(DPKG_ARCH).ChangeLog; \
/bin/cp $(DESTDIR)/usr/share/doc/ChangeLog /build/$(SNAP_BUILD_NAME)/$(SNAP_NAME)-$$(date +%Y%m%d%H%M)_$(DPKG_ARCH).ChangeLog; \
fi \
fi;

Expand Down
13 changes: 4 additions & 9 deletions hooks/001-extra-packages.chroot
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,10 @@ FSbrQ9ACQFlqN49Ogbl47J6TZ7BrjDpROote55ixmrU=
-----END PGP PUBLIC KEY BLOCK-----
EOF

# write FIPS PPA files if the current build is a FIPS build
if [[ ${SNAP_FIPS_BUILD+x} ]]; then
# for private builds a conf file is neccessary, 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
else
# this allow launchpad intenal build access private ppa without credentials
echo "deb http://private-ppa.buildd/fips-cc-stig/fips-under-certification/ubuntu $CODENAME main" >> /etc/apt/sources.list.d/fips.list
fi
# 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
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'
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: Hostname:
Expand Down
1 change: 1 addition & 0 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ parts:
if git remote get-url origin | grep "fips"; then
craftctl set version="$(/bin/date +%Y%m%d)+fips"
echo "SNAP_FIPS_BUILD=1" > ./.fips-env
echo "SNAP_BUILD_NAME=core24-fips" >> ./.fips-env
else
craftctl set version="$(/bin/date +%Y%m%d)"
rm -f ./.fips-env
Expand Down

0 comments on commit 59fbf7f

Please sign in to comment.