[Treble-Enabled Device Questions and Answers] itb44:
Update: Worked through many issues below. Latest issue is that all AOSP images that I've tried so far are having infinite boot loops with recovery mode unavailable, but I am now able to revert to stock.

-----------------------------

Blu G5 "data too large"?

Hi! I'm trying to flash Treble AOSP (Android 10 or 11) to a Blu G5 dual-SIM (originally Android 9 Pie) GSM/HSPA/LTE phone. It's got a Unisoc SC9863A Octa-Core 1.6GHz ARM Cortex-A55 chipset, 2 GB of RAM and 32 GB of internal storage. The treblechecker app said it's A-only (single partition) ARM64.

I started with a factory reset, then used adb and a modified fastboot (from Hovatek) under linux to get the identifier token and unlock the bootloader. The issue is that every system image that I've tried to flash failed due to "data too large", and some were even smaller than the stock image!

root@slax:~/Desktop/Blu-G5-AndroidUpgrade/platform-tools_r31.0.2-linux/platform-tools# ./fastboot flash system system-roar-arm64-aonly-vanilla.img
target didn't report max-download-size
sending 'system' (1745204 KB)...
FAILED (remote: data too large)
finished. total time: 0.001s

Since there was a newer (r31.0.3) version of fastboot for Windows, I tried that but I'm still getting the same failure:

C:\platform-tools>fastboot flash system system-arm64-aonly-vanilla-nosu.img
Sending 'system' (1282352 KB) FAILED (remote: 'data too large')
fastboot: error: Command failed

So far, I've tried each of the following separately, but each just hangs on this phone:

C:\platform-tools>fastboot flash vbmeta vbmeta.img --disable-verity --disable-verification
Rewriting vbmeta struct at offset: 0
Sending 'vbmeta' (4 KB) OKAY [ 0.001s]
Writing 'vbmeta' ^C

C:\platform-tools>fastboot delete-logical-partition product
Deleting 'product' ^C

Any ideas?

EDIT 1: This is what worked to flash it with AOSP 11.0 v312 (although now it's in an infinite boot loop so I guess I shouldn't have skipped over AOSP 10):

C:\platform-tools>fastboot -S 300M flash system system-roar-arm64-aonly-gapps.img
Invalid sparse file format at header magic
Sending sparse 'system' 1/9 (307196 KB) FAILED (remote: 'data too large')
fastboot: error: Command failed

C:\platform-tools>fastboot -S 256M flash system system-roar-arm64-aonly-gapps.img
Invalid sparse file format at header magic
Sending sparse 'system' 1/10 (262108 KB) OKAY [ 11.080s]
Writing 'system' OKAY [ 9.083s]
Sending sparse 'system' 2/10 (262112 KB) OKAY [ 11.067s]
Writing 'system' OKAY [ 9.002s]
Sending sparse 'system' 3/10 (262100 KB) OKAY [ 11.080s]
Writing 'system' OKAY [ 14.711s]
Sending sparse 'system' 4/10 (262124 KB) OKAY [ 11.075s]
Writing 'system' OKAY [ 8.981s]
Sending sparse 'system' 5/10 (262128 KB) OKAY [ 11.082s]
Writing 'system' OKAY [ 8.940s]
Sending sparse 'system' 6/10 (262128 KB) OKAY [ 11.074s]
Writing 'system' OKAY [ 8.937s]
Sending sparse 'system' 7/10 (262120 KB) OKAY [ 11.079s]
Writing 'system' OKAY [ 9.004s]
Sending sparse 'system' 8/10 (256832 KB) OKAY [ 10.940s]
Writing 'system' OKAY [ 15.842s]
Sending sparse 'system' 9/10 (262142 KB) OKAY [ 11.120s]
Writing 'system' OKAY [ 11.342s]
Sending sparse 'system' 10/10 (131693 KB) OKAY [ 5.578s]
Writing 'system' OKAY [ 5.648s]
Finished. Total time: 209.427s

Of course it can't connect by adb, and when I try to get it into recovery mode (by Volume Up + Power buttons together until recovery mode screen appears, then when you see the BLU logo release the Power button, but keep holding Volume Up until the recovery mode screen comes), it just freezes. Any unbricking ideas?

EDIT 2: I've just tried the SPD Upgrade Tool (SPDFlashTool.com) R25.20.3901 with the stock ROM BLU_G0090_V9.0.04.04, but the tool can't seem to access the phone during the infinite boot loops or when I freeze it my trying to enter recovery mode...

EDIT 3: I guess it was only soft-bricked since unbricked once with battery pull then Vol-DOWN and Power until knocked down Android ("No Command") icon showed for an instant, then used SPD Upgrde Tool for back to stock. Loaded stock, set USB debugging, used cmd for abd and tried to reboot to fastboot, but it entered bootloop so bricked again. It's almost as if these might have A/B boot partitions after all, but I don't know how to switch between them. I'll try again later...

EDIT 4: Got back to stock with SPD Upgrade Tool again and all seemed fine. Factory Reset, and enabled USB debugging. Then flashed to AOSP 10.0 v201 this time, but got an infinite boot loop with no recovery mode again. Anyone know what I'm doing wrong? At least I found a way to get back to stock more easily afterwards by priming SPD Upgrade then holding power and volume buttons between the automatic reboots until the stock firmware started reflashing. :)

Microsoft Windows [Version 10.0.19043.1237]
(c) Microsoft Corporation. All rights reserved.

C:\platform-tools>adb devices -l
List of devices attached
[16 digits redacted] device product:BLU_G5 model:G5 device:G0090 transport_id:1

C:\platform-tools>adb reboot bootloader

C:\platform-tools>fastboot devices
[16 digits redacted] fastboot

C:\platform-tools>fastboot flash -S 256M system system-arm64-aonly-vanilla-nosu.img
Sending sparse 'system' 1/5 (262140 KB) OKAY [ 11.697s]
Writing 'system' OKAY [ 8.947s]
Sending sparse 'system' 2/5 (262140 KB) OKAY [ 11.662s]
Writing 'system' OKAY [ 8.923s]
Sending sparse 'system' 3/5 (262140 KB) OKAY [ 11.703s]
Writing 'system' OKAY [ 8.914s]
Sending sparse 'system' 4/5 (262140 KB) OKAY [ 11.755s]
Writing 'system' OKAY [ 8.919s]
Sending sparse 'system' 5/5 (233792 KB) OKAY [ 10.400s]
Writing 'system' OKAY [ 7.957s]
Finished. Total time: 100.914s

C:\platform-tools>fastboot reboot
Rebooting OKAY [ 0.001s]
Finished. Total time: 0.002s