From 5da7c23c81816d952ad1c4399c25ad0c3dd90b4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Wed, 8 Nov 2017 12:35:06 +0100 Subject: [PATCH 1/3] Backport Gary's commit adding the IMAGEFORMAT=none to support generating a single rootfs. --- debian/changelog | 8 ++++++++ live-build/auto/config | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/debian/changelog b/debian/changelog index 9fb54059..66fb3545 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +livecd-rootfs (2.408.23) UNRELEASED; urgency=medium + + [ Gary Wang ] + * Add the IMAGEFORMAT=none to support generating a single rootfs + (LP: #1730642) + + -- Ɓukasz 'sil2100' Zemczak Wed, 08 Nov 2017 12:33:37 +0100 + livecd-rootfs (2.408.22) xenial; urgency=medium * Make sure to remove any initramfs that was generated in a minimized diff --git a/live-build/auto/config b/live-build/auto/config index fca41dc5..8477598b 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -139,6 +139,9 @@ case $IMAGEFORMAT in PREINSTALLED=true ;; + none) + OPTS="${OPTS:+$OPTS }--chroot-filesystem $IMAGEFORMAT" + ;; *) case $PROJECT in ubuntu-server|ubuntu-touch|ubuntu-touch-custom) @@ -815,6 +818,9 @@ EOF ubuntu-touch:*|ubuntu-touch-custom:*|ubuntu-core:system-image|ubuntu-desktop-next:system-image|ubuntu-cpc:*) cp -af /usr/share/livecd-rootfs/live-build/${PROJECT}/* \ config/ + if [ "$IMAGEFORMAT" = none ]; then + rm -f config/hooks/*.binary* + fi ;; esac From 67dab61787a05ac9f890563c631c36487a442872 Mon Sep 17 00:00:00 2001 From: Christopher Glass Date: Fri, 10 Nov 2017 18:41:57 +0100 Subject: [PATCH 2/3] Backport "minimized round 2" changes from trunk to Xenial (LP: #1731492) --- debian/changelog | 6 ++++++ live-build/auto/build | 4 ++++ live-build/auto/config | 1 + .../ubuntu-cpc/hooks/999-cpc-fixes.chroot | 21 +++++++++++++++++++ 4 files changed, 32 insertions(+) diff --git a/debian/changelog b/debian/changelog index 66fb3545..b62f3d4b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.408.24) UNRELEASED; urgency=medium + + * Backport "minimized round 2" changes from trunk to Xenial (LP: #1731492) + + -- Christopher Glass (Ubuntu) Fri, 10 Nov 2017 18:39:52 +0100 + livecd-rootfs (2.408.23) UNRELEASED; urgency=medium [ Gary Wang ] diff --git a/live-build/auto/build b/live-build/auto/build index 8f4b0bd5..12a0aac4 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -166,6 +166,10 @@ EOF rm -f chroot/boot/initrd.img-* 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 8477598b..3eb8dae8 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -676,6 +676,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/999-cpc-fixes.chroot b/live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot index 3b2a3492..91fdc554 100755 --- a/live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot +++ b/live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot @@ -160,6 +160,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 run-one apport-symptoms \ + ubuntu-cloudimage-keyring file + + _xchroot "${rootd}" apt clean +fi + #### END COMMON ARCH FUNCTIONS From 9f56606604ded2244211db1912a478fb75bf0608 Mon Sep 17 00:00:00 2001 From: Christopher Glass Date: Tue, 14 Nov 2017 08:45:03 +0100 Subject: [PATCH 3/3] * 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. (expanded changelog) --- debian/changelog | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/debian/changelog b/debian/changelog index b62f3d4b..db0243b3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,18 @@ livecd-rootfs (2.408.24) UNRELEASED; urgency=medium * Backport "minimized round 2" changes from trunk to Xenial (LP: #1731492) + * 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. -- Christopher Glass (Ubuntu) Fri, 10 Nov 2017 18:39:52 +0100