summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJustin Ho <justinho@google.com>2011-08-31 08:36:46 -0700
committerJustin Ho <justinho@google.com>2011-08-31 16:29:31 -0700
commitb139b6a1a550daa0df4e670ab3fa550be8204d2f (patch)
tree732cd857ff1d56b3241d97779bb9a0dd7f52218d /core
parent17a27047bb4d5f255b1c1c55864dae4425e9d6ee (diff)
downloadbuild-b139b6a1a550daa0df4e670ab3fa550be8204d2f.zip
build-b139b6a1a550daa0df4e670ab3fa550be8204d2f.tar.gz
build-b139b6a1a550daa0df4e670ab3fa550be8204d2f.tar.bz2
Calculate system image size at build, for harvesting later
Change-Id: I6bfcde0e5df3f6da453f28354839e356f9191c0e
Diffstat (limited to 'core')
-rw-r--r--core/Makefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/Makefile b/core/Makefile
index c5e30c2..8d6fab7 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -590,6 +590,13 @@ ifeq ($(INTERNAL_USERIMAGES_USE_EXT),true)
INTERNAL_USERIMAGES_DEPS := $(MKEXTUSERIMG) $(MAKE_EXT4FS)
INTERNAL_USERIMAGES_BINARY_PATHS := $(sort $(dir $(INTERNAL_USERIMAGES_DEPS)))
+# Calculate size of all files for device image and report on filesizes
+# $(1): src directory
+define calculate-userimage-ext-size
+ @echo Calculating image size...
+ @find $(1) -type f | xargs du -k | sort -gr > $(PRODUCT_OUT)/imagesize-report.txt
+endef
+
# $(1): src directory
# $(2): output file
# $(3): mount point
@@ -738,6 +745,7 @@ ifeq ($(INTERNAL_USERIMAGES_USE_EXT),true)
# $(1): output file
define build-systemimage-target
@echo "Target system fs image: $(1)"
+ $(call calculate-userimage-ext-size,$(TARGET_OUT))
$(call build-userimage-ext-target,$(TARGET_OUT),$(1),system,$(INTERNAL_USERIMAGES_EXT_VARIANT),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE))
endef