From bc18c8a9926739d9e986974ebc665c151ed39327 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Thu, 9 Nov 2017 23:49:43 -0800 Subject: [PATCH] Import patches-unapplied version 2.482 to ubuntu/bionic-proposed Imported using git-ubuntu import. Changelog parent: c4cfbef1ee75ffa46af351f74751a032fbf1ef6d New changelog entries: * Remove boot/grub leftovers from our root squashfs, left behind after grub purge. * Remove apt, debconf, dpkg cruft files from /var/cache and /var/lib in all our livefses. * Pass --cache false to lb config; otherwise we copy around caches of .debs that are never used properly, and which prevent us from emptying /var/cache/apt in images. * When building minimized cloud images, remove various packages that we don't want installed by default. Some are tools that aren't needed for non-interactive use; some are libraries whose reverse-dependencies will have already been removed; and one, open-vm-tools, should only be included in images that are targeted to VMWare (which is not the case for any of the current minimal images), rather than being included directly in the cloud-image seed. --- debian/changelog | 19 +++++++++++++++++ live-build/auto/build | 4 ++++ live-build/auto/config | 1 + .../ubuntu-cpc/hooks/032-root-squashfs.binary | 1 + .../ubuntu-cpc/hooks/999-cpc-fixes.chroot | 21 +++++++++++++++++++ 5 files changed, 46 insertions(+) diff --git a/debian/changelog b/debian/changelog index 5e0a710e..f801abe0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,22 @@ +livecd-rootfs (2.482) bionic; urgency=medium + + * Remove boot/grub leftovers from our root squashfs, left behind after + grub purge. + * Remove apt, debconf, dpkg cruft files from /var/cache and /var/lib in all + our livefses. + * Pass --cache false to lb config; otherwise we copy around caches of + .debs that are never used properly, and which prevent us from emptying + /var/cache/apt in images. + * When building minimized cloud images, remove various packages that we + don't want installed by default. Some are tools that aren't needed for + non-interactive use; some are libraries whose reverse-dependencies + will have already been removed; and one, open-vm-tools, should only be + included in images that are targeted to VMWare (which is not the case + for any of the current minimal images), rather than being included + directly in the cloud-image seed. + + -- Steve Langasek Thu, 09 Nov 2017 23:49:43 -0800 + livecd-rootfs (2.481) bionic; urgency=medium * The target for x86 ubuntu-core images is VMs, so create them with diff --git a/live-build/auto/build b/live-build/auto/build index 7c263336..f9d05e2c 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -236,6 +236,10 @@ EOF apt-get -y --purge autoremove" fi + # remove crufty files that shouldn't be left in an image + rm -f chroot/var/cache/debconf/*-old chroot/var/lib/dpkg/*-old + Chroot chroot apt clean + if [ -f config/oem-config-preinstalled ]; then # This is cargo-culted almost verbatim (with some syntax changes for diff --git a/live-build/auto/config b/live-build/auto/config index 71ce31c0..697f7720 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -706,6 +706,7 @@ lb config noauto \ --initsystem none \ --bootloader "$BOOTLOADER" \ --initramfs-compression lzma \ + --cache false \ ${BOOTAPPEND_LIVE:+--bootappend-live "$BOOTAPPEND_LIVE"} \ $OPTS \ "$@" diff --git a/live-build/ubuntu-cpc/hooks/032-root-squashfs.binary b/live-build/ubuntu-cpc/hooks/032-root-squashfs.binary index bcce0a76..6c2d6ac8 100755 --- a/live-build/ubuntu-cpc/hooks/032-root-squashfs.binary +++ b/live-build/ubuntu-cpc/hooks/032-root-squashfs.binary @@ -31,6 +31,7 @@ chroot binary/boot/squashfs.dir chmod +x /usr/sbin/grub-probe env DEBIAN_FRONTEND=noninteractive chroot binary/boot/squashfs.dir apt-get --purge remove --assume-yes '^linux-.*' 'linux-base+' env DEBIAN_FRONTEND=noninteractive chroot binary/boot/squashfs.dir apt-get --purge remove --assume-yes '^grub-.*' env DEBIAN_FRONTEND=noninteractive chroot binary/boot/squashfs.dir apt-get autoremove --purge --assume-yes +rm -rf binary/boot/squashfs.dir/boot/grub chroot binary/boot/squashfs.dir mkdir /lib/modules chroot binary/boot/squashfs.dir rm /usr/sbin/grub-probe diff --git a/live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot b/live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot index 8b22fc8e..ef03273d 100755 --- a/live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot +++ b/live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot @@ -136,6 +136,27 @@ if [ -L "${rootd}/boot/initrd.img" ] && [ ! -e "${rootd}/boot/initrd.img" ]; the rm "${rootd}/boot/initrd.img" fi +if [ "${SUBPROJECT:-}" = minimized ]; then + # Remove various packages that we don't want in the minimized images. + # Some of these are tools that don't make sense by default + # non-interactively; some are libraries whose reverse-dependencies + # will have already been removed; open-vm-tools, it's a bug that this + # is in the common cloud seed because this should only be included + # in VMWare guest images, and we know none of the minimized images + # are targeted at VMWare. + _xchroot "${rootd}" env DEBIAN_FRONTEND=noninteractive \ + apt-mark auto '^lib.*' '^python*' vim-runtime 2>/dev/null + # FIXME: iso-codes is a dep of software-properties and shouldn't be + _xchroot "${rootd}" env DEBIAN_FRONTEND=noninteractive \ + apt-get -y autoremove --purge iso-codes xauth pastebinit \ + plymouth open-vm-tools git shared-mime-info vim vim-common \ + console-setup ncurses-term tmux screen policykit-1 \ + xdg-user-dirs less publicsuffix run-one apport-symptoms \ + ubuntu-cloudimage-keyring file + + _xchroot "${rootd}" apt clean +fi + #### END COMMON ARCH FUNCTIONS