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
This commit is contained in:
Tao Bao 2017-10-17 09:50:08 -07:00
parent 367da66255
commit 6730f9017e

View file

@ -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; \