[neon/neon/livecd-rootfs/Neon/release] /: fix: No longer install LXD snap in unminimize script (LP: #2066905)

Philip Roche null at kde.org
Thu Jul 11 11:54:01 BST 2024


Git commit 5507ca8d835f77ca62a54a15037114b2f540cf0c by Philip Roche.
Committed on 24/05/2024 at 14:48.
Pushed by carlosdem into branch 'Neon/release'.

fix: No longer install LXD snap in unminimize script (LP: #2066905)

The LXD snap is no longer seeded in any images since Noble+ so the LXD related unminimize logic in
./live-build/auto/build?h=ubuntu/noble and ./live-build/ubuntu-server/hooks/01-unminimize.chroot_early
 is no longer required.

lxd-installer can remain installed.

(cherry picked from commit 46c19dfa913c133042d62e0caa2d2d526cd9bb7f)

M  +5    -1    debian/changelog
M  +0    -12   live-build/auto/build
M  +0    -25   live-build/ubuntu-server/hooks/01-unminimize.chroot_early

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

diff --git a/debian/changelog b/debian/changelog
index 069c9b0e..6f28d37e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,13 @@
 livecd-rootfs (24.04.70) UNRELEASED; urgency=medium
 
+  [ Łukasz 'sil2100' Zemczak ]
   * Add experimental support for building ubuntu-core-desktop installer images
     (LP: #2063203)
 
- -- Łukasz 'sil2100' Zemczak <lukasz.zemczak at ubuntu.com>  Wed, 24 Apr 2024 10:53:27 +0100
+  [ Philip Roche ]
+  * No longer install LXD snap in unminimize script (LP: #2066905) 
+
+ -- Philip Roche <phil.roche at canonical.com>  Fri, 24 May 2024 15:47:48 +0100
 
 livecd-rootfs (24.04.69) noble; urgency=medium
 
diff --git a/live-build/auto/build b/live-build/auto/build
index b967f4e0..93184e7a 100755
--- a/live-build/auto/build
+++ b/live-build/auto/build
@@ -284,18 +284,6 @@ fi
 EOF
 
 fi
-		if [ "$PROJECT" = "ubuntu-cpc" ] || [ "$PROJECT" = "ubuntu-server" ]; then
-			cat >> chroot/usr/local/sbin/unminimize <<'EOF'
-
-# installing LXD using the lxd-installer by simply invoking it
-echo "Invoking LXD so that it can be installed by the lxd-installer's script.."
-lxd --version
-
-echo "Removing lxd installer package..."
-apt-get purge -y lxd-installer
-
-EOF
-		fi
 		cat >> chroot/usr/local/sbin/unminimize <<'EOF'
 
 # unminimization succeeded, there is no need to mention it in motd
diff --git a/live-build/ubuntu-server/hooks/01-unminimize.chroot_early b/live-build/ubuntu-server/hooks/01-unminimize.chroot_early
index 0d7ab5a4..6ed92bb7 100755
--- a/live-build/ubuntu-server/hooks/01-unminimize.chroot_early
+++ b/live-build/ubuntu-server/hooks/01-unminimize.chroot_early
@@ -10,31 +10,6 @@ case ${PASS} in
         ;;
 esac
 
-# The unminimize script will try to install the lxd snap using the shim script
-# /usr/sbin/lxd from the lxd-installer package.
-# We can't do that at this stage so just neuter the lxd command (the snap
-# will get properly seeded by generic machinery).
-if [ -f "/usr/sbin/lxd" ]; then
-    dpkg-divert --add --divert /usr/sbin/lxd.REAL --rename /usr/sbin/lxd
-    ln -s /bin/true /usr/sbin/lxd
-    yes | /usr/local/sbin/unminimize
-    # unminimize also uninstalls lxd-installer package
-    # and also removed `/usr/sbin/lxd` as a result, so we don't need to restore, but
-    # we do need to remove the mock we used as part of dpkg-divert
-    # first we need to remove the diversion
-    dpkg-divert --remove --no-rename /usr/sbin/lxd
-    # now remove the renamed file that we originally diverted to
-    rm -v /usr/sbin/lxd.REAL
-else
-    # if /usr/sbin/lxd doesn't exist then lxd-installer package isn't installed.
-    # Instead, we can mock the command to avoid the unminimize script failing
-    ln -s /bin/true /usr/sbin/lxd
-    yes | /usr/local/sbin/unminimize
-    # as the lxd-installer package was not installed and thus not removed by `unminimize`
-    # the mock /usr/sbin/lxd will still be present, so we need to remove it
-    rm -v /usr/sbin/lxd
-fi
-
 # Fix up missing recommends.  Other non-layered flavors handle this in
 # live-build/auto/build, but we need to do it here.  Also, there are
 # additional recommends missing from server-minimal that wouldn't be



More information about the Neon-commits mailing list