From b9ebd60071e85cf80098b9af0e9bf97a05838598 Mon Sep 17 00:00:00 2001 From: Tobias Sterbak Date: Sat, 7 Oct 2023 11:33:24 +0200 Subject: [PATCH] Fix configs with addintion flash step and add vendor_boot to tooling and steps --- openandroidinstaller/assets/configs/Mi439.yaml | 2 +- openandroidinstaller/assets/configs/avicii.yaml | 6 ++++++ openandroidinstaller/assets/configs/dre.yaml | 6 ++++++ openandroidinstaller/assets/configs/guacamole.yaml | 6 ++++++ openandroidinstaller/assets/configs/hotdog.yaml | 6 ++++++ openandroidinstaller/assets/configs/hotdogb.yaml | 6 ++++++ openandroidinstaller/tooling.py | 14 ++++++++++++++ openandroidinstaller/views/step_view.py | 1 + 8 files changed, 46 insertions(+), 1 deletion(-) diff --git a/openandroidinstaller/assets/configs/Mi439.yaml b/openandroidinstaller/assets/configs/Mi439.yaml index a5362a32..cc286a80 100644 --- a/openandroidinstaller/assets/configs/Mi439.yaml +++ b/openandroidinstaller/assets/configs/Mi439.yaml @@ -53,7 +53,7 @@ steps: content: > Install additional partitions selected before by pressing 'Confirm and run'. Once it's done continue. - Note : If you have not selected this partition, it will do nothing. + Note : If you have not selected additional partitions it will do nothing and is save to continue. command: fastboot_flash_additional_partitions - type: call_button content: > diff --git a/openandroidinstaller/assets/configs/avicii.yaml b/openandroidinstaller/assets/configs/avicii.yaml index 627e3bc9..9befd3fb 100644 --- a/openandroidinstaller/assets/configs/avicii.yaml +++ b/openandroidinstaller/assets/configs/avicii.yaml @@ -34,6 +34,12 @@ steps: adapting and repairing of the operating system. Make sure your device is turned on. You need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue. command: adb_reboot_bootloader + - type: call_button + content: > + Install additional partitions selected before by pressing 'Confirm and run'. Once it's done continue. + + Note : If you have not selected additional partitions it will do nothing and is save to continue. + command: fastboot_flash_additional_partitions - type: call_button img: twrp-start.jpeg content: > diff --git a/openandroidinstaller/assets/configs/dre.yaml b/openandroidinstaller/assets/configs/dre.yaml index 366ea8a0..94e4fe80 100644 --- a/openandroidinstaller/assets/configs/dre.yaml +++ b/openandroidinstaller/assets/configs/dre.yaml @@ -40,6 +40,12 @@ steps: content: > Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. command: fastboot_boot_recovery + - type: call_button + content: > + Install additional partitions selected before by pressing 'Confirm and run'. Once it's done continue. + + Note : If you have not selected additional partitions it will do nothing and is save to continue. + command: fastboot_flash_additional_partitions - type: call_button content: > In some cases, the inactive slot can be unpopulated or contain much older firmware than the active slot, leading to various issues including a potential hard-brick. diff --git a/openandroidinstaller/assets/configs/guacamole.yaml b/openandroidinstaller/assets/configs/guacamole.yaml index 3773a13c..94e128ce 100644 --- a/openandroidinstaller/assets/configs/guacamole.yaml +++ b/openandroidinstaller/assets/configs/guacamole.yaml @@ -34,6 +34,12 @@ steps: adapting and repairing of the operating system. Make sure your device is turned on. You need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue. command: adb_reboot_bootloader + - type: call_button + content: > + Install additional partitions selected before by pressing 'Confirm and run'. Once it's done continue. + + Note : If you have not selected additional partitions it will do nothing and is save to continue. + command: fastboot_flash_additional_partitions - type: call_button img: twrp-start.jpeg content: > diff --git a/openandroidinstaller/assets/configs/hotdog.yaml b/openandroidinstaller/assets/configs/hotdog.yaml index 46e886b8..f6579059 100644 --- a/openandroidinstaller/assets/configs/hotdog.yaml +++ b/openandroidinstaller/assets/configs/hotdog.yaml @@ -34,6 +34,12 @@ steps: adapting and repairing of the operating system. Make sure your device is turned on. You need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue. command: adb_reboot_bootloader + - type: call_button + content: > + Install additional partitions selected before by pressing 'Confirm and run'. Once it's done continue. + + Note : If you have not selected additional partitions it will do nothing and is save to continue. + command: fastboot_flash_additional_partitions - type: call_button img: twrp-start.jpeg content: > diff --git a/openandroidinstaller/assets/configs/hotdogb.yaml b/openandroidinstaller/assets/configs/hotdogb.yaml index d5be5b19..0499db04 100644 --- a/openandroidinstaller/assets/configs/hotdogb.yaml +++ b/openandroidinstaller/assets/configs/hotdogb.yaml @@ -34,6 +34,12 @@ steps: adapting and repairing of the operating system. Make sure your device is turned on. You need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue. command: adb_reboot_bootloader + - type: call_button + content: > + Install additional partitions selected before by pressing 'Confirm and run'. Once it's done continue. + + Note : If you have not selected additional partitions it will do nothing and is save to continue. + command: fastboot_flash_additional_partitions - type: call_button img: twrp-start.jpeg content: > diff --git a/openandroidinstaller/tooling.py b/openandroidinstaller/tooling.py index 03dcff5a..40187618 100644 --- a/openandroidinstaller/tooling.py +++ b/openandroidinstaller/tooling.py @@ -482,6 +482,7 @@ def fastboot_flash_additional_partitions( dtbo: Optional[str], vbmeta: Optional[str], super_empty: Optional[str], + vendor_boot: Optional[str], is_ab: bool = True, ) -> TerminalResponse: """Flash additional partitions (dtbo, vbmeta, super_empty) with fastboot.""" @@ -527,6 +528,19 @@ def fastboot_flash_additional_partitions( else: yield True + if vendor_boot: + logger.info("vendor_boot selected. Flashing vendor_boot partition.") + for line in run_command( + "fastboot flash vendor_boot ", target=f"{vendor_boot}", bin_path=bin_path + ): + yield line + if not is_ab: + if (type(line) == bool) and not line: + logger.error("Flashing vendor_boot failed.") + yield False + else: + yield True + def heimdall_wait_for_download_available(bin_path: Path) -> bool: """Use heimdall detect to wait for download mode to become available on the device.""" diff --git a/openandroidinstaller/views/step_view.py b/openandroidinstaller/views/step_view.py index 3fbe2af3..ef467351 100644 --- a/openandroidinstaller/views/step_view.py +++ b/openandroidinstaller/views/step_view.py @@ -249,6 +249,7 @@ def call_to_phone(self, e, command: str): dtbo=self.state.dtbo_path, vbmeta=self.state.vbmeta_path, super_empty=self.state.super_empty_path, + vendor_boot=self.state.vendor_boot_path, is_ab=self.state.config.is_ab, ), "fastboot_reboot": fastboot_reboot,