Imported 2.525.28

No reason for CPC update specified.
This commit is contained in:
CloudBuilder 2019-07-25 20:47:05 +00:00
parent 4a5152399a
commit c60bd6f2cf
3 changed files with 43 additions and 4 deletions

16
debian/changelog vendored
View File

@ -1,3 +1,19 @@
livecd-rootfs (2.525.28) bionic; urgency=medium
[ Tobias Koch ]
* Do proper error checking when calling snap-tool info to determine
the base of a snap. (LP: #1828500)
[ Michael Vogt ]
* Run "snap debug validate-seed" during preseeding to do basic validation of
the generated seed.yaml
[ Iain Lane ]
* Seed core for non minimized builds, as it is still required (LP:
#1836594).
-- Iain Lane <iain.lane@canonical.com> Tue, 16 Jul 2019 13:20:18 +0100
livecd-rootfs (2.525.27) bionic; urgency=medium livecd-rootfs (2.525.27) bionic; urgency=medium
* Backport improvements to snap seeding from trunk. LP: #1831675. * Backport improvements to snap seeding from trunk. LP: #1831675.

2
debian/control vendored
View File

@ -33,7 +33,7 @@ Depends: ${misc:Depends},
python3-software-properties, python3-software-properties,
qemu-utils, qemu-utils,
rsync, rsync,
snapd, snapd (>= 2.39),
squashfs-tools (>= 1:3.3-1), squashfs-tools (>= 1:3.3-1),
sudo, sudo,
u-boot-tools [armhf arm64], u-boot-tools [armhf arm64],

View File

@ -445,12 +445,20 @@ _snap_preseed() {
;; ;;
*) *)
# Determine if and what core snap is needed # Determine if and what core snap is needed
local core_snap=$(/usr/share/livecd-rootfs/snap-tool info \ local snap_info
snap_info=$(/usr/share/livecd-rootfs/snap-tool info \
--cohort-key="${COHORT_KEY:-}" \ --cohort-key="${COHORT_KEY:-}" \
--channel="$CHANNEL" "$SNAP_NAME" | \ --channel="$CHANNEL" "${SNAP_NAME}" \
grep '^base:' | awk '{print $2}'
) )
if [ $? -ne 0 ]; then
echo "Failed to retrieve base of $SNAP_NAME!"
exit 1
fi
local core_snap=$(echo "$snap_info" | grep '^base:' | awk '{print $2}')
# If $core_snap is not the empty string then SNAP itself is not a core # If $core_snap is not the empty string then SNAP itself is not a core
# snap and we must additionally seed the core snap. # snap and we must additionally seed the core snap.
if [ -n "$core_snap" ]; then if [ -n "$core_snap" ]; then
@ -550,6 +558,12 @@ snap_prepare() {
local snaps_dir="$seed_dir/snaps" local snaps_dir="$seed_dir/snaps"
snap_prepare_assertions "$CHROOT_ROOT" "$CUSTOM_BRAND_MODEL" snap_prepare_assertions "$CHROOT_ROOT" "$CUSTOM_BRAND_MODEL"
# ubuntu-cpc:minimized has its own special snap handling
if [ "$PROJECT:${SUBPROJECT:-}" != ubuntu-cpc:minimized ]; then
# Download the core snap
_snap_preseed "$CHROOT_ROOT" core stable
fi
} }
snap_preseed() { snap_preseed() {
@ -571,6 +585,15 @@ snap_preseed() {
touch "$CHROOT_ROOT/var/lib/snapd/seed/.snapd-explicit-install-stamp" touch "$CHROOT_ROOT/var/lib/snapd/seed/.snapd-explicit-install-stamp"
;; ;;
esac 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
} }
is_live_layer () { is_live_layer () {