Merge lp:~vorlon/livecd-rootfs/snap-in-mate into lp:livecd-rootfs

Proposed by Steve Langasek
Status: Merged
Merged at revision: 1552
Proposed branch: lp:~vorlon/livecd-rootfs/snap-in-mate
Merge into: lp:livecd-rootfs
Diff against target: 82 lines (+57/-0)
2 files modified
debian/changelog (+7/-0)
live-build/auto/build (+50/-0)
To merge this branch: bzr merge lp:~vorlon/livecd-rootfs/snap-in-mate
Reviewer Review Type Date Requested Status
Michael Hudson-Doyle Approve
Martin Wimpress  (community) Approve
Ubuntu CD Image Team Pending
Review via email: mp+331990@code.launchpad.net

Description of the change

Generalize from live-build/ubuntu-server/hooks/032-installer-squashfs.binary handling of subiquity snap to the ability to install an arbitrary list of snaps as part of a livefs.

And install pulsemixer in the Ubuntu MATE image, per Martin Wimpress.

Ubuntu MATE build test with this change:

https://launchpad.net/~canonical-foundations/+livefs/ubuntu/artful/ubuntu-mate/+build/112019

To post a comment you must log in.
Revision history for this message
Martin Wimpress  (flexiondotorg) :
review: Approve
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Looks fine, this generalizes the stuff from server-live but does not actually change server-live to use the new machinery, is there a reason for that beyond close-to-release caution?

review: Approve
Revision history for this message
Steve Langasek (vorlon) wrote :

Currently there are several obstacles to sort through before having server-live also use it:

- server-live installs the snap in a separate installer squashfs, not in the base livefs, which means it must be done from a binary hook. We currently have no shell libraries shared between live-build/auto/build and the hooks, and I didn't want to block this change on a refactor.
- server-live currently installs subiquity from the edge channel. While I think this should be changed, there is currently no subiquity in the stable channel, and I didn't want to block this on a subiquity promotion (nor do I want the code to support installing from non-stable channels).
- subiquity is a classic mode snap, which requires additional metadata to be provided in the seed.yaml, which I also did not want to deal with at this juncture.

Revision history for this message
Dustin Krysak (bashfulrobot) wrote :

This looks extremely interesting. We were considering and evaluating on how to use snaps (where appropriate) in Ubuntu Budgie. Having a method to hook into and install snaps would be amazing.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2017-10-05 23:53:11 +0000
+++ debian/changelog 2017-10-08 02:31:37 +0000
@@ -1,3 +1,10 @@
1livecd-rootfs (2.469) UNRELEASED; urgency=medium
2
3 * Add initial support for preinstallation of snaps in images, and
4 preinstall pulsemixer in the Ubuntu MATE image.
5
6 -- Steve Langasek <steve.langasek@ubuntu.com> Fri, 06 Oct 2017 16:23:49 -0700
7
1livecd-rootfs (2.468) artful; urgency=medium8livecd-rootfs (2.468) artful; urgency=medium
29
3 [ Dimitri John Ledkov ]10 [ Dimitri John Ledkov ]
411
=== modified file 'live-build/auto/build'
--- live-build/auto/build 2017-10-04 04:45:50 +0000
+++ live-build/auto/build 2017-10-08 02:31:37 +0000
@@ -27,6 +27,45 @@
27# Setup cleanup function27# Setup cleanup function
28Setup_cleanup28Setup_cleanup
2929
30preinstall_snaps() {
31 lb chroot_resolv install
32 chroot chroot sh -c '
33 set -x;
34 cd /var/lib/snapd/seed;
35 SNAPPY_STORE_NO_CDN=1 snap download core'
36 for snap in "$@"; do
37 chroot chroot sh -c "
38 set -x;
39 cd /var/lib/snapd/seed;
40 SNAPPY_STORE_NO_CDN=1 snap download \"$snap\""
41 done
42 lb chroot_resolv remove
43
44 CORE_SNAP=$(cd chroot/var/lib/snapd/seed; ls -1 core_*.snap)
45
46 cat <<EOF > chroot/var/lib/snapd/seed/seed.yaml
47snaps:
48 - name: core
49 channel: stable
50 file: ${CORE_SNAP}
51EOF
52 for snap in "$@"; do
53 cat <<EOF >> chroot/var/lib/snapd/seed/seed.yaml
54 - name: $snap
55 channel: stable
56EOF
57 echo -n " file: " >> chroot/var/lib/snapd/seed/seed.yaml
58 (cd chroot/var/lib/snapd/seed; ls -1 ${snap}_*.snap) \
59 >> chroot/var/lib/snapd/seed/seed.yaml
60 done
61
62 mkdir -p chroot/var/lib/snapd/seed/snaps \
63 chroot/var/lib/snapd/seed/assertions
64 mv chroot/var/lib/snapd/seed/*.assert \
65 chroot/var/lib/snapd/seed/assertions/
66 mv chroot/var/lib/snapd/seed/*.snap chroot/var/lib/snapd/seed/snaps/
67}
68
30rm -f binary.success69rm -f binary.success
31(70(
32 if [ -d config/gnupg ]; then71 if [ -d config/gnupg ]; then
@@ -322,6 +361,17 @@
322 ;;361 ;;
323 esac362 esac
324363
364 # FIXME: this should not be a hard-coded list in this script; this
365 # is an interim solution for 17.10.
366 case $PROJECT:$SUBPROJECT in
367 ubuntu-mate:*)
368 SNAP_LIST=pulsemixer
369 ;;
370 esac
371 if [ -n "$SNAP_LIST" ]; then
372 preinstall_snaps $SNAP_LIST
373 fi
374
325 if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-touch-custom" ]; then375 if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-touch-custom" ]; then
326 if [ "$ARCH" = "armhf" ]; then376 if [ "$ARCH" = "armhf" ]; then
327 INFO_DESC="$(lsb_release -d -s)"377 INFO_DESC="$(lsb_release -d -s)"

Subscribers

People subscribed via source and target branches