diff options
Diffstat (limited to 'tools/releasetools/ota_from_target_files')
-rwxr-xr-x | tools/releasetools/ota_from_target_files | 13 |
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: |