Permalink
Browse files

Revert "Squashed revert of TARGET_UNIFIED_DEVICE"

Finally should fix TeamNexus/issues#22

This reverts commit c21d567.
  • Loading branch information...
Lukas0610 committed Aug 9, 2017
1 parent 0b65b49 commit 1538cf0bd9015e4051b37b6b95fc5aad15f421ed
Showing with 72 additions and 41 deletions.
  1. +9 −0 core/Makefile
  2. +11 −10 tools/buildinfo.sh
  3. +52 −31 tools/releasetools/ota_from_target_files.py
View
@@ -264,6 +264,7 @@ endif
TARGET_CPU_ABI="$(TARGET_CPU_ABI)" \
TARGET_CPU_ABI2="$(TARGET_CPU_ABI2)" \
TARGET_AAPT_CHARACTERISTICS="$(TARGET_AAPT_CHARACTERISTICS)" \
TARGET_UNIFIED_DEVICE="$(TARGET_UNIFIED_DEVICE)" \
$(PRODUCT_BUILD_PROP_OVERRIDES) \
bash $(BUILDINFO_SH) >> $@
$(hide) $(foreach file,$(system_prop_file), \
@@ -2140,6 +2141,7 @@ else
$(hide) vendor/cm/build/tools/getb64key.py $(DEFAULT_SYSTEM_DEV_CERTIFICATE).x509.pem > $(zip_root)/META/releasekey.txt
endif
$(hide) echo "ota_override_device=$(OTA_SCRIPT_OVERRIDE_DEVICE)" >> $(zip_root)/META/misc_info.txt
$(hide) echo "ota_override_prop=$(OTA_SCRIPT_OVERRIDE_PROP)" >> $(zip_root)/META/misc_info.txt
@# Zip everything up, preserving symlinks and placing META/ files first to
@# help early validation of the .zip file while uploading it.
$(hide) (cd $(zip_root) && \
@@ -2206,6 +2208,13 @@ else
OTA_SCRIPT_OVERRIDE_DEVICE := $(TARGET_OTA_ASSERT_DEVICE)
endif
ifneq ($(TARGET_UNIFIED_DEVICE),)
OTA_SCRIPT_OVERRIDE_PROP := true
ifeq ($(TARGET_OTA_ASSERT_DEVICE),)
OTA_SCRIPT_OVERRIDE_DEVICE := $(TARGET_DEVICE)
endif
endif
ifneq ($(BLOCK_BASED_OTA),false)
$(INTERNAL_OTA_PACKAGE_TARGET): block_based := --block
endif
View
@@ -26,10 +26,8 @@ fi
if [ -n "$AB_OTA_UPDATER" ] ; then
echo "ro.build.ab_update=$AB_OTA_UPDATER"
fi
echo "ro.product.model=$PRODUCT_MODEL"
echo "ro.product.brand=$PRODUCT_BRAND"
echo "ro.product.name=$PRODUCT_NAME"
echo "ro.product.device=$TARGET_DEVICE"
echo "ro.product.board=$TARGET_BOOTLOADER_BOARD_NAME"
# These values are deprecated, use "ro.product.cpu.abilist"
@@ -51,14 +49,17 @@ fi
echo "ro.wifi.channels=$PRODUCT_DEFAULT_WIFI_CHANNELS"
echo "ro.board.platform=$TARGET_BOARD_PLATFORM"
echo "# ro.build.product is obsolete; use ro.product.device"
echo "ro.build.product=$TARGET_DEVICE"
echo "# Do not try to parse description, fingerprint, or thumbprint"
echo "ro.build.description=$PRIVATE_BUILD_DESC"
echo "ro.build.fingerprint=$BUILD_FINGERPRINT"
if [ -n "$BUILD_THUMBPRINT" ] ; then
echo "ro.build.thumbprint=$BUILD_THUMBPRINT"
if [ "$TARGET_UNIFIED_DEVICE" == "" ] ; then
echo "# ro.build.product is obsolete; use ro.product.device"
echo "ro.build.product=$TARGET_DEVICE"
echo "ro.product.model=$PRODUCT_MODEL"
echo "ro.product.device=$TARGET_DEVICE"
echo "# Do not try to parse description, fingerprint, or thumbprint"
echo "ro.build.description=$PRIVATE_BUILD_DESC"
echo "ro.build.fingerprint=$BUILD_FINGERPRINT"
if [ -n "$BUILD_THUMBPRINT" ] ; then
echo "ro.build.thumbprint=$BUILD_THUMBPRINT"
fi
fi
echo "ro.build.characteristics=$TARGET_AAPT_CHARACTERISTICS"
@@ -180,6 +180,7 @@
OPTIONS.payload_signer_args = []
OPTIONS.backuptool = False
OPTIONS.override_device = 'auto'
OPTIONS.override_prop = False
def MostPopularKey(d, default):
"""Given a dict, return the key corresponding to the largest
@@ -528,6 +529,8 @@ def GetOemProperty(name, oem_props, oem_dict, info_dict):
def CalculateFingerprint(oem_props, oem_dict, info_dict):
if OPTIONS.override_prop:
return GetBuildProp("ro.build.date.utc", info_dict)
if oem_props is None:
return GetBuildProp("ro.build.fingerprint", info_dict)
return "%s/%s/%s:%s" % (
@@ -604,13 +607,18 @@ def WriteFullOTAPackage(input_zip, output_zip):
oem_dict = common.LoadDictionaryFromLines(
open(OPTIONS.oem_source).readlines())
metadata = {
"post-build": CalculateFingerprint(oem_props, oem_dict,
OPTIONS.info_dict),
"pre-device": GetOemProperty("ro.product.device", oem_props, oem_dict,
OPTIONS.info_dict),
"post-timestamp": GetBuildProp("ro.build.date.utc", OPTIONS.info_dict),
}
if OPTIONS.override_prop:
metadata = {
"post-timestamp": GetBuildProp("ro.build.date.utc", OPTIONS.info_dict),
}
else:
metadata = {
"post-build": CalculateFingerprint(oem_props, oem_dict,
OPTIONS.info_dict),
"pre-device": GetOemProperty("ro.product.device", oem_props, oem_dict,
OPTIONS.info_dict),
"post-timestamp": GetBuildProp("ro.build.date.utc", OPTIONS.info_dict),
}
device_specific = common.DeviceSpecificParams(
input_zip=input_zip,
@@ -925,11 +933,16 @@ def WriteBlockIncrementalOTAPackage(target_zip, source_zip, output_zip):
oem_dict = common.LoadDictionaryFromLines(
open(OPTIONS.oem_source).readlines())
metadata = {
"pre-device": GetOemProperty("ro.product.device", oem_props, oem_dict,
OPTIONS.source_info_dict),
"ota-type": "BLOCK",
}
if OPTIONS.override_prop:
metadata = {
"ota-type": "BLOCK",
}
else:
metadata = {
"pre-device": GetOemProperty("ro.product.device", oem_props, oem_dict,
OPTIONS.source_info_dict),
"ota-type": "BLOCK",
}
post_timestamp = GetBuildProp("ro.build.date.utc", OPTIONS.target_info_dict)
pre_timestamp = GetBuildProp("ro.build.date.utc", OPTIONS.source_info_dict)
@@ -1628,11 +1641,16 @@ def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip):
oem_dict = common.LoadDictionaryFromLines(
open(OPTIONS.oem_source).readlines())
metadata = {
"pre-device": GetOemProperty("ro.product.device", oem_props, oem_dict,
OPTIONS.source_info_dict),
"ota-type": "FILE",
}
if OPTIONS.override_prop:
metadata = {
"ota-type": "FILE",
}
else:
metadata = {
"pre-device": GetOemProperty("ro.product.device", oem_props, oem_dict,
OPTIONS.source_info_dict),
"ota-type": "FILE",
}
post_timestamp = GetBuildProp("ro.build.date.utc", OPTIONS.target_info_dict)
pre_timestamp = GetBuildProp("ro.build.date.utc", OPTIONS.source_info_dict)
@@ -1675,23 +1693,24 @@ def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip):
else:
vendor_diff = None
target_fp = CalculateFingerprint(oem_props, oem_dict,
OPTIONS.target_info_dict)
source_fp = CalculateFingerprint(oem_props, oem_dict,
OPTIONS.source_info_dict)
if not OPTIONS.override_prop:
target_fp = CalculateFingerprint(oem_props, oem_dict,
OPTIONS.target_info_dict)
source_fp = CalculateFingerprint(oem_props, oem_dict,
OPTIONS.source_info_dict)
if oem_props is None:
script.AssertSomeFingerprint(source_fp, target_fp)
else:
script.AssertSomeThumbprint(
GetBuildProp("ro.build.thumbprint", OPTIONS.target_info_dict),
GetBuildProp("ro.build.thumbprint", OPTIONS.source_info_dict))
if oem_props is None:
script.AssertSomeFingerprint(source_fp, target_fp)
else:
script.AssertSomeThumbprint(
GetBuildProp("ro.build.thumbprint", OPTIONS.target_info_dict),
GetBuildProp("ro.build.thumbprint", OPTIONS.source_info_dict))
metadata["pre-build"] = source_fp
metadata["post-build"] = target_fp
metadata["pre-build-incremental"] = GetBuildProp(
metadata["pre-build"] = source_fp
metadata["post-build"] = target_fp
metadata["pre-build-incremental"] = GetBuildProp(
"ro.build.version.incremental", OPTIONS.source_info_dict)
metadata["post-build-incremental"] = GetBuildProp(
metadata["post-build-incremental"] = GetBuildProp(
"ro.build.version.incremental", OPTIONS.target_info_dict)
source_boot = common.GetBootableImage(
@@ -2164,6 +2183,8 @@ def option_handler(o, a):
if "ota_override_device" in OPTIONS.info_dict:
OPTIONS.override_device = OPTIONS.info_dict.get("ota_override_device")
if "ota_override_prop" in OPTIONS.info_dict:
OPTIONS.override_prop = OPTIONS.info_dict.get("ota_override_prop") == "true"
ab_update = OPTIONS.info_dict.get("ab_update") == "true"

0 comments on commit 1538cf0

Please sign in to comment.