From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Korsgaard Date: Sat, 31 Mar 2018 19:53:36 +0200 Subject: [Buildroot] [PATCH 15/15 v4] fs: remove intermediate artefacts In-Reply-To: (Yann E. MORIN's message of "Sat, 31 Mar 2018 11:06:01 +0200") References: Message-ID: <87sh8gt9lr.fsf@dell.be.48ers.dk> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net >>>>> "Yann" == Yann E MORIN writes: > Each of the intermediate, per-rootfs target directories, as well as the > intermediate tarball, can take quite some place, and is mostly a > duplication of what's already in target/. The only delta, if any, would > be the tweaks made by the filesystem image generations, but those tweaks > are most probably only meaningfull when seen as root. > We normally do not remove intermediate files, but those can be quite > large, and are not directly usable by, nor accessible to the user. > So, get rid of them once the filesystem has been generated. > This does not need to be done in fakeroot. > Signed-off-by: "Yann E. MORIN" > Cc: Thomas Petazzoni > Cc: Arnout Vandecappelle > Tested-by: Matt Weber > --- > Makefile | 1 + > fs/common.mk | 2 ++ > 2 files changed, 3 insertions(+) > diff --git a/Makefile b/Makefile > index 9fba7a3ed8..96c2d200a3 100644 > --- a/Makefile > +++ b/Makefile > @@ -756,6 +756,7 @@ endif > .PHONY: target-post-image > target-post-image: $(TARGETS_ROOTFS) target-finalize > + @rm -f $(ROOTFS_COMMON_TAR) > @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \ > $(call MESSAGE,"Executing post-image script $(s)"); \ > $(EXTRA_ENV) $(s) $(BINARIES_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep)) > diff --git a/fs/common.mk b/fs/common.mk > index bacc98ec68..2ee130ee08 100644 > --- a/fs/common.mk > +++ b/fs/common.mk > @@ -96,6 +96,7 @@ endif > $(call PRINTF,$(ROOTFS_COMMON_TAR_CMD)) >> $(FAKEROOT_SCRIPT) > chmod a+x $(FAKEROOT_SCRIPT) > PATH=$(BR_PATH) $(HOST_DIR)/bin/fakeroot -- $(FAKEROOT_SCRIPT) > + $(Q)rm -rf $(TARGET_DIR) This throws away the output/target copy on each invocation, so there is not much sense in using rsync to create it and we could just use cp -a, but OK, that can be done later. -- Bye, Peter Korsgaard