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

Commit f573b9c2 authored by Ahmed Harhash's avatar Ahmed Harhash
Browse files

Merge branch '1099-u-avicii' into 'v1-u'

flash: Add OnePlus Nord (avicii)

See merge request !185
parents 082a5b2d 40015e5a
Loading
Loading
Loading
Loading
Loading

flash/avicii/config.mk

0 → 100644
+10 −0
Original line number Diff line number Diff line
HLOS_IMAGES_TARGET := boot.img \
    dtbo.img \
    odm.img \
    product.img \
    recovery.img \
    system.img \
    system_ext.img \
    vbmeta.img \
    vbmeta_system.img \
    vendor.img
+22 −0
Original line number Diff line number Diff line
#!/usr/bin/env bash

# Target device info
PRODUCT="OnePlus Nord"
PRODUCT_ID="lito"

# Target Flashing Images info
FLASH_AB_FW_IMGS="abl aop bluetooth devcfg dsp featenabler hyp imagefv keymaster logo modem qupfw storsec tz uefisecapp xbl_config xbl"
FLASH_AB_IMGS="boot dtbo recovery vbmeta vbmeta_system"
FLASH_A_IMGS="odm product system system_ext vendor"
ERASE_IMGS="userdata metadata"

# Target flash process behavior
CLEAN_FLASH=true
VIRTUAL_AB=false
USE_FASTBOOTD=true

# Source common functions
source ./factory.common || { echo "ERROR: Failed to source factory.common"; exit 1; }

# Common flashing function
flash_factory
+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 ""
}