summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2010-12-06 15:10:35 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2010-12-06 15:10:35 -0800
commit3ef1d674806734c2e237a54815ea5c077ce8c344 (patch)
tree39ea7f414d1c195aca8fde0de7f49970718e8e0e
parent29ead58259d47997d7caedf9080f4a2f9c9bd358 (diff)
parent4985f06f4e96351c77b88b20bc9ded65daefcd3e (diff)
downloadbuild-3ef1d674806734c2e237a54815ea5c077ce8c344.zip
build-3ef1d674806734c2e237a54815ea5c077ce8c344.tar.gz
build-3ef1d674806734c2e237a54815ea5c077ce8c344.tar.bz2
am 4985f06f: Merge "Make image-size-from-data-size not use hard coded values."
* commit '4985f06f4e96351c77b88b20bc9ded65daefcd3e': Make image-size-from-data-size not use hard coded values.
-rw-r--r--core/Makefile4
-rw-r--r--core/definitions.mk5
2 files changed, 6 insertions, 3 deletions
diff --git a/core/Makefile b/core/Makefile
index f87f8ca..e11234e 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -690,13 +690,15 @@ ifneq ($(BOARD_NAND_PAGE_SIZE),)
mkyaffs2_extra_flags := -c $(BOARD_NAND_PAGE_SIZE)
else
mkyaffs2_extra_flags :=
+BOARD_NAND_PAGE_SIZE := 2048
endif
ifneq ($(BOARD_NAND_SPARE_SIZE),)
mkyaffs2_extra_flags += -s $(BOARD_NAND_SPARE_SIZE)
+else
+BOARD_NAND_SPARE_SIZE := 64
endif
-
# -----------------------------------------------------------------
# system image
#
diff --git a/core/definitions.mk b/core/definitions.mk
index be427b6..c762711 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1654,10 +1654,11 @@ endif
# Convert a partition data size (eg, as reported in /proc/mtd) to the
# size of the image used to flash that partition (which includes a
-# 64-byte spare area for each 2048-byte page).
+# spare area for each page).
# $(1): the partition data size
define image-size-from-data-size
-$(shell echo $$(($(1) / 2048 * (2048+64))))
+$(shell echo $$(($(1) / $(BOARD_NAND_PAGE_SIZE) * \
+ ($(BOARD_NAND_PAGE_SIZE)+$(BOARD_NAND_SPARE_SIZE)))))
endef
# $(1): The file(s) to check (often $@)