Loading core/Makefile +7 −0 Original line number Diff line number Diff line Loading @@ -1081,12 +1081,19 @@ else $(INTERNAL_OTA_PACKAGE_TARGET): backuptool := true endif ifeq ($(TARGET_OTA_ASSERT_DEVICE),) $(INTERNAL_OTA_PACKAGE_TARGET): override_device := auto else $(INTERNAL_OTA_PACKAGE_TARGET): override_device := $(TARGET_OTA_ASSERT_DEVICE) endif $(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(OTATOOLS) @echo "Package OTA: $@" $(hide) ./build/tools/releasetools/ota_from_target_files -v \ -p $(HOST_OUT) \ -k $(KEY_CERT_PAIR) \ --backup=$(backuptool) \ --override_device=$(override_device) \ $(BUILT_TARGET_FILES_PACKAGE) $@ .PHONY: otapackage Loading tools/releasetools/edify_generator.py +4 −2 Original line number Diff line number Diff line Loading @@ -87,8 +87,10 @@ class EdifyGenerator(object): def AssertDevice(self, device): """Assert that the device identifier is the given string.""" cmd = ('assert(getprop("ro.product.device") == "%s" ||\0' 'getprop("ro.build.product") == "%s");' % (device, device)) cmd = ('assert(' + ' || \0'.join(['getprop("ro.product.device") == "%s" || getprop("ro.build.product") == "%s"' % (i, i) for i in device.split(",")]) + ');') self.script.append(self._WordWrap(cmd)) def AssertSomeBootloader(self, *bootloaders): Loading tools/releasetools/ota_from_target_files +12 −2 Original line number Diff line number Diff line Loading @@ -48,6 +48,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 Loading Loading @@ -80,6 +83,7 @@ OPTIONS.omit_prereq = False OPTIONS.extra_script = None OPTIONS.worker_threads = 3 OPTIONS.backuptool = False OPTIONS.override_device = 'auto' def MostPopularKey(d, default): """Given a dict, return the key corresponding to the largest Loading Loading @@ -292,7 +296,10 @@ def SignOutput(temp_zip_name, output_zip_name): def AppendAssertions(script, input_zip): if OPTIONS.override_device == "auto": device = GetBuildProp("ro.product.device", input_zip) else: device = OPTIONS.override_device script.AssertDevice(device) Loading Loading @@ -723,6 +730,8 @@ def main(argv): OPTIONS.worker_threads = int(a) elif o in ("--backup"): OPTIONS.backuptool = bool(a.lower() == 'true') elif o in ("--override_device"): OPTIONS.override_device = a else: return False return True Loading @@ -736,7 +745,8 @@ def main(argv): "no_prereq", "extra_script=", "worker_threads=", "backup="], "backup=", "override_device="], extra_option_handler=option_handler) if len(args) != 2: Loading Loading
core/Makefile +7 −0 Original line number Diff line number Diff line Loading @@ -1081,12 +1081,19 @@ else $(INTERNAL_OTA_PACKAGE_TARGET): backuptool := true endif ifeq ($(TARGET_OTA_ASSERT_DEVICE),) $(INTERNAL_OTA_PACKAGE_TARGET): override_device := auto else $(INTERNAL_OTA_PACKAGE_TARGET): override_device := $(TARGET_OTA_ASSERT_DEVICE) endif $(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(OTATOOLS) @echo "Package OTA: $@" $(hide) ./build/tools/releasetools/ota_from_target_files -v \ -p $(HOST_OUT) \ -k $(KEY_CERT_PAIR) \ --backup=$(backuptool) \ --override_device=$(override_device) \ $(BUILT_TARGET_FILES_PACKAGE) $@ .PHONY: otapackage Loading
tools/releasetools/edify_generator.py +4 −2 Original line number Diff line number Diff line Loading @@ -87,8 +87,10 @@ class EdifyGenerator(object): def AssertDevice(self, device): """Assert that the device identifier is the given string.""" cmd = ('assert(getprop("ro.product.device") == "%s" ||\0' 'getprop("ro.build.product") == "%s");' % (device, device)) cmd = ('assert(' + ' || \0'.join(['getprop("ro.product.device") == "%s" || getprop("ro.build.product") == "%s"' % (i, i) for i in device.split(",")]) + ');') self.script.append(self._WordWrap(cmd)) def AssertSomeBootloader(self, *bootloaders): Loading
tools/releasetools/ota_from_target_files +12 −2 Original line number Diff line number Diff line Loading @@ -48,6 +48,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 Loading Loading @@ -80,6 +83,7 @@ OPTIONS.omit_prereq = False OPTIONS.extra_script = None OPTIONS.worker_threads = 3 OPTIONS.backuptool = False OPTIONS.override_device = 'auto' def MostPopularKey(d, default): """Given a dict, return the key corresponding to the largest Loading Loading @@ -292,7 +296,10 @@ def SignOutput(temp_zip_name, output_zip_name): def AppendAssertions(script, input_zip): if OPTIONS.override_device == "auto": device = GetBuildProp("ro.product.device", input_zip) else: device = OPTIONS.override_device script.AssertDevice(device) Loading Loading @@ -723,6 +730,8 @@ def main(argv): OPTIONS.worker_threads = int(a) elif o in ("--backup"): OPTIONS.backuptool = bool(a.lower() == 'true') elif o in ("--override_device"): OPTIONS.override_device = a else: return False return True Loading @@ -736,7 +745,8 @@ def main(argv): "no_prereq", "extra_script=", "worker_threads=", "backup="], "backup=", "override_device="], extra_option_handler=option_handler) if len(args) != 2: Loading