summaryrefslogtreecommitdiffstats
path: root/tools/releasetools/ota_from_target_files
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2010-04-21 11:39:48 -0400
committerAdnan Begovic <adnan@cyngn.com>2015-10-06 16:11:49 -0700
commit1831340dcc85742281bc0794a4bf95b4667d9f13 (patch)
tree874dece31cd4f881a4a7dd03ac86f68292d76ff4 /tools/releasetools/ota_from_target_files
parent8b2014d7e5c5e832240a37f417aac0bba22a4279 (diff)
downloadbuild-1831340dcc85742281bc0794a4bf95b4667d9f13.zip
build-1831340dcc85742281bc0794a4bf95b4667d9f13.tar.gz
build-1831340dcc85742281bc0794a4bf95b4667d9f13.tar.bz2
Allow override of device asserts, including multi-device support.
Set in board file with TARGET_OTA_ASSERT_DEVICE. (cherry-picked from commit 0f452f21fc9323b9d1fe746161761cf40aaa5030) Change-Id: I3d06bdc0e3e26bde0c0e646accd050364f9713b9
Diffstat (limited to 'tools/releasetools/ota_from_target_files')
-rwxr-xr-xtools/releasetools/ota_from_target_files13
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/releasetools/ota_from_target_files b/tools/releasetools/ota_from_target_files
index f55fcb3..5d9095c 100755
--- a/tools/releasetools/ota_from_target_files
+++ b/tools/releasetools/ota_from_target_files
@@ -88,6 +88,9 @@ Usage: ota_from_target_files [flags] input_target_files output_ota_package
Enable or disable the execution of backuptool.sh.
Disabled by default.
+ --override_device <device>
+ Override device-specific asserts. Can be a comma-separated list.
+
"""
import sys
@@ -127,6 +130,7 @@ OPTIONS.oem_source = None
OPTIONS.fallback_to_full = True
OPTIONS.full_radio = False
OPTIONS.backuptool = False
+OPTIONS.override_device = 'auto'
def MostPopularKey(d, default):
"""Given a dict, return the key corresponding to the largest
@@ -406,7 +410,10 @@ def SignOutput(temp_zip_name, output_zip_name):
def AppendAssertions(script, info_dict, oem_dict=None):
oem_props = info_dict.get("oem_fingerprint_properties")
if oem_props is None or len(oem_props) == 0:
- device = GetBuildProp("ro.product.device", info_dict)
+ if OPTIONS.override_device == "auto":
+ device = GetBuildProp("ro.product.device", info_dict)
+ else:
+ device = OPTIONS.override_device
script.AssertDevice(device)
else:
if oem_dict is None:
@@ -438,7 +445,6 @@ def GetOemProperty(name, oem_props, oem_dict, info_dict):
return oem_dict[name]
return GetBuildProp(name, info_dict)
-
def CalculateFingerprint(oem_props, oem_dict, info_dict):
if oem_props is None:
return GetBuildProp("ro.build.fingerprint", info_dict)
@@ -1543,6 +1549,8 @@ def main(argv):
OPTIONS.fallback_to_full = False
elif o in ("--backup"):
OPTIONS.backuptool = bool(a.lower() == 'true')
+ elif o in ("--override_device"):
+ OPTIONS.override_device = a
else:
return False
return True
@@ -1567,6 +1575,7 @@ def main(argv):
"verify",
"no_fallback_to_full",
"backup=",
+ "override_device="],
], extra_option_handler=option_handler)
if len(args) != 2: