[neon/neon/livecd-rootfs/Neon/release] /: Treat it as a fatal error if we are asked to install a snap that would pull in the core snap. Ubuntu 20.04 and Ubuntu 22.04 official images should never require snaps that depend on an Ubuntu 16.04 runtime, this indicates a misconfiguration that will bloat the install.

Steve Langasek null at kde.org
Fri Jan 28 13:43:23 GMT 2022


Git commit bf889e33e4814f5550165152bc6f73578695bfd1 by Steve Langasek.
Committed on 12/01/2022 at 03:26.
Pushed by jriddell into branch 'Neon/release'.

Treat it as a fatal error if we are asked to install a snap that would pull in the core snap.  Ubuntu 20.04 and Ubuntu 22.04 official images should never require snaps that depend on an Ubuntu 16.04 runtime, this indicates a misconfiguration that will bloat the install.

M  +4    -0    debian/changelog
M  +6    -2    live-build/functions

https://invent.kde.org/neon/neon/livecd-rootfs/commit/bf889e33e4814f5550165152bc6f73578695bfd1

diff --git a/debian/changelog b/debian/changelog
index cf01d4b7..f6ee901c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,10 @@ livecd-rootfs (2.664.37) UNRELEASED; urgency=medium
 
   * Do not look for a base snap on snaps of type base, because recursive
     dependencies are not allowed for snaps.  LP: #1957123.
+  * Treat it as a fatal error if we are asked to install a snap that would
+    pull in the core snap.  Ubuntu 20.04 and Ubuntu 22.04 official images
+    should never require snaps that depend on an Ubuntu 16.04 runtime, this
+    indicates a misconfiguration that will bloat the install.
 
  -- Steve Langasek <steve.langasek at ubuntu.com>  Tue, 11 Jan 2022 15:38:05 -0800
 
diff --git a/live-build/functions b/live-build/functions
index c99812d3..d65c9a40 100644
--- a/live-build/functions
+++ b/live-build/functions
@@ -557,8 +557,12 @@ _snap_preseed() {
             if [ "$snap_type" != base ]; then
                 local core_snap=$(echo "$snap_info" | awk '/^base:/ {print $2}')
 
-                # If snap info does not list a base use 'core'
-                core_snap=${core_snap:-core}
+                # If snap info does not list a base the default is 'core'
+                # which is now an error to use.
+                if [ -z "$core_snap" ]; then
+                    echo "Legacy snap with no base declaration found, refusing to install 'core' snap"
+                    exit 1
+                fi
 
                 _snap_preseed $CHROOT_ROOT $core_snap stable
             fi



More information about the Neon-commits mailing list