From 47b3dd58f9a5cdc3d51d245eed4fdfea5b503136 Mon Sep 17 00:00:00 2001 From: SahilSonar Date: Sun, 5 Apr 2026 14:37:22 +0530 Subject: [PATCH 1/7] flash: Add GS290 --- flash/GS290/config.mk | 9 +++++++++ flash/GS290/flash_GS290_factory.sh | 20 ++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 flash/GS290/config.mk create mode 100644 flash/GS290/flash_GS290_factory.sh diff --git a/flash/GS290/config.mk b/flash/GS290/config.mk new file mode 100644 index 0000000..78ab127 --- /dev/null +++ b/flash/GS290/config.mk @@ -0,0 +1,9 @@ +HLOS_IMAGES_TARGET := boot.img \ + cache.img \ + dtbo.img \ + product.img \ + recovery.img \ + system.img \ + system_ext.img \ + vbmeta.img \ + vendor.img diff --git a/flash/GS290/flash_GS290_factory.sh b/flash/GS290/flash_GS290_factory.sh new file mode 100644 index 0000000..8d2aee6 --- /dev/null +++ b/flash/GS290/flash_GS290_factory.sh @@ -0,0 +1,20 @@ +#!/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 preloader" +FLASH_A_IMGS="boot dtbo recovery product system system_ext vendor" +ERASE_IMGS="userdata metadata" + +# Target flash process behavior +CLEAN_FLASH=true +USE_FASTBOOTD=true + +# Source common functions +source ./factory.common || { echo "ERROR: Failed to source factory.common"; exit 1; } + +# Common flashing function +flash_factory -- GitLab From fe4dc985709dedcd36ccc286c3cb2ceac4b8fe61 Mon Sep 17 00:00:00 2001 From: SahilSonar Date: Tue, 7 Apr 2026 15:37:47 +0530 Subject: [PATCH 2/7] flash: factory.common: Move check_unlock_status check early --- flash/factory.common | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flash/factory.common b/flash/factory.common index 9131a7d..6b504e5 100755 --- a/flash/factory.common +++ b/flash/factory.common @@ -190,13 +190,13 @@ 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 + if [ "${USE_FASTBOOTD}" = "true" ]; then switch_to_fastbootd fi - # Check if the device is properly unlocked - check_unlock_status - # Flash the device flash_device -- GitLab From 118b34ae50c5ae2ec6f08be4d65d6d2d39f911d7 Mon Sep 17 00:00:00 2001 From: SahilSonar Date: Tue, 7 Apr 2026 15:44:33 +0530 Subject: [PATCH 3/7] flash: factory.common: Add early A-only/AB image flashing Retrofit devices require flashing boot before switching to fastbootd. --- flash/factory.common | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/flash/factory.common b/flash/factory.common index 6b504e5..fd2c5b4 100755 --- a/flash/factory.common +++ b/flash/factory.common @@ -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() { @@ -180,6 +185,8 @@ flash_factory() { 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:-}" @@ -193,6 +200,9 @@ flash_factory() { # 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 -- GitLab From 46b56fe076e61115ba867bf47c5259ccc62c64c9 Mon Sep 17 00:00:00 2001 From: SahilSonar Date: Tue, 7 Apr 2026 16:11:23 +0530 Subject: [PATCH 4/7] flash: factory.common: Add WIPE_SUPER flag Dynamic retrofit device requires erasing super --- flash/factory.common | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/flash/factory.common b/flash/factory.common index fd2c5b4..d6d076d 100755 --- a/flash/factory.common +++ b/flash/factory.common @@ -161,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}" @@ -182,6 +188,7 @@ 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:-}" -- GitLab From 1e8cac180e0bf0198c37b52de8412f02f9a1ac21 Mon Sep 17 00:00:00 2001 From: SahilSonar Date: Tue, 7 Apr 2026 15:48:34 +0530 Subject: [PATCH 5/7] flash: GS290: Move boot, dtbo & recovery to FLASH_A_EARLY_IMGS - The A12 build doesn't ship with retrofit dynamic partitions. - Our regular bootloader doesn't recognise logical partitions (eg system_ext, product). --- flash/GS290/flash_GS290_factory.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flash/GS290/flash_GS290_factory.sh b/flash/GS290/flash_GS290_factory.sh index 8d2aee6..c0ce4bc 100644 --- a/flash/GS290/flash_GS290_factory.sh +++ b/flash/GS290/flash_GS290_factory.sh @@ -6,7 +6,8 @@ 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 preloader" -FLASH_A_IMGS="boot dtbo recovery product system system_ext vendor" +FLASH_A_EARLY_IMGS="boot dtbo recovery" +FLASH_A_IMGS="product system system_ext vendor" ERASE_IMGS="userdata metadata" # Target flash process behavior -- GitLab From a1b3c9d4c9e3e5045d12b5b5b249f2dfd2c10fb1 Mon Sep 17 00:00:00 2001 From: SahilSonar Date: Tue, 7 Apr 2026 16:03:33 +0530 Subject: [PATCH 6/7] flash: GS290: Move preloader to FLASH_A_FW_IMGS * fastbootd doesn't support flashing preloader yet. --- flash/GS290/flash_GS290_factory.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flash/GS290/flash_GS290_factory.sh b/flash/GS290/flash_GS290_factory.sh index c0ce4bc..8d0c931 100644 --- a/flash/GS290/flash_GS290_factory.sh +++ b/flash/GS290/flash_GS290_factory.sh @@ -5,8 +5,8 @@ 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 preloader" -FLASH_A_EARLY_IMGS="boot dtbo recovery" +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" -- GitLab From 95b2226492819dca5a1e689e022ea609be923765 Mon Sep 17 00:00:00 2001 From: SahilSonar Date: Tue, 7 Apr 2026 16:13:30 +0530 Subject: [PATCH 7/7] flash: GS290: Ship super_empty.img & enable WIPE_SUPER --- flash/GS290/config.mk | 1 + flash/GS290/flash_GS290_factory.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/flash/GS290/config.mk b/flash/GS290/config.mk index 78ab127..fd2cddd 100644 --- a/flash/GS290/config.mk +++ b/flash/GS290/config.mk @@ -4,6 +4,7 @@ HLOS_IMAGES_TARGET := boot.img \ product.img \ recovery.img \ system.img \ + super_empty.img \ system_ext.img \ vbmeta.img \ vendor.img diff --git a/flash/GS290/flash_GS290_factory.sh b/flash/GS290/flash_GS290_factory.sh index 8d0c931..cc70ef7 100644 --- a/flash/GS290/flash_GS290_factory.sh +++ b/flash/GS290/flash_GS290_factory.sh @@ -13,6 +13,7 @@ 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; } -- GitLab