From a7b8928928710d8d4a62f6b3dfc1f3da1318823e Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 8 May 2019 10:49:51 +1200 Subject: [PATCH] Remove device nodes later for ubuntu-base:minimized (i.e. docker) builds. (LP: #1828118) --- debian/changelog | 7 +++++++ live-build/auto/build | 22 +++++++++++----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/debian/changelog b/debian/changelog index a9ed6e8a..5cccfc1e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.542.3) UNRELEASED; urgency=medium + + * Remove device nodes later for ubuntu-base:minimized (i.e. docker) builds. + (LP: #1828118) + + -- Michael Hudson-Doyle Wed, 08 May 2019 10:48:39 +1200 + livecd-rootfs (2.542.2) cosmic; urgency=medium * Remove crufty files after minimize-manual (LP: #1826377) diff --git a/live-build/auto/build b/live-build/auto/build index 31fe00b8..eec51250 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -259,17 +259,6 @@ EOF apt-get -y --purge autoremove" fi - if [ "${PROJECT}:${SUBPROJECT:-}" = "ubuntu-base:minimized" ]; then - # Save even more size by removing apt lists (that are currently removed - # downstream anyway) - rm -rf chroot/var/lib/apt/lists/* - # Having device notes in the docker image can cause problems - # (https://github.com/tianon/docker-brew-ubuntu-core/issues/62) - # so remove them. We only do this for docker out of an - # abundance of caution. - rm -rf chroot/dev/* - fi - if [ -f config/universe-enabled ]; then # This is cargo-culted almost verbatim (with some syntax changes for @@ -452,6 +441,17 @@ EOF # 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 + # For the docker images we remove even more stuff. + if [ "${PROJECT}:${SUBPROJECT:-}" = "ubuntu-base:minimized" ]; then + # Remove apt lists (that are currently removed downstream + # anyway) + rm -rf chroot/var/lib/apt/lists/* + # Having device nodes in the docker image can cause problems + # (https://github.com/tianon/docker-brew-ubuntu-core/issues/62) + # so remove them. We only do this for docker out of an + # abundance of caution. + rm -rf chroot/dev/* + fi lb binary "$@" touch binary.success