aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Levillain <rpl@google.com>2019-10-04 14:06:26 +0100
committerRoland Levillain <rpl@google.com>2019-10-04 18:35:49 +0100
commitb3a503df7fc569207a349882b8c74f744323df08 (patch)
tree7c137e47b1e90ee36b7f414f014020a159f1732d
parentf89f29d669387d0376b0594b0ee1a1447cd09906 (diff)
downloadbuild-b3a503df7fc569207a349882b8c74f744323df08.tar.gz
Introduce build variable `OVERRIDE_TARGET_FLATTEN_APEX`.
When `OVERRIDE_TARGET_FLATTEN_APEX` is defined (e.g. set in the environment), `TARGET_FLATTEN_APEX` is forcibly assigned its value. This is useful to enable/disable APEX flattening from the command line (thus ignoring the product's default configuration), for testing purposes. Note: Previously it was possible to set `TARGET_FLATTEN_APEX` directly and have the same effect, but recent changes in the build configuration now prevent that option. Test: Check that: export OVERRIDE_TARGET_FLATTEN_APEX=true \ && . ./build/envsetup.sh \ && lunch aosp_walleye-userdebug \ && export OVERRIDE_TARGET_FLATTEN_APEX=true \ && build/soong/soong_ui.bash --dumpvar-mode TARGET_FLATTEN_APEX returns: true Bug: 121117762 Change-Id: Ib9ccae38430340de38e4758b4f55df2c65ea60d5
-rw-r--r--core/board_config.mk12
-rw-r--r--target/product/updatable_apex.mk6
2 files changed, 14 insertions, 4 deletions
diff --git a/core/board_config.mk b/core/board_config.mk
index 4f7354757c..3127c19e13 100644
--- a/core/board_config.mk
+++ b/core/board_config.mk
@@ -584,8 +584,16 @@ endif
# APEXes are by default flattened, i.e. non-updatable.
# It can be unflattened (and updatable) by inheriting from
# updatable_apex.mk
-ifeq (,$(TARGET_FLATTEN_APEX))
-TARGET_FLATTEN_APEX := true
+#
+# APEX flattening can also be forcibly enabled (resp. disabled) by
+# setting OVERRIDE_TARGET_FLATTEN_APEX to true (resp. false), e.g. by
+# setting the OVERRIDE_TARGET_FLATTEN_APEX environment variable.
+ifdef OVERRIDE_TARGET_FLATTEN_APEX
+ TARGET_FLATTEN_APEX := $(OVERRIDE_TARGET_FLATTEN_APEX)
+else
+ ifeq (,$(TARGET_FLATTEN_APEX))
+ TARGET_FLATTEN_APEX := true
+ endif
endif
ifeq (,$(TARGET_BUILD_APPS))
diff --git a/target/product/updatable_apex.mk b/target/product/updatable_apex.mk
index a9f4baf30b..bdaf545174 100644
--- a/target/product/updatable_apex.mk
+++ b/target/product/updatable_apex.mk
@@ -16,5 +16,7 @@
# Inherit this when the target needs to support updating APEXes
-PRODUCT_PROPERTY_OVERRIDES := ro.apex.updatable=true
-TARGET_FLATTEN_APEX := false
+ifneq ($(OVERRIDE_TARGET_FLATTEN_APEX),true)
+ PRODUCT_PROPERTY_OVERRIDES := ro.apex.updatable=true
+ TARGET_FLATTEN_APEX := false
+endif