From f129e5797a54185f07c9c065105fd83f94e4a89a Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Mon, 17 Dec 2018 13:37:36 +1300 Subject: [PATCH] A few simple tweaks to reduce size of live servers installer.squashfs - Do not run apt-get update (which can bring in package lists if we are unlucky wrt publisher schedules). - Run apt-get clean to clear out downloaded debs of curtin/casper and dependencies. - Do not install user-setup. - Use the core snap from the base filesystem if present. --- debian/changelog | 7 +++++++ .../hooks/032-installer-squashfs.binary | 17 ++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index c2d5c8b7..360155ed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,13 @@ livecd-rootfs (2.525.13) UNRELEASED; urgency=medium /lib/modules from a squashfs on the ISO. * Do no install openssh-server in the base filsystem for the live server installer. + * A few simple tweaks to reduce size of live servers installer.squashfs: + - Do not run apt-get update (which can bring in package lists if we are + unlucky wrt publisher schedules). + - Run apt-get clean to clear out downloaded debs of curtin/casper and + dependencies. + - Do not install user-setup. + - Use the core snap from the base filesystem if present. -- Michael Hudson-Doyle Thu, 13 Dec 2018 15:22:15 +1300 diff --git a/live-build/ubuntu-server/hooks/032-installer-squashfs.binary b/live-build/ubuntu-server/hooks/032-installer-squashfs.binary index 63edba4f..d08b4cd9 100755 --- a/live-build/ubuntu-server/hooks/032-installer-squashfs.binary +++ b/live-build/ubuntu-server/hooks/032-installer-squashfs.binary @@ -51,8 +51,9 @@ EOF # Install any requirements for the installer, for things we don't want # to see on the installed system -chroot $INSTALLER_ROOT apt-get update -chroot $INSTALLER_ROOT apt-get -y install user-setup curtin lupin-casper +chroot $INSTALLER_ROOT apt-get -y install curtin lupin-casper +chroot $INSTALLER_ROOT apt-get clean + # For bug #1743643 "Install to dirty disk with swap fails" remove the # "helpful" casper script that mounts any swap partitions it finds. @@ -65,15 +66,17 @@ touch $INSTALLER_ROOT/etc/cloud/cloud-init.disabled chroot $INSTALLER_ROOT mkdir -p /var/lib/snapd/seed/snaps /var/lib/snapd/seed/assertions chroot $INSTALLER_ROOT sh -c ' set -x; -cd /var/lib/snapd/seed; -sudo SNAPPY_STORE_NO_CDN=1 snap download core; -sudo SNAPPY_STORE_NO_CDN=1 snap download subiquity; +mkdir -p /var/lib/snapd/seed/snaps/ +cd /var/lib/snapd/seed/snaps/; +if [ ! -e core_*.snap ]; then + SNAPPY_STORE_NO_CDN=1 snap download core +fi +SNAPPY_STORE_NO_CDN=1 snap download subiquity; -CORE_SNAP=$(ls -1 core*.snap); +CORE_SNAP=$(ls -1 core_*.snap); SUBIQUITY_SNAP=$(ls -1 subiquity*.snap); mv *.assert /var/lib/snapd/seed/assertions/; -mv *.snap /var/lib/snapd/seed/snaps/; cat < /var/lib/snapd/seed/seed.yaml snaps: