avbroot.py: Add final status message to indicate the elapsed time

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
This commit is contained in:
Andrew Gunnerson
2023-01-30 13:54:59 -05:00
parent 00f903e85f
commit c2f64a6587
+7
View File
@@ -6,6 +6,7 @@ import argparse
import os
import shutil
import tempfile
import time
import zipfile
import avbtool
@@ -234,6 +235,8 @@ def patch_subcommand(args):
if not openssl.cert_matches_key(cert_ota, dec_privkey_ota):
raise Exception('OTA certificate does not match private key')
start = time.perf_counter_ns()
with tempfile.NamedTemporaryFile() as temp_unsigned:
metadata = patch_ota_zip(
args.input,
@@ -253,6 +256,10 @@ def patch_subcommand(args):
metadata,
)
# Excluding the time it takes for the user to type in the passwords
elapsed = time.perf_counter_ns() - start
print_status(f'Completed after {elapsed / 1_000_000_000:.1f}s')
def extract_subcommand(args):
# Set default temp directory to the output directory because this is the