am 742fa575
: fix problems with new image size calculations
Merge commit '742fa575d09272f1e06616fc208a1e08830c8f82' * commit '742fa575d09272f1e06616fc208a1e08830c8f82': fix problems with new image size calculations
This commit is contained in:
committed by
The Android Open Source Project
commit
b17199ee41
@@ -10,7 +10,7 @@ $(combo_target)AR := $(AR)
|
|||||||
ifeq ($(combo_target),HOST_)
|
ifeq ($(combo_target),HOST_)
|
||||||
# $(1): The file to check
|
# $(1): The file to check
|
||||||
define get-file-size
|
define get-file-size
|
||||||
stat --format "%s" "$(1)"
|
stat --format "%s" "$(1)" | tr -d '\n'
|
||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@@ -1558,8 +1558,8 @@ endef
|
|||||||
# next whole flash block size.
|
# next whole flash block size.
|
||||||
define assert-max-file-size
|
define assert-max-file-size
|
||||||
$(if $(2), \
|
$(if $(2), \
|
||||||
size=$$(for i in $(1); do $(call get-file-size,$$i); done); \
|
size=$$(for i in $(1); do $(call get-file-size,$$i); echo +; done; echo 0); \
|
||||||
total=$$(( $$( echo "$$size" | tr '\n' + ; echo 0 ) )); \
|
total=$$(( $$( echo "$$size" ) )); \
|
||||||
printname=$$(echo -n "$(1)" | tr " " +); \
|
printname=$$(echo -n "$(1)" | tr " " +); \
|
||||||
echo "$$printname total size is $$total"; \
|
echo "$$printname total size is $$total"; \
|
||||||
img_blocksize=$(call image-size-from-data-size,$(BOARD_FLASH_BLOCK_SIZE)); \
|
img_blocksize=$(call image-size-from-data-size,$(BOARD_FLASH_BLOCK_SIZE)); \
|
||||||
@@ -1570,8 +1570,7 @@ $(if $(2), \
|
|||||||
if [ "$$total" -gt "$$maxsize" ]; then \
|
if [ "$$total" -gt "$$maxsize" ]; then \
|
||||||
echo "error: $$printname too large ($$total > [$(2) - $$reserve])"; \
|
echo "error: $$printname too large ($$total > [$(2) - $$reserve])"; \
|
||||||
false; \
|
false; \
|
||||||
fi; \
|
elif [ "$$total" -gt $$((maxsize - 32768)) ]; then \
|
||||||
if [ "$$total" -gt $$((maxsize - 32768)) ]; then \
|
|
||||||
echo "WARNING: $$printname approaching size limit ($$total now; limit $$maxsize)"; \
|
echo "WARNING: $$printname approaching size limit ($$total now; limit $$maxsize)"; \
|
||||||
fi \
|
fi \
|
||||||
, \
|
, \
|
||||||
|
Reference in New Issue
Block a user