build: Introduce android-info-extra.txt support

This allows adding android-info-extra.txt to OTA packaging folder
in case it exists in the target device tree, so that it can then
be used in conjunction with custom releasetools. Historically, devices
used to do assertions based on the modem version or even trusted zone
version in order to prevent flashing builds if certain conditions were
not met. That however, breaks `fastboot flashall` command since it looks
for the requirements set in board-info.txt.

With this, targets can define whatever non-standard requirements
in the newly introduced android-info extra file, keeping OTA assertions
in place and `fastboot flashall` command working without having to pass
`--force` argument.

Change-Id: I029d778b44be4d9d877701d05124451052a4b73c
Signed-off-by: RITEFANG <1721985272@qq.com>
This commit is contained in:
Bruno Martins
2023-11-14 14:02:35 +00:00
committed by SkyMinus
parent 9ecc62fa51
commit 5d9bae69da
2 changed files with 20 additions and 0 deletions

View File

@@ -49,6 +49,23 @@ endif
$(call declare-0p-target,$(INSTALLED_ANDROID_INFO_TXT_TARGET))
# Similarly to above, generate a file containing extra info
# to be used only with custom releasetools
INSTALLED_ANDROID_INFO_EXTRA_TXT_TARGET := $(PRODUCT_OUT)/android-info-extra.txt
android_info_extra_txt := $(TARGET_ANDROID_INFO_EXTRA_FILE)
ifndef android_info_extra_txt
android_info_extra_txt := $(wildcard $(TARGET_DEVICE_DIR)/android-info-extra.txt)
endif
$(INSTALLED_ANDROID_INFO_EXTRA_TXT_TARGET): $(android_info_extra_txt)
$(call pretty,"Generated: ($@)")
ifdef android_info_extra_txt
$(hide) grep -v '#' $< > $@
else
$(hide) echo "" > $@
endif
$(call declare-0p-target,$(INSTALLED_ANDROID_INFO_EXTRA_TXT_TARGET))
# Copy compatibility metadata to the device.
# Device Manifest