From ca8432068873eb569c2fcab252967103f9c6766e Mon Sep 17 00:00:00 2001 From: Utkarsh Gupta Date: Thu, 3 Aug 2023 14:16:32 +0530 Subject: [PATCH] Avoid purging packages for ubuntu-cpc With the switch to the ubuntu-cloud-minimal seed, we don't really need to purge anything now. On the contrary, the purging of packages if not installed, fails with the exit code of 100. --- live-build/auto/build | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/live-build/auto/build b/live-build/auto/build index adc54467..2a94e910 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -369,21 +369,24 @@ EOF # done in chroot hooks. if [ -z "$PASSES" ]; then if [ "${SUBPROJECT:-}" = minimized ]; then - # force removal of initramfs-tools, which we assert is not - # required for any minimized images but is still pulled in by - # default - # also remove landscape-common, which is heavyweight and - # in the server seed only to provide /etc/motd content which - # would only be seen by humans - Chroot chroot "env DEBIAN_FRONTEND=noninteractive \ - apt-get -y purge initramfs-tools busybox-initramfs \ - landscape-common" - # and if initramfs-tools was configured before our kernel, - # /etc/kernel/postinst.d/initramfs-tools will have created - # an initramfs despite the generic dpkg-divert; so remove it - # here. - rm -f chroot/boot/initrd.img-* - + # ubuntu-cpc has moved to using ubuntu-cloud-minimal seed + # for minimized images, so don't need these purges anymore. + if [ "$PROJECT" != ubuntu-cpc ]; then + # force removal of initramfs-tools, which we assert is not + # required for any minimized images but is still pulled in by + # default + # also remove landscape-common, which is heavyweight and + # in the server seed only to provide /etc/motd content which + # would only be seen by humans + Chroot chroot "env DEBIAN_FRONTEND=noninteractive \ + apt-get -y purge initramfs-tools busybox-initramfs \ + landscape-common" + # and if initramfs-tools was configured before our kernel, + # /etc/kernel/postinst.d/initramfs-tools will have created + # an initramfs despite the generic dpkg-divert; so remove it + # here. + rm -f chroot/boot/initrd.img-* + fi # temporary workaround: don't remove linux-base which # may have no other reverse-depends currently Chroot chroot "env DEBIAN_FRONTEND=noninteractive \