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

Commit 2f843216 authored by Bharath's avatar Bharath
Browse files

Simplify flash script

* Drop logic that checks OS types.
* Drop reboot function since device reboots after locking step.

Change-Id: I730d727e7a4b6a409194162c595500a460875328
parent 95e01b8c
Loading
Loading
Loading
Loading
+3 −34
Original line number Original line Diff line number Diff line
@@ -150,38 +150,8 @@ flash_image_ab_or_abort() {


# Operating system checks and variable definition
# Operating system checks and variable definition
os_checks() {
os_checks() {
  case "$(uname -s 2> /dev/null)" in
    Darwin)
      echo "INFO: You are using macOS."
      FASTBOOT_BIN="${ROOT_DIR}/bin-darwin/fastboot"
      SHA256SUM_BIN=$(which shasum)
      SHA256SUM_CMD=("${SHA256SUM_BIN}" --algorithm 256 --status --check "${SHA256SUMS}")
      ;;
    Linux|GNU/Linux)
  echo "INFO: You are using a Linux distribution."
  echo "INFO: You are using a Linux distribution."
  FASTBOOT_BIN="${ROOT_DIR}/bin-linux-x86/fastboot"
  FASTBOOT_BIN="${ROOT_DIR}/bin-linux-x86/fastboot"
      ;;
    msys|MINGW*)
      echo "INFO: You are using MinGW on Windows"
      FASTBOOT_BIN="${ROOT_DIR}/bin-msys/fastboot.exe"
      ;;
    *)
      echo "ERROR: Unsupported operating system (${OSTYPE})."
      echo "ERROR: Only GNU/Linux, macOS, and MinGW on Windows are supported."
      abort_now
      ;;
  esac
}

# Control the reboot sequence
reboot_device() {
  echo "-----------"
  echo ""
  echo "INFO: Done. The device will reboot now."
  ${FASTBOOT_BIN} -s "${sn}" reboot
  echo ""
  echo "INFO: You can unplug the USB cable now."
  echo ""
}
}




@@ -189,6 +159,7 @@ echo ""
echo "*** ${PRODUCT} flashing script ***"
echo "*** ${PRODUCT} flashing script ***"
echo ""
echo ""
echo "INFO: The procedure will start soon. Please wait..."
echo "INFO: The procedure will start soon. Please wait..."
echo "Note that this will detect and flash only on FP3 or FP3+ devices."
sleep 2
sleep 2


# Begin with some OS checks and variable definition
# Begin with some OS checks and variable definition
@@ -200,5 +171,3 @@ find_device


# Flash the device
# Flash the device
flash_device
flash_device

reboot_device