diff --git a/live-build/auto/build b/live-build/auto/build index 6a8f58f3..8689bcf1 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -39,10 +39,8 @@ preinstall_snaps() { lb chroot_resolv install snap_prepare chroot - snap_channel="stable/ubuntu-$(distro-info --series="$LB_DISTRIBUTION" \ - -r | awk '{ print $1 }')" for snap in "$@"; do - snap_preseed chroot "${snap}" "$snap_channel" + snap_preseed chroot "${snap}" done lb chroot_resolv remove } diff --git a/live-build/auto/config b/live-build/auto/config index e02f0512..b0c6f7f6 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -825,9 +825,11 @@ lb config noauto \ echo "LB_CHROOT_HOOKS=\"$CHROOT_HOOKS\"" >> config/chroot echo "SUBPROJECT=\"${SUBPROJECT:-}\"" >> config/chroot +echo "LB_DISTRIBUTION=\"$SUITE\"" >> config/chroot echo "LB_BINARY_HOOKS=\"$BINARY_HOOKS\"" >> config/binary echo "BUILDSTAMP=\"$NOW\"" >> config/binary echo "SUBPROJECT=\"${SUBPROJECT:-}\"" >> config/binary +echo "LB_DISTRIBUTION=\"$SUITE\"" >> config/binary case $ARCH+$SUBARCH in armhf+raspi2) diff --git a/live-build/functions b/live-build/functions index 6f97592d..04fc25dd 100644 --- a/live-build/functions +++ b/live-build/functions @@ -362,6 +362,11 @@ recreate_initramfs() { mv "$CHROOT"/boot/initrd.img-* $DESTDIR } +release_ver() { + # Return the release version number + distro-info --series="$LB_DISTRIBUTION" -r | awk '{ print $1 }' +} + _snap_preseed() { # Download the snap/assertion and add to the preseed local CHROOT_ROOT=$1 @@ -442,7 +447,9 @@ snap_preseed() { # Preseeed a snap in the image local CHROOT_ROOT=$1 local SNAP=$2 - local CHANNEL=${3:-stable} + # Per Ubuntu policy, all seeded snaps (with the exception of the core + # snap) must pull from stable/ubuntu-$(release_ver) as their channel. + local CHANNEL=${3:-"stable/ubuntu-$(release_ver)"} snap_prepare $CHROOT_ROOT _snap_preseed $CHROOT_ROOT $SNAP $CHANNEL