From 604f123067c76e4fd84647e006217a4a990e326d Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Fri, 6 Jan 2023 04:22:46 +0100 Subject: [PATCH] image/fastboot: flash_image(): add optional sparse_size parameter --- image/fastboot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/image/fastboot.py b/image/fastboot.py index a2ce7a6..d8816bf 100644 --- a/image/fastboot.py +++ b/image/fastboot.py @@ -1,6 +1,8 @@ import logging import subprocess +from typing import Optional + def fastboot_erase_dtbo(): logging.info("Fastboot: Erasing DTBO") @@ -14,10 +16,11 @@ def fastboot_erase_dtbo(): ) -def fastboot_flash(partition, file): +def fastboot_flash(partition: str, file: str, sparse_size: Optional[str] = None): logging.info(f"Fastboot: Flashing {file} to {partition}") result = subprocess.run([ 'fastboot', + *(['-S', sparse_size] if sparse_size is not None else []), 'flash', partition, file,