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.

no-base-snaps-for-base-snaps
Steve Langasek 3 years ago
parent bcfad43fd4
commit 245f7772bd

4
debian/changelog vendored

@ -2,6 +2,10 @@ livecd-rootfs (2.750) 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@ubuntu.com> Tue, 11 Jan 2022 15:38:05 -0800

@ -597,8 +597,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

Loading…
Cancel
Save