aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2010-12-06 14:58:08 -0800
committerAndroid Code Review <code-review@android.com>2010-12-06 14:58:08 -0800
commit4985f06f4e96351c77b88b20bc9ded65daefcd3e (patch)
treef6e25b6d112b575c3c7445d7737381e10b61c20a
parentd2dd86529982cd05b4010248cea368fbef763ef2 (diff)
parent9cb8c2835232c8dc99cecca85a7e99bdee7109a9 (diff)
downloadbuild-froyo-plus-aosp.tar.gz
Merge "Make image-size-from-data-size not use hard coded values."tools_r8froyo-plus-aosp
-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 9b0b8e7b8e..515f91d807 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -621,13 +621,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 yaffs image
#
diff --git a/core/definitions.mk b/core/definitions.mk
index 7e2d1fbfe5..8675f36e98 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1657,10 +1657,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 $@)