From b9fdf2dc08574e9eade81b7478e103e8545ca4a6 Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Fri, 12 Aug 2022 14:07:31 -0700 Subject: [PATCH] Fix a bug in unsigned OTA generation Caller expects output_file to contain the final OTA, so we must copy data into that location. Modifying loca variables isn't enough. Test: make ota with --no_signing Change-Id: Id4aaefbc53b4250b7308701493d151f9408f47f1 --- tools/releasetools/ota_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/releasetools/ota_utils.py b/tools/releasetools/ota_utils.py index ef1dca232c..12acc138c7 100644 --- a/tools/releasetools/ota_utils.py +++ b/tools/releasetools/ota_utils.py @@ -16,6 +16,7 @@ import copy import itertools import logging import os +import shutil import struct import zipfile @@ -119,7 +120,7 @@ def FinalizeMetadata(metadata, input_file, output_file, needed_property_files): # Re-sign the package after updating the metadata entry. if OPTIONS.no_signing: - output_file = prelim_signing + shutil.copy(prelim_signing, output_file) else: SignOutput(prelim_signing, output_file)