OSDN Git Service

Squashed revert of TARGET_UNIFIED_DEVICE
authorMichael Bestas <mkbestas@lineageos.org>
Fri, 16 Jun 2017 12:29:31 +0000 (15:29 +0300)
committerHarry Youd <harry@harryyoud.co.uk>
Thu, 6 Jul 2017 14:41:08 +0000 (15:41 +0100)
* vendor init can be used to achieve everything done here

Revert "core: Fix unified trees with no TARGET_OTA_ASSERT_DEVICE"
This reverts commit e44fa493f87d74c20b4276ca7504bc601847d01f.

Revert "releasetools: don't attempt to read fingerprint on unified devices"
This reverts commit 787a0aa7d8787c13bf78559ae4a05650ed46da76.

Revert "buildinfo: only set ro.build.product on non-unified devices"
This reverts commit 22c034b8a7c51c713dfb2a75c6e4e20941428cad.

Revert "ota_from_target_files: Remove device dependent arguments"
This reverts commit 7c93b441bcf65a8630f8f4bb8df9537f686ea797.

Revert "Fix ro.build.product not found by ota_from_target_files in some cases"
This reverts commit 0ca5495057a6d15f6049993896c34e13cd4dd467.

Revert "Allow devices to specify certain ro. props via TARGET_UNIFIED_DEVICE"
This reverts commit 8182bc29ffc498033e25ef10f3f8499ebfe25a7e.

ota_from_target_files: Remove device dependent arguments
These device-specific arguments are defined at build time and are
necessary to generate the zip correctly. Don't use command line
arguments to specify them, but write all the needed information
in misc_info.txt when the target-files zip is generated.
ota_from_target_files will then read misc_info.txt and set
everything automatically.
Original Change-Id: Ibdbca575b76eb07b53fccfcea52a351c7e333f91
[mikeioannina]: Reapply after TARGET_UNIFIED_DEVICE removal

Change-Id: I5cb8f074c893c0e46edf507f6256cd747239d07f

core/Makefile
tools/buildinfo.sh
tools/releasetools/ota_from_target_files.py

index 62c72a4..3fb4247 100644 (file)
@@ -264,7 +264,6 @@ 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), \
@@ -2141,7 +2140,6 @@ 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) && \
@@ -2208,13 +2206,6 @@ 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
index 039c344..43c8e9d 100755 (executable)
@@ -26,8 +26,10 @@ 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"
@@ -49,17 +51,14 @@ fi
 echo "ro.wifi.channels=$PRODUCT_DEFAULT_WIFI_CHANNELS"
 echo "ro.board.platform=$TARGET_BOARD_PLATFORM"
 
-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
+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"
 fi
 echo "ro.build.characteristics=$TARGET_AAPT_CHARACTERISTICS"
 
index a9a8dd0..4c54cec 100755 (executable)
@@ -180,7 +180,6 @@ OPTIONS.payload_signer = None
 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
@@ -529,8 +528,6 @@ 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" % (
@@ -607,18 +604,13 @@ def WriteFullOTAPackage(input_zip, output_zip):
     oem_dict = common.LoadDictionaryFromLines(
         open(OPTIONS.oem_source).readlines())
 
-  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),
-    }
+  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,
@@ -909,16 +901,11 @@ def WriteBlockIncrementalOTAPackage(target_zip, source_zip, output_zip):
     oem_dict = common.LoadDictionaryFromLines(
         open(OPTIONS.oem_source).readlines())
 
-  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",
-    }
+  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)
@@ -1617,16 +1604,11 @@ def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip):
     oem_dict = common.LoadDictionaryFromLines(
         open(OPTIONS.oem_source).readlines())
 
-  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",
-    }
+  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)
@@ -1669,24 +1651,23 @@ def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip):
   else:
     vendor_diff = None
 
-  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)
+  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(
@@ -2159,8 +2140,6 @@ def main(argv):
 
   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"