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
1=== modified file 'debian/changelog'
2--- debian/changelog 2017-10-05 23:53:11 +0000
3+++ debian/changelog 2017-10-08 02:31:37 +0000
4@@ -1,3 +1,10 @@
5+livecd-rootfs (2.469) UNRELEASED; urgency=medium
6+
7+ * Add initial support for preinstallation of snaps in images, and
8+ preinstall pulsemixer in the Ubuntu MATE image.
9+
10+ -- Steve Langasek <steve.langasek@ubuntu.com> Fri, 06 Oct 2017 16:23:49 -0700
11+
12 livecd-rootfs (2.468) artful; urgency=medium
13
14 [ Dimitri John Ledkov ]
15
16=== modified file 'live-build/auto/build'
17--- live-build/auto/build 2017-10-04 04:45:50 +0000
18+++ live-build/auto/build 2017-10-08 02:31:37 +0000
19@@ -27,6 +27,45 @@
20 # Setup cleanup function
21 Setup_cleanup
22
23+preinstall_snaps() {
24+ lb chroot_resolv install
25+ chroot chroot sh -c '
26+ set -x;
27+ cd /var/lib/snapd/seed;
28+ SNAPPY_STORE_NO_CDN=1 snap download core'
29+ for snap in "$@"; do
30+ chroot chroot sh -c "
31+ set -x;
32+ cd /var/lib/snapd/seed;
33+ SNAPPY_STORE_NO_CDN=1 snap download \"$snap\""
34+ done
35+ lb chroot_resolv remove
36+
37+ CORE_SNAP=$(cd chroot/var/lib/snapd/seed; ls -1 core_*.snap)
38+
39+ cat <<EOF > chroot/var/lib/snapd/seed/seed.yaml
40+snaps:
41+ - name: core
42+ channel: stable
43+ file: ${CORE_SNAP}
44+EOF
45+ for snap in "$@"; do
46+ cat <<EOF >> chroot/var/lib/snapd/seed/seed.yaml
47+ - name: $snap
48+ channel: stable
49+EOF
50+ echo -n " file: " >> chroot/var/lib/snapd/seed/seed.yaml
51+ (cd chroot/var/lib/snapd/seed; ls -1 ${snap}_*.snap) \
52+ >> chroot/var/lib/snapd/seed/seed.yaml
53+ done
54+
55+ mkdir -p chroot/var/lib/snapd/seed/snaps \
56+ chroot/var/lib/snapd/seed/assertions
57+ mv chroot/var/lib/snapd/seed/*.assert \
58+ chroot/var/lib/snapd/seed/assertions/
59+ mv chroot/var/lib/snapd/seed/*.snap chroot/var/lib/snapd/seed/snaps/
60+}
61+
62 rm -f binary.success
63 (
64 if [ -d config/gnupg ]; then
65@@ -322,6 +361,17 @@
66 ;;
67 esac
68
69+ # FIXME: this should not be a hard-coded list in this script; this
70+ # is an interim solution for 17.10.
71+ case $PROJECT:$SUBPROJECT in
72+ ubuntu-mate:*)
73+ SNAP_LIST=pulsemixer
74+ ;;
75+ esac
76+ if [ -n "$SNAP_LIST" ]; then
77+ preinstall_snaps $SNAP_LIST
78+ fi
79+
80 if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-touch-custom" ]; then
81 if [ "$ARCH" = "armhf" ]; then
82 INFO_DESC="$(lsb_release -d -s)"

Subscribers

People subscribed via source and target branches