Merge commit 'ed96e88850b471d4ebbbdd1c2acd3efdc6b19a10' * commit 'ed96e88850b471d4ebbbdd1c2acd3efdc6b19a10': turn down allowed image size
This commit is contained in:
commit
a85ff47d45
2 changed files with 14 additions and 7 deletions
|
@ -300,7 +300,7 @@ else # TARGET_BOOTIMAGE_USE_EXT2 != true
|
|||
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES)
|
||||
$(call pretty,"Target boot image: $@")
|
||||
$(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) --output $@
|
||||
$(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE))
|
||||
$(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE),raw)
|
||||
endif # TARGET_BOOTIMAGE_USE_EXT2
|
||||
|
||||
else # TARGET_NO_KERNEL
|
||||
|
@ -578,7 +578,7 @@ $(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) \
|
|||
$(MKBOOTFS) $(TARGET_RECOVERY_ROOT_OUT) | $(MINIGZIP) > $(recovery_ramdisk)
|
||||
$(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) --output $@
|
||||
@echo ----- Made recovery image -------- $@
|
||||
$(hide) $(call assert-max-image-size,$@,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE))
|
||||
$(hide) $(call assert-max-image-size,$@,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw)
|
||||
|
||||
else
|
||||
INSTALLED_RECOVERYIMAGE_TARGET :=
|
||||
|
@ -663,7 +663,7 @@ endif
|
|||
$(INSTALLED_SYSTEMIMAGE): $(BUILT_SYSTEMIMAGE) $(RECOVERY_FROM_BOOT_PATCH) | $(ACP)
|
||||
@echo "Install system fs image: $@"
|
||||
$(copy-file-to-target)
|
||||
$(hide) $(call assert-max-image-size,$@ $(RECOVERY_FROM_BOOT_PATCH),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE))
|
||||
$(hide) $(call assert-max-image-size,$@ $(RECOVERY_FROM_BOOT_PATCH),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE),yaffs)
|
||||
|
||||
systemimage: $(INSTALLED_SYSTEMIMAGE)
|
||||
|
||||
|
@ -672,7 +672,7 @@ systemimage-nodeps snod: $(filter-out systemimage-nodeps snod,$(MAKECMDGOALS)) \
|
|||
| $(INTERNAL_MKUSERFS)
|
||||
@echo "make $@: ignoring dependencies"
|
||||
$(call build-systemimage-target,$(INSTALLED_SYSTEMIMAGE))
|
||||
$(hide) $(call assert-max-image-size,$(INSTALLED_SYSTEMIMAGE),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE))
|
||||
$(hide) $(call assert-max-image-size,$(INSTALLED_SYSTEMIMAGE),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE),yaffs)
|
||||
|
||||
#######
|
||||
## system tarball
|
||||
|
@ -709,7 +709,7 @@ define build-userdataimage-target
|
|||
$(call pretty,"Target userdata fs image: $(INSTALLED_USERDATAIMAGE_TARGET)")
|
||||
@mkdir -p $(TARGET_OUT_DATA)
|
||||
$(call build-userimage-ext2-target,$(TARGET_OUT_DATA),$(INSTALLED_USERDATAIMAGE_TARGET),userdata,)
|
||||
$(hide) $(call assert-max-image-size,$(INSTALLED_USERDATAIMAGE_TARGET),$(BOARD_USERDATAIMAGE_PARTITION_SIZE))
|
||||
$(hide) $(call assert-max-image-size,$(INSTALLED_USERDATAIMAGE_TARGET),$(BOARD_USERDATAIMAGE_PARTITION_SIZE),yaffs)
|
||||
endef
|
||||
|
||||
else # TARGET_USERIMAGES_USE_EXT2 != true
|
||||
|
@ -719,7 +719,7 @@ define build-userdataimage-target
|
|||
$(call pretty,"Target userdata fs image: $(INSTALLED_USERDATAIMAGE_TARGET)")
|
||||
@mkdir -p $(TARGET_OUT_DATA)
|
||||
$(hide) $(MKYAFFS2) -f $(TARGET_OUT_DATA) $(INSTALLED_USERDATAIMAGE_TARGET)
|
||||
$(hide) $(call assert-max-image-size,$(INSTALLED_USERDATAIMAGE_TARGET),$(BOARD_USERDATAIMAGE_PARTITION_SIZE))
|
||||
$(hide) $(call assert-max-image-size,$(INSTALLED_USERDATAIMAGE_TARGET),$(BOARD_USERDATAIMAGE_PARTITION_SIZE),yaffs)
|
||||
endef
|
||||
endif # TARGET_USERIMAGES_USE_EXT2
|
||||
|
||||
|
|
|
@ -1574,6 +1574,7 @@ endef
|
|||
|
||||
# $(1): The file(s) to check (often $@)
|
||||
# $(2): The maximum total image size, in decimal bytes
|
||||
# $(3): the type of filesystem "yaffs" or "raw"
|
||||
#
|
||||
# If $(2) is empty, evaluates to "true"
|
||||
#
|
||||
|
@ -1587,9 +1588,15 @@ $(if $(2), \
|
|||
printname=$$(echo -n "$(1)" | tr " " +); \
|
||||
echo "$$printname total size is $$total"; \
|
||||
img_blocksize=$(call image-size-from-data-size,$(BOARD_FLASH_BLOCK_SIZE)); \
|
||||
if [ "$(3)" == "yaffs" ]; then \
|
||||
reservedblocks=5; \
|
||||
else \
|
||||
reselvedblocks=0; \
|
||||
fi; \
|
||||
twoblocks=$$((img_blocksize * 2)); \
|
||||
onepct=$$((((($(2) / 100) - 1) / img_blocksize + 1) * img_blocksize)); \
|
||||
reserve=$$((twoblocks > onepct ? twoblocks : onepct)); \
|
||||
reserve=$$(((twoblocks > onepct ? twoblocks : onepct) + \
|
||||
reservedblocks * img_blocksize)); \
|
||||
maxsize=$$(($(2) - reserve)); \
|
||||
if [ "$$total" -gt "$$maxsize" ]; then \
|
||||
echo "error: $$printname too large ($$total > [$(2) - $$reserve])"; \
|
||||
|
|
Loading…
Reference in a new issue