@@ -451,9 +451,29 @@ def fastboot_flash_boot(bin_path: Path, recovery: str) -> TerminalResponse:
451451
452452@add_logging ("Flash custom recovery with fastboot." )
453453def fastboot_flash_recovery (
454- bin_path : Path , recovery : str , is_ab : bool = True
454+ bin_path : Path ,
455+ recovery : str ,
456+ is_ab : bool = True ,
457+ vendor_boot : Optional [str ] = None ,
458+ dtbo : Optional [str ] = None ,
459+ vbmeta : Optional [str ] = None ,
460+ super_empty : Optional [str ] = None ,
455461) -> TerminalResponse :
456- """Flash custom recovery with fastboot."""
462+ """Flash custom recovery with fastboot.
463+
464+ If necessary, flash additional partitions (dtbo, vbmeta, super_empty) with fastboot before.
465+ """
466+ if any ([dtbo , vbmeta , super_empty , vendor_boot ]):
467+ for line in fastboot_flash_additional_partitions (
468+ bin_path = bin_path ,
469+ dtbo = dtbo ,
470+ vbmeta = vbmeta ,
471+ super_empty = super_empty ,
472+ vendor_boot = vendor_boot ,
473+ is_ab = is_ab ,
474+ ):
475+ yield line
476+
457477 for line in run_command (
458478 "fastboot flash recovery " , target = f"{ recovery } " , bin_path = bin_path
459479 ):
@@ -505,7 +525,9 @@ def fastboot_flash_additional_partitions(
505525 if vbmeta :
506526 logger .info ("vbmeta selected. Flashing vbmeta partition." )
507527 for line in run_command (
508- "fastboot --disable-verity --disable-verification flash vbmeta " , target = f"{ vbmeta } " , bin_path = bin_path
528+ "fastboot --disable-verity --disable-verification flash vbmeta " ,
529+ target = f"{ vbmeta } " ,
530+ bin_path = bin_path ,
509531 ):
510532 yield line
511533 if not is_ab :
0 commit comments