Merge "Remove BPTTOOL variable" into main
diff --git a/core/release_config.mk b/core/release_config.mk
index 36882bb..a7b5b3f 100644
--- a/core/release_config.mk
+++ b/core/release_config.mk
@@ -133,6 +133,18 @@
)
FLAG_DECLARATION_FILES :=
+# Verify that all inherited/overridden release configs are declared.
+$(foreach config,$(_all_release_configs),\
+ $(foreach r,$(all_release_configs.$(r).OVERRIDES),\
+ $(if $(strip $(_all_release_configs.$(r).FILES)$(_all_release_configs.$(r).OVERRIDES)),,\
+ $(error Release config $(config) [declared in: $(_all_release_configs.$(r).DECLARED_IN)] inherits from non-existent $(r).)\
+)))
+# Verify that alias configs do not have config files.
+$(foreach r,$(_all_release_configs),\
+ $(if $(_all_release_configs.$(r).ALIAS),$(if $(_all_release_configs.$(r).FILES),\
+ $(error Alias release config "$(r)" may not specify release config files $(_all_release_configs.$(r).FILES))\
+)))
+
ifeq ($(TARGET_RELEASE),)
# We allow some internal paths to explicitly set TARGET_RELEASE to the
# empty string. For the most part, 'make' treats unset and empty string as
@@ -148,8 +160,12 @@
TARGET_RELEASE = trunk_staging
endif
-ifeq ($(filter $(_all_release_configs), $(TARGET_RELEASE)),)
- $(error No release config found for TARGET_RELEASE: $(TARGET_RELEASE). Available releases are: $(_all_release_configs))
+# During pass 1 of product config, using a non-existent release config is not an error.
+# We can safely assume that we are doing pass 1 if DUMP_MANY_VARS=="PRODUCT_RELEASE_CONFIG_MAPS".
+ifneq (PRODUCT_RELEASE_CONFIG_MAPS,$(DUMP_MANY_VARS))
+ ifeq ($(filter $(_all_release_configs), $(TARGET_RELEASE)),)
+ $(error No release config found for TARGET_RELEASE: $(TARGET_RELEASE). Available releases are: $(_all_release_configs))
+ endif
endif
# Choose flag files
@@ -177,7 +193,7 @@
define declare-release-config
$(error declare-release-config can only be called from inside release_config_map.mk files)
endef
-define apply-release-config-overrides
+define _apply-release-config-overrides
$(error invalid use of apply-release-config-overrides)
endef
@@ -192,12 +208,6 @@
endif
.KATI_READONLY := TARGET_RELEASE
-# Verify that alias configs do not have config files.
-$(foreach r,$(_all_release_configs),\
- $(if $(_all_release_configs.$(r).ALIAS),$(if $(_all_release_configs.$(r).FILES),\
- $(error Alias release config "$(r)" may not specify release config files $(_all_release_configs.$(r).FILES))\
-)))
-
$(foreach config, $(_all_release_configs), \
$(eval _all_release_configs.$(config).DECLARED_IN:= ) \
$(eval _all_release_configs.$(config).FILES:= ) \
diff --git a/core/release_config.scl b/core/release_config.scl
index 629e223..728fc1b 100644
--- a/core/release_config.scl
+++ b/core/release_config.scl
@@ -53,6 +53,7 @@
for t in _valid_types
],
},
+ "origin": {"type": "string"},
"declared_in": {"type": "string"},
},
"optional_keys": {
@@ -80,13 +81,14 @@
},
}
-def flag(name, partitions, default, *, appends = False):
+def flag(name, partitions, default, *, origin = "Unknown", appends = False):
"""Declare a flag.
Args:
name: name of the flag
partitions: the partitions where this should be recorded.
default: the default value of the flag.
+ origin: The origin of this flag.
appends: Whether new values should be append (not replace) the old.
Returns:
@@ -112,6 +114,7 @@
"partitions": partitions,
"default": default,
"appends": appends,
+ "origin": origin,
}
def value(name, value):
@@ -158,7 +161,10 @@
for key in "name", "partitions", "default", "appends":
if flag[key] != other[key]:
return False
- return True
+ # For now, allow Unknown to match any other origin.
+ if flag["origin"] == "Unknown" or other["origin"] == "Unknown":
+ return True
+ return flag["origin"] == other["origin"]
def release_config(all_flags, all_values):
"""Return the make variables that should be set for this release config.
@@ -234,5 +240,6 @@
result["_ALL_RELEASE_FLAGS." + flag["name"] + ".VALUE"] = val
result["_ALL_RELEASE_FLAGS." + flag["name"] + ".DECLARED_IN"] = flag["declared_in"]
result["_ALL_RELEASE_FLAGS." + flag["name"] + ".SET_IN"] = set_in
+ result["_ALL_RELEASE_FLAGS." + flag["name"] + ".ORIGIN"] = flag["origin"]
return result
diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py
index a7b1d8c..464ad9b 100755
--- a/tools/releasetools/build_image.py
+++ b/tools/releasetools/build_image.py
@@ -294,7 +294,7 @@
build_command = [prop_dict["ext_mkuserimg"]]
if "extfs_sparse_flag" in prop_dict and not disable_sparse:
build_command.append(prop_dict["extfs_sparse_flag"])
- run_e2fsck = RunE2fsck
+ run_fsck = RunE2fsck
build_command.extend([in_dir, out_file, fs_type,
prop_dict["mount_point"]])
build_command.append(prop_dict["image_size"])