Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21805afb authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge changes I53c05800,Ic218283b am: 470cfbe8

Original change: https://android-review.googlesource.com/c/platform/build/+/1317599

Change-Id: I1faab74b423476911d49560560789863c1ffe105
parents 82d6dd60 470cfbe8
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1645,7 +1645,7 @@ $(foreach prop,$(1), \
endef
endef


$(INSTALLED_RECOVERY_BUILD_PROP_TARGET): \
$(INSTALLED_RECOVERY_BUILD_PROP_TARGET): \
	    $(intermediate_system_build_prop) \
	    $(INSTALLED_BUILD_PROP_TARGET) \
	    $(INSTALLED_VENDOR_BUILD_PROP_TARGET) \
	    $(INSTALLED_VENDOR_BUILD_PROP_TARGET) \
	    $(INSTALLED_ODM_BUILD_PROP_TARGET) \
	    $(INSTALLED_ODM_BUILD_PROP_TARGET) \
	    $(INSTALLED_PRODUCT_BUILD_PROP_TARGET) \
	    $(INSTALLED_PRODUCT_BUILD_PROP_TARGET) \
@@ -1653,7 +1653,7 @@ $(INSTALLED_RECOVERY_BUILD_PROP_TARGET): \
	@echo "Target recovery buildinfo: $@"
	@echo "Target recovery buildinfo: $@"
	$(hide) mkdir -p $(dir $@)
	$(hide) mkdir -p $(dir $@)
	$(hide) rm -f $@
	$(hide) rm -f $@
	$(hide) cat $(intermediate_system_build_prop) >> $@
	$(hide) cat $(INSTALLED_BUILD_PROP_TARGET) >> $@
	$(hide) cat $(INSTALLED_VENDOR_BUILD_PROP_TARGET) >> $@
	$(hide) cat $(INSTALLED_VENDOR_BUILD_PROP_TARGET) >> $@
	$(hide) cat $(INSTALLED_ODM_BUILD_PROP_TARGET) >> $@
	$(hide) cat $(INSTALLED_ODM_BUILD_PROP_TARGET) >> $@
	$(hide) cat $(INSTALLED_PRODUCT_BUILD_PROP_TARGET) >> $@
	$(hide) cat $(INSTALLED_PRODUCT_BUILD_PROP_TARGET) >> $@
+89 −94
Original line number Original line Diff line number Diff line
@@ -103,34 +103,13 @@ $(2): $(POST_PROCESS_PROPS) $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT) $(3
	$(hide) echo "# end of file" >> $$@
	$(hide) echo "# end of file" >> $$@
endef
endef



# -----------------------------------------------------------------
# -----------------------------------------------------------------
# system/build.prop
# Define fingerprint, thumbprint, and version tags for the current build
#
#
intermediate_system_build_prop := $(call intermediates-dir-for,ETC,system_build_prop)/build.prop
# BUILD_VERSION_TAGS is a comma-separated list of tags chosen by the device
INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop
# implementer that further distinguishes the build. It's basically defined
ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_BUILD_PROP_TARGET)
# by the device implementer. Here, we are adding a mandatory tag that

# identifies the signing config of the build.
# TODO(b/117892318) merge DEFAULT into BUILD
FINAL_DEFAULT_PROPERTIES := \
    $(call collapse-pairs, $(PRODUCT_SYSTEM_DEFAULT_PROPERTIES))
FINAL_DEFAULT_PROPERTIES := $(call uniq-pairs-by-first-component, \
    $(FINAL_DEFAULT_PROPERTIES),=)

FINAL_BUILD_PROPERTIES := \
    $(call collapse-pairs, $(ADDITIONAL_SYSTEM_PROPERTIES))

# For non-Treble devices, consider vendor properties as system properties
ifndef property_overrides_split_enabled
FINAL_BUILD_PROPERTIES += \
    $(call collapse-pairs, $(ADDITIONAL_VENDOR_PROPERTIES))
endif

FINAL_BUILD_PROPERTIES := $(call uniq-pairs-by-first-component, \
    $(FINAL_BUILD_PROPERTIES),=)

# A list of arbitrary tags describing the build configuration.
# Force ":=" so we can use +=
BUILD_VERSION_TAGS := $(BUILD_VERSION_TAGS)
BUILD_VERSION_TAGS := $(BUILD_VERSION_TAGS)
ifeq ($(TARGET_BUILD_TYPE),debug)
ifeq ($(TARGET_BUILD_TYPE),debug)
  BUILD_VERSION_TAGS += debug
  BUILD_VERSION_TAGS += debug
@@ -148,11 +127,8 @@ endif
BUILD_VERSION_TAGS += $(BUILD_KEYS)
BUILD_VERSION_TAGS += $(BUILD_KEYS)
BUILD_VERSION_TAGS := $(subst $(space),$(comma),$(sort $(BUILD_VERSION_TAGS)))
BUILD_VERSION_TAGS := $(subst $(space),$(comma),$(sort $(BUILD_VERSION_TAGS)))


# A human-readable string that descibes this build in detail.
# BUILD_FINGERPRINT is used used to uniquely identify the combined build and
build_desc := $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT) $(PLATFORM_VERSION) $(BUILD_ID) $(BUILD_NUMBER_FROM_FILE) $(BUILD_VERSION_TAGS)
# product; used by the OTA server.
$(intermediate_system_build_prop): PRIVATE_BUILD_DESC := $(build_desc)

# The string used to uniquely identify the combined build and product; used by the OTA server.
ifeq (,$(strip $(BUILD_FINGERPRINT)))
ifeq (,$(strip $(BUILD_FINGERPRINT)))
  ifeq ($(strip $(HAS_BUILD_NUMBER)),false)
  ifeq ($(strip $(HAS_BUILD_NUMBER)),false)
    BF_BUILD_NUMBER := $(BUILD_USERNAME)$$($(DATE_FROM_FILE) +%m%d%H%M)
    BF_BUILD_NUMBER := $(BUILD_USERNAME)$$($(DATE_FROM_FILE) +%m%d%H%M)
@@ -172,8 +148,8 @@ BUILD_FINGERPRINT_FROM_FILE := $$(cat $(BUILD_FINGERPRINT_FILE))
# unset it for safety.
# unset it for safety.
BUILD_FINGERPRINT :=
BUILD_FINGERPRINT :=


# The string used to uniquely identify the system build; used by the OTA server.
# BUILD_THUMBPRINT is used to uniquely identify the system build; used by the
# This purposefully excludes any product-specific variables.
# OTA server. This purposefully excludes any product-specific variables.
ifeq (,$(strip $(BUILD_THUMBPRINT)))
ifeq (,$(strip $(BUILD_THUMBPRINT)))
  BUILD_THUMBPRINT := $(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER_FROM_FILE):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
  BUILD_THUMBPRINT := $(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER_FROM_FILE):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
endif
endif
@@ -186,14 +162,14 @@ BUILD_THUMBPRINT_FROM_FILE := $$(cat $(BUILD_THUMBPRINT_FILE))
# unset it for safety.
# unset it for safety.
BUILD_THUMBPRINT :=
BUILD_THUMBPRINT :=


KNOWN_OEM_THUMBPRINT_PROPERTIES := \
# -----------------------------------------------------------------
    ro.product.brand \
# Define human readable strings that describe this build
    ro.product.name \
#
    ro.product.device

OEM_THUMBPRINT_PROPERTIES := $(filter $(KNOWN_OEM_THUMBPRINT_PROPERTIES),\
# BUILD_ID: detail info; has the same info as the build fingerprint
    $(PRODUCT_OEM_PROPERTIES))
BUILD_DESC := $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT) $(PLATFORM_VERSION) $(BUILD_ID) $(BUILD_NUMBER_FROM_FILE) $(BUILD_VERSION_TAGS)


# Display parameters shown under Settings -> About Phone
# BUILD_DISPLAY_ID is shown under Settings -> About Phone
ifeq ($(TARGET_BUILD_VARIANT),user)
ifeq ($(TARGET_BUILD_VARIANT),user)
  # User builds should show:
  # User builds should show:
  # release build number or branch.buld_number non-release builds
  # release build number or branch.buld_number non-release builds
@@ -206,17 +182,9 @@ ifeq ($(TARGET_BUILD_VARIANT),user)
  endif
  endif
else
else
  # Non-user builds should show detailed build information
  # Non-user builds should show detailed build information
  BUILD_DISPLAY_ID := $(build_desc)
  BUILD_DISPLAY_ID := $(BUILD_DESC)
endif
endif


# Accepts a whitespace separated list of product locales such as
# (en_US en_AU en_GB...) and returns the first locale in the list with
# underscores replaced with hyphens. In the example above, this will
# return "en-US".
define get-default-product-locale
$(strip $(subst _,-, $(firstword $(1))))
endef

# TARGET_BUILD_FLAVOR and ro.build.flavor are used only by the test
# TARGET_BUILD_FLAVOR and ro.build.flavor are used only by the test
# harness to distinguish builds. Only add _asan for a sanitized build
# harness to distinguish builds. Only add _asan for a sanitized build
# if it isn't already a part of the flavor (via a dedicated lunch
# if it isn't already a part of the flavor (via a dedicated lunch
@@ -228,31 +196,36 @@ TARGET_BUILD_FLAVOR := $(TARGET_BUILD_FLAVOR)_asan
endif
endif
endif
endif


ifdef TARGET_SYSTEM_PROP
KNOWN_OEM_THUMBPRINT_PROPERTIES := \
system_prop_file := $(TARGET_SYSTEM_PROP)
    ro.product.brand \
else
    ro.product.name \
system_prop_file := $(wildcard $(TARGET_DEVICE_DIR)/system.prop)
    ro.product.device
endif
OEM_THUMBPRINT_PROPERTIES := $(filter $(KNOWN_OEM_THUMBPRINT_PROPERTIES),\
$(intermediate_system_build_prop): $(BUILDINFO_SH) $(INTERNAL_BUILD_ID_MAKEFILE) $(BUILD_SYSTEM)/version_defaults.mk $(system_prop_file) $(INSTALLED_ANDROID_INFO_TXT_TARGET) $(API_FINGERPRINT) $(POST_PROCESS_PROPS)
    $(PRODUCT_OEM_PROPERTIES))
	@echo Target buildinfo: $@
KNOWN_OEM_THUMBPRINT_PROPERTIES:=
	@mkdir -p $(dir $@)

	$(hide) rm -f $@ && touch $@
# -----------------------------------------------------------------
	$(hide) $(foreach line,$(FINAL_DEFAULT_PROPERTIES), \
# system/build.prop
	    echo "$(line)" >> $@;)
#
ifneq ($(PRODUCT_OEM_PROPERTIES),)
# Note: parts of this file that can't be generated by the build-properties
	$(hide) echo "#" >> $@; \
# macro are manually created as separate files and then fed into the macro
	        echo "# PRODUCT_OEM_PROPERTIES" >> $@; \

	        echo "#" >> $@;
# Accepts a whitespace separated list of product locales such as
	$(hide) $(foreach prop,$(PRODUCT_OEM_PROPERTIES), \
# (en_US en_AU en_GB...) and returns the first locale in the list with
	    echo "import /oem/oem.prop $(prop)" >> $@;)
# underscores replaced with hyphens. In the example above, this will
endif
# return "en-US".
	$(hide) $(call generate-common-build-props,system,$@)
define get-default-product-locale
$(strip $(subst _,-, $(firstword $(1))))
endef

gen_from_buildinfo_sh := $(call intermediates-dir-for,ETC,system_build_prop)/buildinfo.prop
$(gen_from_buildinfo_sh): $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT)
	$(hide) TARGET_BUILD_TYPE="$(TARGET_BUILD_VARIANT)" \
	$(hide) TARGET_BUILD_TYPE="$(TARGET_BUILD_VARIANT)" \
	        TARGET_BUILD_FLAVOR="$(TARGET_BUILD_FLAVOR)" \
	        TARGET_BUILD_FLAVOR="$(TARGET_BUILD_FLAVOR)" \
	        TARGET_DEVICE="$(TARGET_DEVICE)" \
	        TARGET_DEVICE="$(TARGET_DEVICE)" \
	        PRODUCT_DEFAULT_LOCALE="$(call get-default-product-locale,$(PRODUCT_LOCALES))" \
	        PRODUCT_DEFAULT_LOCALE="$(call get-default-product-locale,$(PRODUCT_LOCALES))" \
	        PRODUCT_DEFAULT_WIFI_CHANNELS="$(PRODUCT_DEFAULT_WIFI_CHANNELS)" \
	        PRODUCT_DEFAULT_WIFI_CHANNELS="$(PRODUCT_DEFAULT_WIFI_CHANNELS)" \
	        PRIVATE_BUILD_DESC="$(PRIVATE_BUILD_DESC)" \
	        PRIVATE_BUILD_DESC="$(BUILD_DESC)" \
	        BUILD_ID="$(BUILD_ID)" \
	        BUILD_ID="$(BUILD_ID)" \
	        BUILD_DISPLAY_ID="$(BUILD_DISPLAY_ID)" \
	        BUILD_DISPLAY_ID="$(BUILD_DISPLAY_ID)" \
	        DATE="$(DATE_FROM_FILE)" \
	        DATE="$(DATE_FROM_FILE)" \
@@ -277,31 +250,53 @@ endif
	        TARGET_CPU_ABI_LIST_64_BIT="$(TARGET_CPU_ABI_LIST_64_BIT)" \
	        TARGET_CPU_ABI_LIST_64_BIT="$(TARGET_CPU_ABI_LIST_64_BIT)" \
	        TARGET_CPU_ABI="$(TARGET_CPU_ABI)" \
	        TARGET_CPU_ABI="$(TARGET_CPU_ABI)" \
	        TARGET_CPU_ABI2="$(TARGET_CPU_ABI2)" \
	        TARGET_CPU_ABI2="$(TARGET_CPU_ABI2)" \
	        bash $(BUILDINFO_SH) >> $@
	        bash $(BUILDINFO_SH) > $@
	$(hide) $(foreach file,$(system_prop_file), \

	    if [ -f "$(file)" ]; then \
ifneq ($(PRODUCT_OEM_PROPERTIES),)
	        echo Target buildinfo from: "$(file)"; \
import_oem_prop := $(call intermediates-dir-for,ETC,system_build_prop)/oem.prop
	        echo "" >> $@; \

	        echo "#" >> $@; \
$(import_oem_prop):
	        echo "# from $(file)" >> $@; \
	$(hide) echo "#" >> $@; \
	        echo "#" >> $@; \
	        echo "# PRODUCT_OEM_PROPERTIES" >> $@; \
	        cat $(file) >> $@; \
	        echo "#" >> $@;
	        echo "# end of $(file)" >> $@; \
	$(hide) $(foreach prop,$(PRODUCT_OEM_PROPERTIES), \
	    fi;)
	    echo "import /oem/oem.prop $(prop)" >> $@;)
	$(if $(FINAL_BUILD_PROPERTIES), \
else
	    $(hide) echo >> $@; \
import_oem_prop :=
	            echo "#" >> $@; \
endif
	            echo "# ADDITIONAL_SYSTEM_PROPERTIES" >> $@; \

	            echo "#" >> $@; )
ifdef TARGET_SYSTEM_PROP
	$(hide) $(foreach line,$(FINAL_BUILD_PROPERTIES), \
system_prop_file := $(TARGET_SYSTEM_PROP)
	    echo "$(line)" >> $@;)
else
	$(hide) $(POST_PROCESS_PROPS) $@ $(PRODUCT_SYSTEM_PROPERTY_BLACKLIST)
system_prop_file := $(wildcard $(TARGET_DEVICE_DIR)/system.prop)

endif
build_desc :=


_prop_files_ := \
$(INSTALLED_BUILD_PROP_TARGET): $(intermediate_system_build_prop)
  $(import_oem_prop) \
	@echo "Target build info: $@"
  $(gen_from_buildinfo_sh) \
	$(hide) grep -v 'ro.product.first_api_level' $(intermediate_system_build_prop) > $@
  $(system_prop_file)

# Order matters here. When there are duplicates, the last one wins.
# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
_prop_vars_ := \
    ADDITIONAL_SYSTEM_PROPERTIES \
    PRODUCT_SYSTEM_DEFAULT_PROPERTIES

ifndef property_overrides_split_enabled
_prop_vars_ += \
    ADDITIONAL_VENDOR_PROPERTIES
endif

_blacklist_names_ := \
    $(PRODUCT_SYSTEM_PROPERTY_BLACKLIST) \
    ro.product.first_api_level

INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop

$(eval $(call build-properties,system,$(INSTALLED_BUILD_PROP_TARGET),\
$(_prop_files_),$(_prop_vars_),\
$(_blacklist_names_)))



# -----------------------------------------------------------------
# -----------------------------------------------------------------
# vendor/build.prop
# vendor/build.prop
+4 −1
Original line number Original line Diff line number Diff line
@@ -108,7 +108,10 @@ class PropList:
      self.props[index].value = value
      self.props[index].value = value


  def delete(self, name):
  def delete(self, name):
    self.props = [p for p in self.props if p.name != name]
    index = next((i for i,p in enumerate(self.props) if p.name == name), -1)
    if index != -1:
      new_comment = "# removed by post_process_props.py\n#" + str(self.props[index])
      self.props[index] = Prop.from_line(new_comment)


  def write(self, filename):
  def write(self, filename):
    with open(filename, 'w+') as f:
    with open(filename, 'w+') as f: