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

Commit 0e438b2d authored by Sahil Sonar's avatar Sahil Sonar 💬
Browse files

Merge branch '1705-a16-GS290' into 'a16'

flash: factory.common: Skip super-wipe if system is logical

See merge request !259
parents 0eb24a59 dc6241d6
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -30,8 +30,10 @@ check_unlock_status() {
      echo "Please follow the instructions to unlock the bootloader!"
      PHONE_IS_READY=false
    fi
    DEVICE_INFO_OUTPUT=$("${FASTBOOT_BIN}" oem device-info 2>&1)
    if [[ $DEVICE_INFO_OUTPUT != *"Device critical unlocked: true"* ]]; then
    DEVICE_INFO_OUTPUT=$("${FASTBOOT_BIN}" oem device-info 2>&1 || true)
    if [[ $DEVICE_INFO_OUTPUT == *"unknown command"* ]] || [[ $DEVICE_INFO_OUTPUT == *"FAILED"* ]]; then
      echo "Info: Device does not support 'oem device-info', skipping critical unlock check."
    elif [[ $DEVICE_INFO_OUTPUT != *"Device critical unlocked: true"* ]]; then
      echo "Error: Critical partitions are not unlocked."
      echo "Please execute 'fastboot flashing unlock_critical' first!"
      PHONE_IS_READY=false
@@ -164,8 +166,13 @@ fi

if [ "${WIPE_SUPER}" = "true" ]
then
  IS_LOGICAL=$("${FASTBOOT_BIN}" -s "${sn}" getvar is-logical:system 2>&1 | grep "is-logical:system" | awk '{print $2}')
  if [ "${IS_LOGICAL}" != "yes" ]; then
    echo "INFO: Wiping super image"
    "${FASTBOOT_BIN}" -s "${sn}" wipe-super "${IMAGES_DIR}/super_empty.img"
  else
    echo "INFO: System partition is already logical, skipping wipe-super"
  fi
fi

  flash_images_ab_or_abort "${sn}" "${FLASH_AB_IMGS}"