summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tao Bao <tbao@google.com> 2019-04-11 15:51:46 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2019-04-11 15:51:46 +0000
commitf1a8e74991801e14246f043468e54868d66c4763 (patch)
treed16dfe184cd6f5bb8c047c322895bf2435ddbb6d
parent20f6491dc611437286a40a0550476cf5da677238 (diff)
parent9be20c7650e140a1b2c30d2da2ed437b98772496 (diff)
Merge "Allow building generic OTA packages."
-rw-r--r--core/Makefile29
-rw-r--r--core/board_config.mk7
-rw-r--r--core/product.mk5
3 files changed, 29 insertions, 12 deletions
diff --git a/core/Makefile b/core/Makefile
index 0ccd719c60..78ef81fba1 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -3445,7 +3445,7 @@ ifeq ($(BUILD_OS),darwin)
build_ota_package := false
build_otatools_package := false
else
- # set build_ota_package, and allow opt-out below
+ # Set build_ota_package, and allow opt-out below.
build_ota_package := true
ifeq ($(TARGET_SKIP_OTA_PACKAGE),true)
build_ota_package := false
@@ -3456,20 +3456,22 @@ else
ifeq ($(TARGET_PRODUCT),sdk)
build_ota_package := false
endif
- ifneq ($(filter generic%,$(TARGET_DEVICE)),)
- build_ota_package := false
- endif
- ifeq ($(TARGET_NO_KERNEL),true)
- build_ota_package := false
- endif
- ifeq ($(recovery_fstab),)
- build_ota_package := false
- endif
ifeq ($(TARGET_BUILD_PDK),true)
build_ota_package := false
endif
-
- # set build_otatools_package, and allow opt-out below
+ ifneq ($(PRODUCT_BUILD_GENERIC_OTA_PACKAGE),true)
+ ifneq ($(filter generic%,$(TARGET_DEVICE)),)
+ build_ota_package := false
+ endif
+ ifeq ($(TARGET_NO_KERNEL),true)
+ build_ota_package := false
+ endif
+ ifeq ($(recovery_fstab),)
+ build_ota_package := false
+ endif
+ endif # PRODUCT_BUILD_GENERIC_OTA_PACKAGE
+
+ # Set build_otatools_package, and allow opt-out below.
build_otatools_package := true
ifeq ($(TARGET_SKIP_OTATOOLS_PACKAGE),true)
build_otatools_package := false
@@ -3925,6 +3927,9 @@ endif
$(hide) echo 'mkbootimg_version_args=$(INTERNAL_MKBOOTIMG_VERSION_ARGS)' >> $(zip_root)/META/misc_info.txt
$(hide) echo "multistage_support=1" >> $(zip_root)/META/misc_info.txt
$(hide) echo "blockimgdiff_versions=3,4" >> $(zip_root)/META/misc_info.txt
+ifeq ($(PRODUCT_BUILD_GENERIC_OTA_PACKAGE),true)
+ $(hide) echo "build_generic_ota_package=true" >> $(zip_root)/META/misc_info.txt
+endif
ifneq ($(OEM_THUMBPRINT_PROPERTIES),)
# OTA scripts are only interested in fingerprint related properties
$(hide) echo "oem_fingerprint_properties=$(OEM_THUMBPRINT_PROPERTIES)" >> $(zip_root)/META/misc_info.txt
diff --git a/core/board_config.mk b/core/board_config.mk
index 6f04fb370f..9ea3509cbb 100644
--- a/core/board_config.mk
+++ b/core/board_config.mk
@@ -475,6 +475,13 @@ ifeq ($(AB_OTA_UPDATER),true)
endif
endif
+# Sanity check for building generic OTA packages. Currently it only supports A/B OTAs.
+ifeq ($(PRODUCT_BUILD_GENERIC_OTA_PACKAGE),true)
+ ifneq ($(AB_OTA_UPDATER),true)
+ $(error PRODUCT_BUILD_GENERIC_OTA_PACKAGE with 'AB_OTA_UPDATER != true' is not supported)
+ endif
+endif
+
# Check BOARD_VNDK_VERSION
define check_vndk_version
$(eval vndk_path := prebuilts/vndk/v$(1)) \
diff --git a/core/product.mk b/core/product.mk
index 29bd1d1e40..777d2bc0f6 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -322,6 +322,11 @@ _product_var_list += \
# set this variable to prevent OTA failures.
_product_var_list += PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS
+# If set to true, this product builds a generic OTA package, which installs generic system images
+# onto matching devices. The product may only build a subset of system images (e.g. only
+# system.img), so devices need to install the package in a system-only OTA manner.
+_product_var_list += PRODUCT_BUILD_GENERIC_OTA_PACKAGE
+
# Whether any paths are excluded from being set XOM when ENABLE_XOM=true
_product_var_list += PRODUCT_XOM_EXCLUDE_PATHS
_product_var_list += PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES