Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4eb9b627 authored by Sahil Sonar's avatar Sahil Sonar 💬
Browse files

flash: factory.common: Add early A-only/AB image flashing

Retrofit devices require flashing boot before switching to fastbootd.
parent 91493f28
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -144,6 +144,11 @@ switch_to_fastbootd() {
  echo "INFO: Device is now in fastbootd mode."
}

# Flash (or manipulate) relevant early partitions
flash_device_early() {
  flash_images_ab_or_abort "${sn}" "${FLASH_AB_EARLY_IMGS}"
  flash_images_a_or_abort  "${sn}" "${FLASH_A_EARLY_IMGS}"
}

# Flash (or manipulate) relevant partitions
flash_device() {
@@ -180,6 +185,8 @@ flash_factory() {
  VIRTUAL_AB="${VIRTUAL_AB:-false}"
  FLASH_AB_FW_IMGS="${FLASH_AB_FW_IMGS:-}"
  FLASH_A_FW_IMGS="${FLASH_A_FW_IMGS:-}"
  FLASH_AB_EARLY_IMGS="${FLASH_AB_EARLY_IMGS:-}"
  FLASH_A_EARLY_IMGS="${FLASH_A_EARLY_IMGS:-}"
  FLASH_AB_IMGS="${FLASH_AB_IMGS:-}"
  FLASH_A_IMGS="${FLASH_A_IMGS:-}"
  ERASE_IMGS="${ERASE_IMGS:-}"
@@ -193,6 +200,9 @@ flash_factory() {
  # Check if the device is properly unlocked
  check_unlock_status

  # Retrofit devices require flashing boot before switching to fastbootd
  flash_device_early

  if [ "${USE_FASTBOOTD}" = "true" ]; then
    switch_to_fastbootd
  fi