From 3ae4e475e423081881aa20c6b591c33e40703e1a Mon Sep 17 00:00:00 2001 From: CloudBuilder Date: Mon, 15 Jul 2019 21:00:05 +0000 Subject: [PATCH] Imported 2.600 No reason for CPC update specified. --- debian/changelog | 12 ++++++++++++ live-build/functions | 22 ++++++++++++++++++---- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8be6463c..8c9138fd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +livecd-rootfs (2.600) eoan; urgency=medium + + [ Tobias Koch ] + * Do proper error checking when calling snap-tool info to determine + the base of a snap. + + [ Iain Lane ] + * Seed core for non minimized builds, as it is still required (LP: + #1836594). + + -- Tobias Koch Mon, 15 Jul 2019 16:13:31 +0100 + livecd-rootfs (2.599) eoan; urgency=medium * Append the list of seeded snaps to manifests for all regular images. diff --git a/live-build/functions b/live-build/functions index 8eff0a90..3339d72e 100644 --- a/live-build/functions +++ b/live-build/functions @@ -483,12 +483,20 @@ _snap_preseed() { ;; *) # 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:-}" \ - --channel="$CHANNEL" "$SNAP_NAME" | \ - grep '^base:' | awk '{print $2}' + --channel="$CHANNEL" "${SNAP_NAME}" \ ) + 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 # snap and we must additionally seed the core snap. if [ -n "$core_snap" ]; then @@ -611,6 +619,12 @@ snap_prepare() { local CUSTOM_BRAND_MODEL=${2:-generic:generic-classic} 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() { @@ -892,4 +906,4 @@ replace_kernel () { install --assume-yes "${new_kernel}" env DEBIAN_FRONTEND=noninteractive chroot "${mountpoint}" apt-get \ autoremove --purge --assume-yes -} \ No newline at end of file +}