mirror of
https://gitlab.com/kupfer/kupferbootstrap.git
synced 2025-02-22 21:25:43 -05:00
image/fastboot: flash_image(): add optional sparse_size parameter
This commit is contained in:
parent
08285a7931
commit
604f123067
1 changed files with 4 additions and 1 deletions
|
@ -1,6 +1,8 @@
|
||||||
import logging
|
import logging
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
|
|
||||||
def fastboot_erase_dtbo():
|
def fastboot_erase_dtbo():
|
||||||
logging.info("Fastboot: Erasing 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}")
|
logging.info(f"Fastboot: Flashing {file} to {partition}")
|
||||||
result = subprocess.run([
|
result = subprocess.run([
|
||||||
'fastboot',
|
'fastboot',
|
||||||
|
*(['-S', sparse_size] if sparse_size is not None else []),
|
||||||
'flash',
|
'flash',
|
||||||
partition,
|
partition,
|
||||||
file,
|
file,
|
||||||
|
|
Loading…
Add table
Reference in a new issue