From fb1b5e73e30b505db023b93e2184f32bdd0c753a Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Sun, 8 Oct 2017 21:49:09 -0400 Subject: [PATCH] Import patches-unapplied version 2.470 to ubuntu/artful-proposed Imported using git-ubuntu import. Changelog parent: 2ec24bdfce2d5c81f242f0d480f7766d18a730f9 New changelog entries: * Add initial support for preinstallation of snaps in images, and preinstall pulsemixer in the Ubuntu MATE image. --- debian/changelog | 7 ++++++ live-build/auto/build | 50 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/debian/changelog b/debian/changelog index b375e483..f147d14e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.470) artful; urgency=medium + + * Add initial support for preinstallation of snaps in images, and + preinstall pulsemixer in the Ubuntu MATE image. + + -- Steve Langasek Sun, 08 Oct 2017 21:49:09 -0400 + livecd-rootfs (2.469) artful; urgency=medium * Unminimization information should only go to motd when we are actually diff --git a/live-build/auto/build b/live-build/auto/build index 29439fa0..41c21337 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -27,6 +27,45 @@ fi # Setup cleanup function Setup_cleanup +preinstall_snaps() { + lb chroot_resolv install + chroot chroot sh -c ' + set -x; + cd /var/lib/snapd/seed; + SNAPPY_STORE_NO_CDN=1 snap download core' + for snap in "$@"; do + chroot chroot sh -c " + set -x; + cd /var/lib/snapd/seed; + SNAPPY_STORE_NO_CDN=1 snap download \"$snap\"" + done + lb chroot_resolv remove + + CORE_SNAP=$(cd chroot/var/lib/snapd/seed; ls -1 core_*.snap) + + cat < chroot/var/lib/snapd/seed/seed.yaml +snaps: + - name: core + channel: stable + file: ${CORE_SNAP} +EOF + for snap in "$@"; do + cat <> chroot/var/lib/snapd/seed/seed.yaml + - name: $snap + channel: stable +EOF + echo -n " file: " >> chroot/var/lib/snapd/seed/seed.yaml + (cd chroot/var/lib/snapd/seed; ls -1 ${snap}_*.snap) \ + >> chroot/var/lib/snapd/seed/seed.yaml + done + + mkdir -p chroot/var/lib/snapd/seed/snaps \ + chroot/var/lib/snapd/seed/assertions + mv chroot/var/lib/snapd/seed/*.assert \ + chroot/var/lib/snapd/seed/assertions/ + mv chroot/var/lib/snapd/seed/*.snap chroot/var/lib/snapd/seed/snaps/ +} + rm -f binary.success ( if [ -d config/gnupg ]; then @@ -322,6 +361,17 @@ deb file:/var/lib/preinstalled-pool/ $LB_DISTRIBUTION $LB_PARENT_ARCHIVE_AREAS ;; esac + # FIXME: this should not be a hard-coded list in this script; this + # is an interim solution for 17.10. + case $PROJECT:$SUBPROJECT in + ubuntu-mate:*) + SNAP_LIST=pulsemixer + ;; + esac + if [ -n "$SNAP_LIST" ]; then + preinstall_snaps $SNAP_LIST + fi + if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-touch-custom" ]; then if [ "$ARCH" = "armhf" ]; then INFO_DESC="$(lsb_release -d -s)"