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

Verified Commit fe0cd981 authored by Ahmed Harhash's avatar Ahmed Harhash
Browse files

flash: Introduce rebooting to fastbootd

parent 082a5b2d
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -120,6 +120,18 @@ find_device() {
  done
}

# Switch to fastbootd
switch_to_fastbootd() {
  echo "INFO: Switching device to fastbootd mode..."
  "${FASTBOOT_BIN}" -s "${sn}" reboot fastboot || {
    echo "ERROR: Unable to switch to fastbootd mode."
    abort_now
  }
  sleep 5 # Wait for the device to reboot into fastbootd
  echo "INFO: Device is now in fastbootd mode."
}


# Flash (or manipulate) relevant partitions
flash_device() {
  flash_images_ab_or_abort "${sn}" "${FLASH_AB_FW_IMGS}"
@@ -155,6 +167,10 @@ flash_factory() {
  # If only one device is found $sn will store its serial number
  find_device

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

  # Check if the device is properly unlocked
  check_unlock_status

@@ -282,4 +298,3 @@ reboot_device() {
  echo "INFO: You can unplug the USB cable now."
  echo ""
}