Merge "Modify INTERNAL_KERNEL_CMDLINE instead of BOARD_ variant"
diff --git a/core/Makefile b/core/Makefile
index 9a2d985..44f01ba 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -2190,6 +2190,19 @@
$(INSTALLED_SYSTEMIMAGE_TARGET): $(BUILT_SYSTEMIMAGE) $(RECOVERY_FROM_BOOT_PATCH)
@echo "Install system fs image: $@"
$(copy-file-to-target)
+ifdef RECOVERY_FROM_BOOT_PATCH
+ifeq ($(PRODUCT_USE_DYNAMIC_PARTITION_SIZE),true)
+ifeq ($(BOARD_SYSTEMIMAGE_PARTITION_SIZE),)
+ # system image size is dynamic, hence system_size in generated_system_image_info.txt does not
+ # have room for recovery from boot patch. Increase system_size so that check-all-partition-sizes
+ # accounts for the size of the patch.
+ sed -i'.bak' -e 's/^system_size=.*$$/system_size='"$$(( \
+ $(call read-image-prop-dictionary,$(systemimage_intermediates)/generated_system_image_info.txt,system_size) + \
+ $$($(call get-file-size,$(RECOVERY_FROM_BOOT_PATCH))) ))"'/' \
+ $(systemimage_intermediates)/generated_system_image_info.txt
+endif
+endif
+endif
$(hide) $(call assert-max-image-size,$@ $(RECOVERY_FROM_BOOT_PATCH),\
$(call read-image-prop-dictionary,\
$(systemimage_intermediates)/generated_system_image_info.txt,system_size))
diff --git a/target/board/BoardConfigEmuCommon.mk b/target/board/BoardConfigEmuCommon.mk
index 1e325b9..3e8d342 100644
--- a/target/board/BoardConfigEmuCommon.mk
+++ b/target/board/BoardConfigEmuCommon.mk
@@ -20,10 +20,10 @@
# the GLES renderer disables itself if host GL acceleration isn't available.
USE_OPENGL_RENDERER := true
-# ~100 MB vendor image. Please adjust system image / vendor image sizes
+# ~140 MB vendor image. Please adjust system image / vendor image sizes
# when finalizing them. The partition size needs to be a multiple of image
# block size: 4096.
-BOARD_VENDORIMAGE_PARTITION_SIZE := 100003840
+BOARD_VENDORIMAGE_PARTITION_SIZE := 140963840
BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
BOARD_FLASH_BLOCK_SIZE := 512
DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml