]> Git Repo - buildroot-mgba.git/commitdiff
fs: remove intermediate artefacts
authorYann E. MORIN <[email protected]>
Sat, 31 Mar 2018 09:06:01 +0000 (11:06 +0200)
committerPeter Korsgaard <[email protected]>
Sat, 31 Mar 2018 18:53:06 +0000 (20:53 +0200)
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 meaningful 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" <[email protected]>
Cc: Thomas Petazzoni <[email protected]>
Cc: Arnout Vandecappelle <[email protected]>
Tested-by: Matt Weber <[email protected]>
Signed-off-by: Peter Korsgaard <[email protected]>
Makefile
fs/common.mk

index b34dd78c7327cb47a19cc07399fe2dd4cee98981..6a3d038e6687f1026f8ad46ec3dba9532dd407d1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -753,6 +753,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))
index ba2faa7759cc84378a6baac9b6f1054f328dd557..9baf36772927a587ecb1761cc4aa6c40c93e61f2 100644 (file)
@@ -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)
 
 rootfs-common-show-depends:
        @echo $(ROOTFS_COMMON_DEPENDENCIES)
@@ -153,6 +154,7 @@ $$(BINARIES_DIR)/rootfs.$(1): $$(ROOTFS_$(2)_DEPENDENCIES)
        $$(call PRINTF,$$(ROOTFS_$(2)_CMD)) >> $$(FAKEROOT_SCRIPT)
        chmod a+x $$(FAKEROOT_SCRIPT)
        PATH=$$(BR_PATH) $$(HOST_DIR)/bin/fakeroot -- $$(FAKEROOT_SCRIPT)
+       $(Q)rm -rf $$(TARGET_DIR)
 ifneq ($$(ROOTFS_$(2)_COMPRESS_CMD),)
        PATH=$$(BR_PATH) $$(ROOTFS_$(2)_COMPRESS_CMD) $$@ > $$@$$(ROOTFS_$(2)_COMPRESS_EXT)
 endif
This page took 0.036352 seconds and 4 git commands to generate.