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

Commit 15d3f320 authored by Sahil Sonar's avatar Sahil Sonar 💬
Browse files

Merge branch '1701-a15-GS290' into 'a15'

flash: Add GS290

See merge request !249
parents 0fe6acdf 95b22264
Loading
Loading
Loading
Loading

flash/GS290/config.mk

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

# Target device info
PRODUCT="Gigaset GS290"
PRODUCT_ID="k63v2_64_bsp"

# Target Flashing Images info
FLASH_A_FW_IMGS="logo md1dsp md1img spmfw lk lk2:lk.img sspm_1:sspm.img sspm_2:sspm.img tee1:trustzone1.bin tee2:trustzone2.bin"
FLASH_A_EARLY_IMGS="boot dtbo recovery preloader"
FLASH_A_IMGS="product system system_ext vendor"
ERASE_IMGS="userdata metadata"

# Target flash process behavior
CLEAN_FLASH=true
USE_FASTBOOTD=true
WIPE_SUPER=true

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

# Common flashing function
flash_factory
+20 −3
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() {
@@ -156,6 +161,12 @@ then
  "${FASTBOOT_BIN}" -s "${sn}" reboot bootloader
fi

if [ "${WIPE_SUPER}" = "true" ]
then
  echo "INFO: Wiping super image"
  "${FASTBOOT_BIN}" -s "${sn}" wipe-super "${IMAGES_DIR}/super_empty.img"
fi

  flash_images_ab_or_abort "${sn}" "${FLASH_AB_IMGS}"
  flash_images_a_or_abort  "${sn}" "${FLASH_A_IMGS}"

@@ -177,9 +188,12 @@ flash_factory() {
  USE_FASTBOOTD="${USE_FASTBOOTD:-false}"
  FW_BL_RESTART="${FW_BL_RESTART:-false}"
  CLEAN_FLASH="${CLEAN_FLASH:-false}"
  WIPE_SUPER="${WIPE_SUPER:-false}"
  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:-}"
@@ -190,13 +204,16 @@ flash_factory() {
  # If only one device is found $sn will store its serial number
  find_device

  # 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

  # Check if the device is properly unlocked
  check_unlock_status

  # Flash the device
  flash_device