From 6730f9017eaef93ff7cec8514849e4d6e2047a5b Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Tue, 17 Oct 2017 09:50:08 -0700 Subject: [PATCH] Fix an issue in assert-max-image-size. When building the recovery image on marlin (m bootimage): ----- Making recovery image ------ Copying baseline ramdisk... Modifying ramdisk contents... /bin/bash: line 0: [: 0x02000000: integer expression expected ----- Made recovery image: out/target/product/marlin/boot.img -------- Because if -gt doesn't like hexadecimal numbers. Fix the issue by doing a dummy arithmetic to get integer $$maxsize. Test: `m bootimage` with aosp_marlin-userdebug. Also change the BOARD_BOOTIMAGE_PARTITION_SIZE closer to the actual size to trigger the different size check paths. Change-Id: I75c7727664d7255b9c18f57ae38076ff90b8a957 --- core/definitions.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/definitions.mk b/core/definitions.mk index cb0a6bb22e..0fa96845a4 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -2772,7 +2772,7 @@ $(if $(2), \ size=$$(for i in $(1); do $(call get-file-size,$$i); echo +; done; echo 0); \ total=$$(( $$( echo "$$size" ) )); \ printname=$$(echo -n "$(1)" | tr " " +); \ - maxsize=$(2); \ + maxsize=$$(($(2))); \ if [ "$$total" -gt "$$maxsize" ]; then \ echo "error: $$printname too large ($$total > $$maxsize)"; \ false; \