# $(2): if set to 1, use LZMA
# $(3): other parameters passed to subdir make
define build
- args="IMG_SIZE=$(call img_size,$(1)) \
+ args="IMG_SIZE=$$((1024*$(call img_size,$(1)))) \
IMG_LZMA=$(call is_one,$(2)) \
$(strip $(3))"; \
cd $(SOURCE_DIR) && \
# Some variables passed as arguments in cmd
ifneq ($(IMG_SIZE),)
- CONFIG_MAX_UBOOT_SIZE_KB = $(IMG_SIZE)
- export CONFIG_MAX_UBOOT_SIZE_KB
+ CONFIG_MAX_UBOOT_SIZE = $(IMG_SIZE)
+ export CONFIG_MAX_UBOOT_SIZE
endif
ifeq ($(IMG_LZMA),1)
$(call echo_yellow, Custom recovery web:\tno) \
)
- $(if $(CONFIG_MAX_UBOOT_SIZE_KB), \
- $(call echo_yellow, Image size limit:\t$(CONFIG_MAX_UBOOT_SIZE_KB) KB),
+ $(if $(CONFIG_MAX_UBOOT_SIZE), \
+ $(call echo_yellow, Image size limit:\t$$(($(CONFIG_MAX_UBOOT_SIZE) / 1024)) KB),
$(call echo_yellow, Image size limit:\tnot specified)
)
$(if $(3),$(call define_add,CONFIG_GPIO_RESET_BTN,$(strip $(3))))
$(if $(filter $(4),1),$(call define_add,CONFIG_GPIO_RESET_BTN_ACTIVE_LOW,1))
- $(if $(CONFIG_MAX_UBOOT_SIZE_KB), \
- $(call define_add,CONFIG_MAX_UBOOT_SIZE_KB,$(CONFIG_MAX_UBOOT_SIZE_KB))
+ $(if $(CONFIG_MAX_UBOOT_SIZE), \
+ $(call define_add,CONFIG_MAX_UBOOT_SIZE,$(CONFIG_MAX_UBOOT_SIZE))
)
$(if $(filter $(CONFIG_SKIP_LOWLEVEL_INIT),1), \
// has correct size (for every type of upgrade)
// U-Boot
- if((webfailsafe_upgrade_type == WEBFAILSAFE_UPGRADE_TYPE_UBOOT) && (hs->upload_total > (CONFIG_MAX_UBOOT_SIZE_KB * 1024))){
+ if((webfailsafe_upgrade_type == WEBFAILSAFE_UPGRADE_TYPE_UBOOT) && (hs->upload_total > CONFIG_MAX_UBOOT_SIZE)){
printf("## Error: file too big!\n");
webfailsafe_upload_failed = 1;
printf("Data will be downloaded at 0x%X in RAM\n", CONFIG_LOADADDR);
}
- memset((void *)webfailsafe_data_pointer, 0xFF, (CONFIG_MAX_UBOOT_SIZE_KB * 1024));
+ memset((void *)webfailsafe_data_pointer, 0xFF, CONFIG_MAX_UBOOT_SIZE);
if(httpd_findandstore_firstchunk()){
data_start_found = 1;