From 4dbeba4ba38316590eb015bf6c769c62ed0123f3 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Fri, 24 Feb 2023 17:47:51 -0800 Subject: [PATCH] Address the fact that debootstrap doesn't follow Recommends and as a result we're missing several Recommends that should be installed by default and are on upgrades but not on new installs. This is not applied to minimized images, which don't follow Recommends; but does get separately applied to the ubuntu-server full squashfs. --- debian/changelog | 10 ++++++++++ live-build/auto/build | 10 ++++++++++ .../ubuntu-server/hooks/01-unminimize.chroot_early | 7 +++++++ 3 files changed, 27 insertions(+) diff --git a/debian/changelog b/debian/changelog index 55a51f8d..a87a3feb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +livecd-rootfs (2.802) UNRELEASED; urgency=medium + + * Address the fact that debootstrap doesn't follow Recommends and as a + result we're missing several Recommends that should be installed by + default and are on upgrades but not on new installs. This is not + applied to minimized images, which don't follow Recommends; but does get + separately applied to the ubuntu-server full squashfs. + + -- Steve Langasek Fri, 24 Feb 2023 17:46:47 -0800 + livecd-rootfs (2.801) lunar; urgency=medium [ Heinrich Schuchardt ] diff --git a/live-build/auto/build b/live-build/auto/build index 7b984d92..83324c25 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -327,6 +327,16 @@ EOF chmod +x chroot/usr/bin/man fi + if [ "${SUBPROJECT:-}" != minimized ] \ + && [ "${PROJECT}" != "ubuntu-server" ] + then + # debootstrap doesn't handle Recommends and fixing this is + # non-trivial, so install missing Recommends here + echo "Installing any missing recommends" + Chroot chroot "env DEBIAN_FRONTEND=noninteractive \ + apt-get -y --fix-policy install" + fi + if [ -n "${PASSES}" ]; then PATH="config/:$PATH" lb chroot_layered "$@" else diff --git a/live-build/ubuntu-server/hooks/01-unminimize.chroot_early b/live-build/ubuntu-server/hooks/01-unminimize.chroot_early index f70b59b4..ec91fdc8 100755 --- a/live-build/ubuntu-server/hooks/01-unminimize.chroot_early +++ b/live-build/ubuntu-server/hooks/01-unminimize.chroot_early @@ -18,3 +18,10 @@ ln -s /bin/true /usr/bin/snap yes | /usr/local/sbin/unminimize rm /usr/bin/snap dpkg-divert --remove --rename /usr/bin/snap + +# 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 +# corrected by a fix to debootstrap to handle Recommends. +echo "Installing any missing recommends" +env DEBIAN_FRONTEND=noninteractive apt-get -y --fix-policy install