summaryrefslogtreecommitdiff
path: root/scripts/update_device.py
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2021-02-01 00:10:01 -0800
committerLinux Build Service Account <lnxbuild@localhost>2021-02-01 00:10:01 -0800
commit484e5e66690f646d3cd73c64962f570772d2ffb7 (patch)
treef1cba972cae9a60edeeecf4382ff0c6cede78a3d /scripts/update_device.py
parent458b097199739c720c2ec6035ae0be15a88ea7e7 (diff)
parente7a44e47a3951ce8854545f7a4982c2f64a79bee (diff)
Merge e7a44e47a3951ce8854545f7a4982c2f64a79bee on remote branch
Change-Id: Ied6620e3a6864ae3f446f61b2ca95558af9bd02e
Diffstat (limited to 'scripts/update_device.py')
-rwxr-xr-xscripts/update_device.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/update_device.py b/scripts/update_device.py
index 756d443f..354972b7 100755
--- a/scripts/update_device.py
+++ b/scripts/update_device.py
@@ -104,7 +104,7 @@ class AndroidOTAPackage(object):
if payload_info.compress_type != 0:
logging.error(
- "Expected layload to be uncompressed, got compression method %d",
+ "Expected payload to be uncompressed, got compression method %d",
payload_info.compress_type)
# Don't use len(payload_info.extra). Because that returns size of extra
# fields in central directory. We need to look at local file directory,
@@ -125,10 +125,10 @@ class AndroidOTAPackage(object):
payload_header = fp.read(4)
if payload_header != self.PAYLOAD_MAGIC_HEADER:
logging.warning(
- "Invalid header, expeted %s, got %s."
+ "Invalid header, expected %s, got %s."
"Either the offset is not correct, or payload is corrupted",
binascii.hexlify(self.PAYLOAD_MAGIC_HEADER),
- payload_header)
+ binascii.hexlify(payload_header))
property_entry = (self.SECONDARY_OTA_PAYLOAD_PROPERTIES_TXT if
secondary_payload else self.OTA_PAYLOAD_PROPERTIES_TXT)
@@ -403,6 +403,8 @@ def main():
help='Extra headers to pass to the device.')
parser.add_argument('--secondary', action='store_true',
help='Update with the secondary payload in the package.')
+ parser.add_argument('--no-slot-switch', action='store_true',
+ help='Do not perform slot switch after the update.')
args = parser.parse_args()
logging.basicConfig(
level=logging.WARNING if args.no_verbose else logging.INFO)
@@ -420,6 +422,9 @@ def main():
help_cmd = ['shell', 'su', '0', 'update_engine_client', '--help']
use_omaha = 'omaha' in dut.adb_output(help_cmd)
+ if args.no_slot_switch:
+ args.extra_headers += "\nSWITCH_SLOT_ON_REBOOT=0"
+
if args.file:
# Update via pushing a file to /data.
device_ota_file = os.path.join(OTA_PACKAGE_PATH, 'debug.zip')