From 2dbda09b6a3815d60239ed2059bd40f30f057057 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 16 Jul 2019 10:27:27 +0100 Subject: [PATCH] Run "snap debug validate-seed" to do basic validation of the generated seed.yaml (cherry picked from commit b208ded59ea9e54ad42bd071a39cebe2e4809aa4) Signed-off-by: Iain Lane --- debian/control | 2 +- live-build/functions | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 7e84d2d5..91216306 100644 --- a/debian/control +++ b/debian/control @@ -33,7 +33,7 @@ Depends: ${misc:Depends}, python3-software-properties, qemu-utils, rsync, - snapd, + snapd (>= 2.39), squashfs-tools (>= 1:3.3-1), sudo, u-boot-tools [armhf arm64], diff --git a/live-build/functions b/live-build/functions index d979c9b0..a010ba0a 100644 --- a/live-build/functions +++ b/live-build/functions @@ -643,6 +643,15 @@ snap_preseed() { touch "$CHROOT_ROOT/var/lib/snapd/seed/.snapd-explicit-install-stamp" ;; esac + + + # Do basic validation of generated snapd seed.yaml, doing it here + # means we catch all the places(tm) that snaps are added but the + # downside is that each time a snap is added the seed must be valid, + # i.e. snaps with bases need to add bases first etc. + if [ -e chroot/var/lib/snapd/seed/seed.yaml ]; then + snap debug validate-seed "$CHROOT_ROOT/var/lib/snapd/seed/seed.yaml" + fi } snap_from_seed() {