TCL A509DL NO FASTBOOT-ABILITY??

Search This thread

JansenLove

Member
Nov 1, 2021
11
2
Georgia
www.smule.com
Hey there guys and girls. I just bought a cheap TCL A509DL to experiment with and immediately hit a roadblock of megalithic proportions...no fastboot mode available on this cracker-jack prize equivalent phone. Seriously...no way to boot into fastboot mode.
All the usual processes have been eliminated...enabled Developer options, enabled OEM Unlock for Bootloader, enabled Usb debugging, etc...all ready, set, don't go.
I powered off the phone, restarted while holding the power+vol dwn, pwr+vol up, pwr+vol up and down, pwr+assistant key, pwr+vol up+assistant key and every combo thereof including every combon with the battery removed and USB connected while keys pressed. I gotta get to this fastboot or I'll go nuts...PLEASE!! Somebody help!!
 

Attachments

  • WIN_20211103_19_18_11_Pro.jpg
    WIN_20211103_19_18_11_Pro.jpg
    257.2 KB · Views: 159

jp2022

Member
Nov 25, 2022
8
2
Lol that is a bit outside my skill set… I just needed to root this to bypass drm on a vehicle head unit… will the super rom address this? What’s the real benefit to installing custom rom?
 
Lol that is a bit outside my skill set… I just needed to root this to bypass drm on a vehicle head unit… will the super rom address this? What’s the real benefit to installing custom rom?
I'll give you a super loose explanation- in my case of running Cherish, it is essentially a similar experience to vanilla Android 13 with some added tweaks for the UI and customizing. Additionally, running a custom super image basically removes all vendor junk and unnecessary apps. Up to you, but for me I wanted Android 13 (this device runs 11 out of the box) and didn't necessarily care about root. I can now add on what I want without all the unnecessary vendor (US.CELL/S.TALK) garbage. It may take care of whatever issue you are running in to as well.

In my Mega link above I have the Cherish build I am running. So far I haven't seen any issues, but this device also isn't my 'daily driver'. I'm using this solely as a project for me to learn how the newer version of Android operate and resurrect an old hobby. If you do decide to run the Cherish super, take a backup of your existing one first and the userdata partition (keep from having to set it all up again if you revert). Load the new super and perform another factory reset. Worst case its not for you and you reload your backups.
 

971shep

Senior Member
Apr 11, 2022
59
14
Wipe the partitions for not just userdata, but also metadata and md_udc. Start here and see if she boots. I had these notes on my blog that I was writing for this and just forgot to move it over. Apologies there, original post updated. Hopefully this is the magic key for you.
In a USCellular, network unlocked, TCL A30 (Android 11), I followed the steps using mtk gui. Unlocked boot loader, deleted userdata, metadata and md_udc. Sourcing vbmeta.bin and 01_Magisk_patch_boot.bin respectively, write partitons vbmeta.bin and boot.bin.

Without relocking the bootloader, I disconnected usb and powered up. I had the red state warning that bootlooped. Under the warning it stated I needed to disable bootloader verification.

Eventually, button presses got me to the recovery screen where I powered off, connected brom mode mtk gui and locked the bootloader. It still produced the red state warning which bootlooped until button presses enabled me to power off..

Again connected mtk gui/brom and restored the backup and locked the bootloader prior to disconnecting. This restored the device.

Questions: Should I have locked the bootloader after flashing vbmeta.bin and 01_Magisk... -> boot.bin and prior to disconnecting usb?
Try patching my own boot.bin? I've seen posts about disabling dm_verity
 
In a USCellular, network unlocked, TCL A30 (Android 11), I followed the steps using mtk gui. Unlocked boot loader, deleted userdata, metadata and md_udc. Sourcing vbmeta.bin and 01_Magisk_patch_boot.bin respectively, write partitons vbmeta.bin and boot.bin.

Without relocking the bootloader, I disconnected usb and powered up. I had the red state warning that bootlooped. Under the warning it stated I needed to disable bootloader verification.

Eventually, button presses got me to the recovery screen where I powered off, connected brom mode mtk gui and locked the bootloader. It still produced the red state warning which bootlooped until button presses enabled me to power off..

Again connected mtk gui/brom and restored the backup and locked the bootloader prior to disconnecting. This restored the device.

Questions: Should I have locked the bootloader after flashing vbmeta.bin and 01_Magisk... -> boot.bin and prior to disconnecting usb?
Try patching my own boot.bin? I've seen posts about disabling dm_verity
Do not relock the bootloader, however redstate sounds like you possibly didn't flash the smaller vbmeta file. If you reflashed the one you backed up, that one won't work. From what I found that file is the "dm-verity" type check for this device and you have to wipe it out with the smaller vbmeta.bin (either I uploaded or that resides in the mtkclient folder). It may also be that your bootloader unlock didn't go as planned. When you went to recovery did it prompt you to press the powerbutton as the device was "untrusted"?
 

971shep

Senior Member
Apr 11, 2022
59
14
When you went to recovery did it prompt you to press the powerbutton as the device was "untrusted"?
My recovery options were the same as the screenshot in the first post - No prompt regarding "untrusted"

As far as a dm_verity file, my mtkclient TCLA30_dump

Code:
boot.bin        lk2.bin         otp.bin                     spmfw.bin
boot_para.bin   lk.bin          para.bin                    sspm_1.bin
cache.bin       logo.bin        persist.bin                 sspm_2.bin
dtbo.bin        logs            preloader_bangkok_uscc.bin  super.bin
efuse.bin       md1img.bin      proinfo.bin                 swversion.bin
expdb.bin       md_udc.bin      protect1.bin                tee1.bin
flashinfo.bin   metadata.bin    protect2.bin                tee2.bin
frp.bin         nvcfg.bin       recovery.bin                userdata.bin
gpt_backup.bin  nvdata.bin      scp1.bin                    vbmeta.bin
gpt.bin         nvram.bin       scp2.bin                    vbmeta_system.bin
gz1.bin         oembin.bin      sec1.bin                    vbmeta_vendor.bin
gz2.bin         oempersist.bin  seccfg.bin                  vendor_boot.bin

I'm wondering if either boot_para.bin, vbmeta_{vendor,system}.bin or preloader_bangkok_uscc.bin function as dm_verity files?

Edit: Started poking around with ghex and found 2 things of note:
vendor_boot.bin is empty - all 00 00 00 ..
My phone had been unlocked by USCellular.


vbmeta_vendor.bin may have the verification keys:
A snipet of the code:
Code:
com.android.build.vendor.fingerprint TCL/5102L/Bangkok_USCC:11/RP1A.200720.011/vFQ6A:user/release-keys
 
Last edited:
My recovery options were the same as the screenshot in the first post - No prompt regarding "untrusted"

As far as a dm_verity file, my mtkclient TCLA30_dump

Code:
boot.bin        lk2.bin         otp.bin                     spmfw.bin
boot_para.bin   lk.bin          para.bin                    sspm_1.bin
cache.bin       logo.bin        persist.bin                 sspm_2.bin
dtbo.bin        logs            preloader_bangkok_uscc.bin  super.bin
efuse.bin       md1img.bin      proinfo.bin                 swversion.bin
expdb.bin       md_udc.bin      protect1.bin                tee1.bin
flashinfo.bin   metadata.bin    protect2.bin                tee2.bin
frp.bin         nvcfg.bin       recovery.bin                userdata.bin
gpt_backup.bin  nvdata.bin      scp1.bin                    vbmeta.bin
gpt.bin         nvram.bin       scp2.bin                    vbmeta_system.bin
gz1.bin         oembin.bin      sec1.bin                    vbmeta_vendor.bin
gz2.bin         oempersist.bin  seccfg.bin                  vendor_boot.bin

I'm wondering if either boot_para.bin, vbmeta_{vendor,system}.bin or preloader_bangkok_uscc.bin function as dm_verity files?

Edit: Started poking around with ghex and found 2 things of note:
vendor_boot.bin is empty - all 00 00 00 ..
My phone had been unlocked by USCellular.


vbmeta_vendor.bin may have the verification keys:
A snipet of the code:
Code:
com.android.build.vendor.fingerprint TCL/5102L/Bangkok_USCC:11/RP1A.200720.011/vFQ6A:user/release-keys
There may be some confusion. Bootloader unlock is not the same as sim unlocking. Bootloader is controlled through the use of the MTKClient.

First wipe the partitions as you did before:
mtk e metadata,userdata,md_udc

Then use mtk to unlock the bootloader:
mtk da seccfg unlock

In the GUI it is on this tab:
1669775016141.png


Here is what you get by flashing the emtpy vbmeta, being unlocked and trying to boot to recovery:
1669775502240.png


You want to flash the file included in the MTKClient:
https://github.com/bkerler/mtkclient/raw/main/vbmeta.img.empty

You can download the above, save it as vbmeta.bin and flash.I also did the extra and just flashed it on all vbmeta entries.
 
I thought dm_verity had to do with bootloader verification although I'm not sure how to bypass.

https://source.android.com/docs/security/features/verifiedboot/dm-verity

I unlocked the bootloader in mtkclient before deleting the partitions. I'll give it another run.

See the above. It is all to do with proper vbmeta, the empty one, and the right magisk version. Flash all vbmeta slots with empty vbmeta and use original boot image just to test and see if you can start. If working with it unlocked go ahead and do a custom boot img.

Side note I've been working on building a kernel. I built the tool chain last night and plan to try to do the kernel this evening. A lot has changed since last time I did all this...
 

971shep

Senior Member
Apr 11, 2022
59
14
Success:)

Orange State magisk installed. Want to clarify the following:
10) Launch the Magisk, it will prompt to download. Accept and let it download and install. Once installed, there will be an app called "Alpha" installed. You can now remove the Magisk app with the generic icon.

11) At this point, go ahead and launch MTK Client and reboot again. We are going to flash the 02_magisk* boot img now. This enabled Magisk with root. Once you have flashed the 02 image, disconnect and close MTKClient. Reboot phone and wait for it to load up.

Removing Magisk with the generic icon is not just removing the icon but the entire app?
Edit: Remove entire app, not just the icon from the home page.

02_magisk* is mtkclient "write partition" tab set to boot.bin?
Edit: use the write partition tab - not the flash tools tab.

Your guide lpmake command references an Andy Yan's 18.1 build (Android 11) which ran. Your mega.nz has a vanilla Lineage 18.1 as a "no-issues" rom. For some of Phh rom's there are mediatek options that need to be enabled in treble settings.
Realme C2 (mediatek P22) w/ Phh GSI


I'd like to work toward a debloated phone running degoogled, open source apps (Bromite, Bromite system webview, K-9 Mail etc). Would you recommend a Vanilla version and sideloading the apps or use an *.img with the apps built in? An example is Phh floss apps:
Phh android 12.1 releases

Last question.; Treble check indicated my TCL A30 was vndk compatible. Is there a reason not to try a vndklite image?
Edit: The vndklite image is working well.
 
Last edited:
  • Like
Reactions: malfuncion

971shep

Senior Member
Apr 11, 2022
59
14
Thanks to heavy lifting by @malfuncion , I can report a successful Android 12.1 arm64 a/b vanilla, vndklite install from Phh release 416.

I chose this image because Phh had reported a number of Mediatek fixes/patches earlier this year and I'm not sure they ware backported to Android 11. The older webview shell cannot be uninstalled but I was able to use bromite, after sideloading it, for my default system webview..

Wireless, sim, brightness, audio work and I was able to browse to f-droid.org. Using systemwebview v95, download requests showed packets on router but nothing showed up in the Downloads folder. Will try adb sideloading work-around and report back. adb install * worked great for Bromite, Bromite system webview and f-droid. I installed the rest of the applications from f-droid.

I don't have cloud storage but will provide my linsuper.img via email. Private message me w/ your address.
 
Last edited:
  • Like
Reactions: malfuncion

971shep

Senior Member
Apr 11, 2022
59
14
I am having some minor issues with the Phh Android 12.1 GSI. F-droid worked and I was able to install my usual applications but the included File Manager would not copy to other folders Specifically, a black wallpaper that I GIMP'd to mimic GrapheneOS. and emailed went to Downloads OK but would not copy over to Images. I was able to copy it over with another File Manager but Home Screen wallpaper would browse to the *jpg but would not set.

Another example is Geometric Weather provides a nice widget and the available Geometric Weather widgets were not listed. Edit: I worked around this by sideloading Geometric Weather.


I tried changingthe ROM's Quickstep launcher to something else but still could not change the wallpaper.
A sideloaded Launcher<3 functions well.
This is my first custom ROM and I'm wondering if I have a permissions issue or something else?
 
Last edited:

971shep

Senior Member
Apr 11, 2022
59
14
I'm trying to reproduce my previous GSI and keep ending up with a dm-verity error.
Can you clarify the last steps?

Go to Write Partition:
- load the super.bin you created in the super.bin slot.
- load your vbmeta in all 3 vbmeta slots (unsure if 100% necessary, but I did).
- load the attached oempersists_clean.bin file (unsure if necessary, but I did).
- load factory boot image, otherwise it will likely fail play protect certification. You can try the steps here if you need root.

"-load the attached oempersists_clean.bin ...." is actually attached as clean_oempersists.bin. If I was to write it, where would I write it: to oempersist.bin?

"-load factory boot image, otherwise...." I'm taking "factory" to mean the stock boot.bin from the factory dump but I'm wondering if this is giving me the dm_verity error? What you linked to said:
no. if it's locked, then it means that a system file / verification didn't pass. then you need to write back stock boot / vbmeta etc. what you have changed. Also you will need to wipe userdata / metadata / md_udc of course.

Should we also write back the stock vbmeta, vbmeta_system and vbmeta_vendor?

Another issue appears to be a Magisk change on the second reboot, alpha give 2 options: direct install (recommended) and patch bootloader. I do not recall this on my earlier attempts I chose direct install - maybe I should have patched the bootloader..

Lastly, my inclination is to lock the bootloader after all the mtkclient operations. My understanding is that this is not possible - even with the small vbmeta overwrites.
 
Last edited:

971shep

Senior Member
Apr 11, 2022
59
14
A summary of a successful flash on a TCL A30:

Needed Software tools:

1. Android Platform tools with adb.

Platform Tools - Upstream Android
Android tools - Arch Linux

2. @malfunction zip file

3. A recent version of mtkclient. Note that in Arch Linux the version of mtkclient (1.52.1) uses an older command syntax to unlock/lock the bootloader. mtkclient-git has the newer syntax and numerous fixes and was used. The Arch linux install does not provide a mtk_gui.

AUR mtkclient-git

It is easier with a _gui but I will provide copy/paste commands for command line syntax. Executing the mtk command and then connecting the powered-off phone to usb consistently established brom mode and executed the command. Once connected in brom mode, additional mtk commands can be run until the instructions call for a phone reboot

Process.

1. Make a backup dump of all partitions:
Note that in Arch linux with a system mtkclient-git you do not need to specify python in the command. "out" is the output directory.

Code:
[python] mtk rl "out"
With Arch Linux system wide install, drop [python] on all subsequent commands.
For example the previous command would be
Code:
mtk rl "out"

You should see these files:
Code:
boot.bin        lk2.bin         otp.bin                     spmfw.bin
boot_para.bin   lk.bin          para.bin                    sspm_1.bin
cache.bin       logo.bin        persist.bin                 sspm_2.bin
dtbo.bin        logs            preloader_bangkok_uscc.bin  super.bin
efuse.bin       md1img.bin      proinfo.bin                 swversion.bin
expdb.bin       md_udc.bin      protect1.bin                tee1.bin
flashinfo.bin   metadata.bin    protect2.bin                tee2.bin
frp.bin         nvcfg.bin       recovery.bin                userdata.bin
gpt_backup.bin  nvdata.bin      scp1.bin                    vbmeta.bin
gpt.bin         nvram.bin       scp2.bin                    vbmeta_system.bin
gz1.bin         oembin.bin      sec1.bin                    vbmeta_vendor.bin
gz2.bin         oempersist.bin  seccfg.bin                  vendor_boot.bin

2. Unlock the bootloader

Code:
[python] mtk da seccfg unlock

3. Erase metadata,userdata,md_udc

Code:
[python] mtk e metadata,userdata,md_udc

4. Overwrite all Verified Boot (vbmeta) with the blank vbmeta

Code:
[python] mtk w vbmeta vbmeta.bin
[python] mtk w vbmeta_system vbmeta.bin
[python] mtk w vbmeta_vendor vbmeta.bin

5. Overwrite boot.bin with the first Magisk patched boot file

Code:
[python] mtk w boot 01_magisk_patch_boot.bin

6. Disconnect usb to the phone an reboot. The phone will have no configuration and you essentially need to establish a wifi connection. Once the phone is online, long press the Magisk icon and enable the Magisk app to install additional applications. Relaunch Magisk and follow the prompts to install "Alpha" version of Magisk. Reboot the phone and then power it off.

7. Overwrite the 01_magisk patched boot.bin with 02_magisk_patched-25205_yIaU6.bin
Code:
[python] mtk w boot 02_magisk_patched-25205_yIaU6.bin

disconnect usb and reboot the phone.

8. Launch "Alpha". It now alerts you that a new version of Magisk is available and asks you to install it. It is easiest to not update. If you want to update later, you will need the factory boot.bin on /sdcard/Download and follow the Magisk Install instuctions:

9. Unpack your super.bin, delete the product and system.bin's. Copy your chosen gsi into the unpacked super.bin and repack it. The instructions are described in this post:

XDA post 87742419

I did not load the factory boot image although it would have been helpful to have in storage (Downloads or SDcard for subsequent patching by Magisk. Do not relock the bootloaderj; you will get a "Red State" on boot.

@malfunction provides a tested repacked super.bin with Cherish Android 11 on his download site. I have two Phh GSI repacks that have been tested but have no download site. Both *super.bins are under 6GB.

10. Erase metadata, md_udc, userdata and write the repacked super.bin over the phones super
Code:
[python] mtk e metadata, md_udc, userdata
[python] mtk w super linsuper.bin


11. Install your apps. Initially, using F-Droid, some of the apks did not fully function. Specifically Geometric weather widgets were not available. Instead, download your apks directly from the F-Droid site, and use
Code:
adb install

I specifically tested these apps:

  • Bromite
  • Bromite System webview
  • FairEmail
  • Simple Launcher
  • Geometric Weather
  • NewPipe
  • Organic Maps
  • Mpv
  • Barcode Scanner
  • Termux
  • Wikipedia
 
Last edited:
  • Like
Reactions: malfuncion
A summary of a successful flash on a TCL A30:















Needed Software tools:















1. Android Platform tools with adb.















Platform Tools - Upstream Android







Android tools - Arch Linux















2. @malfunction zip file















3. A recent version of mtkclient. Note that in Arch Linux the version of mtkclient (1.52.1) uses an older command syntax to unlock/lock the bootloader. mtkclient-git has the newer syntax and numerous fixes and was used. The Arch linux install does not provide a mtk_gui.















AUR mtkclient-git















It is easier with a _gui but I will provide copy/paste commands for command line syntax. Executing the mtk command and then connecting the powered-off phone to usb consistently established brom mode and executed the command. Once connected in brom mode, additional mtk commands can be run until the instructions call for a phone reboot















Process.















1. Make a backup dump of all partitions:







Note that in Arch linux with a system mtkclient-git you do not need to specify python in the command. "out" is the output directory.















Code:
[python] mtk rl "out"







With Arch Linux system wide install, drop [python] on all subsequent commands.







For example the previous command would be







Code:
mtk rl "out"















You should see these files:







Code:
boot.bin lk2.bin otp.bin spmfw.bin







boot_para.bin lk.bin para.bin sspm_1.bin







cache.bin logo.bin persist.bin sspm_2.bin







dtbo.bin logs preloader_bangkok_uscc.bin super.bin







efuse.bin md1img.bin proinfo.bin swversion.bin







expdb.bin md_udc.bin protect1.bin tee1.bin







flashinfo.bin metadata.bin protect2.bin tee2.bin







frp.bin nvcfg.bin recovery.bin userdata.bin







gpt_backup.bin nvdata.bin scp1.bin vbmeta.bin







gpt.bin nvram.bin scp2.bin vbmeta_system.bin







gz1.bin oembin.bin sec1.bin vbmeta_vendor.bin







gz2.bin oempersist.bin seccfg.bin vendor_boot.bin















2. Unlock the bootloader















Code:
[python] mtk da seccfg unlock















3. Erase metadata,userdata,md_udc















Code:
[python] mtk e metadata,userdata,md_udc















4. Overwrite all Verified Boot (vbmeta) with the blank vbmeta















Code:
[python] mtk w vbmeta vbmeta.bin







[python] mtk w vbmeta_system vbmeta.bin







[python] mtk w vbmeta_vendor vbmeta.bin















5. Overwrite boot.bin with the first Magisk patched boot file















Code:
[python] mtk w boot 01_magisk_patch_boot.bin















6. Disconnect usb to the phone an reboot. The phone will have no configuration and you essentially need to establish a wifi connection. Once the phone is online, long press the Magisk icon and enable the Magisk app to install additional applications. Relaunch Magisk and follow the prompts to install "Alpha" version of Magisk. Reboot the phone and then power it off.















7. Overwrite the 01_magisk patched boot.bin with 02_magisk_patched-25205_yIaU6.bin







Code:
[python] mtk w boot 02_magisk_patched-25205_yIaU6.bin















disconnect usb and reboot the phone.















8. Launch "Alpha". It now alerts you that a new version of Magisk is available and asks you to install it. It is easiest to not update. If you want to update later, you will need the factory boot.bin on /sdcard/Download and follow the Magisk Install instuctions:






















9. Unpack your super.bin, delete the product and system.bin's. Copy your chosen gsi into the unpacked super.bin and repack it. The instructions are described in this post:















XDA post 87742419















I did not load the factory boot image and did not relock the bootloader.















@malfunction provides a tested repacked super.bin with Cherish Android 11 on his download site. I have two Phh GSI repacks that have been tested but have no download site. The are under 6GB.















10. Erase metadata, md_udc, userdata and write the repacked super.bin over the phones super







Code:
[python] mtk e metadata, md_udc, userdata







[python] mtk w super linsuper.bin























11. Install your apps. Initially, using F-Droid, some of the apks did not fully function. Specifically GeometI've c weather widgets were not available. Instead, download your apks directly from the F-Droid site, and use adb install.















I specifically tested these apps:















Bromite



Bromite System webview



FairEmail



Simple Launcher



Geometric Weather



NewPipe



Organic Maps



Mpv



Barcode Scanner



Termux



Wikipedia
Nice write up. I'm adding more files to my mega soon. I've got working crDroid and xdroid installs. I've successfully wiped 3 A30s now and am working to find the smoothest running rom. So far xdroid is pretty good. Everything is functional and snappy. I also need to reload my 4th a30 (yes I'm collecting them). It was the first of all these and is still stock with just root. 2 are for my kids, one is mine to mess with and the 4th is for automation. They're just so cheap where I am; can pick them up for $15-$25 new.


I've also tried compiling the kernel a few times, but the 509 source has a compilation error with some unknown drivers. I haven't dug too much further in to it though. This is my last week until vacation and hopefully I can spend some time on this thing soon.
 
Last edited:

971shep

Senior Member
Apr 11, 2022
59
14
I've also tried compiling the kernel a few times, but the 509 source has a compilation error with some unknown drivers. I haven't dug too much further in to it though. This is my last week until vacation and hopefully I can spend some time on this thing soon.
My kernel building experience is limited to x86_64 on Crux Linux.

Android's tendency to "script" the builds and environment may be convenient, but I find it difficult to learn anything by executing a script. Ideally, go through a step at a time. My sense of the basic steps I need to implement. Comments and corrections appreciated.

1. Get latest stable source - I tend to trust upstream Google more than TCL/Alcaltel.
2. Patch if necessary
3. Configure and develop security hashes
4. Export environment
5. Build
6. Test image
7. Redo vbmeta hashes.
 
Last edited:

971shep

Senior Member
Apr 11, 2022
59
14
GPL'd source for TCL5102 just released

The [tgz] link at the end of the commit line is AOSP 4.19-stable source:
https://android.googlesource.com/kernel/common/+/refs/heads/android-4.19-stable

My approach will be
  • Setup my Arch Linux build box for android kernel compilation
  • Build a generic aarch64 gki using Google's config file
  • Import TCL config build into Google kernel tree and see what does not configure
  • Resolve missing configuration - hopefully by staying in Google source tree.
  • Be mindful of propriatary drivers and firmware. Will choose open source drivers and firmware over propritary drivers if possible
 
Last edited:
  • Like
Reactions: malfuncion
GPL'd source for TCL5102 just released

The [tgz] link at the end of the commit line is AOSP 4.19-stable source:
https://android.googlesource.com/kernel/common/+/refs/heads/android-4.19-stable

My approach will be
  • Setup my Arch Linux build box for android kernel compilation
  • Build a generic aarch64 gki using Google's config file
  • Import TCL config build into Google kernel tree and see what does not configure
  • Resolve missing configuration - hopefully by staying in Google source tree.
  • Be mindful of propriatary drivers and firmware. Will choose open source drivers and firmware over propritary drivers if possible
I have a booting kernel compiled. The touchscreen driver issue in the defconfig was a misnamed folder in the driver path. Looks like TCL renamed a folder to "_bak" that was causing some issues. There are a few other items that I'm working through, but nothing that stops compiling- just warnings. Some misc notes- the debug kernels don't have working wifi, I also found that the the TF and OM_NA variants are identical in their defconfigs outside naming.

I am now working on looking in to some tweaks, overclocking, patches and other misc interesting items for this kernel.

How is your build coming along?

Side note, I organized my mega folder that makes a little more sense and clearer navigation. I've uploaded some newer rom images and some of the compiled kernels on there as well. The boot images (kernels) aren't worth anything other than POC at the moment. That hopefully will change soon..
 
Last edited:

971shep

Senior Member
Apr 11, 2022
59
14
"How is my build coming along?"

I'm still learning. One of the challenges is that AOSP is implementing new build systems: Kleaf
https://source.android.com/docs/setup/build/building-kernels

Right now I'm working through trying the older
Code:
BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh
for android12/kernel_5.10

My sense is that BUILD_CONFIG sets ARCH=arm64 and the compiler and builds a local .config file.
Code:
$ cat build.config.mtk.aarch64.gcc
ARCH=arm64
CROSS_COMPILE=aarch64-linux-gnu-
CC=gcc
# DEFCONFIG=defconfig
KERNEL_DIR=kernel-4.19
LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=prebuilts/gcc/linux-x86/aarch64/aarch64-linux-gnu-6.3.1/bin

I've installed Arch aarch64-linux-gnu-gcc package and would like to build my own "build.config.mtk.aarch64.gcc in the asop Android12-5.10 source tree.
My build.config.mtk.aarch64.gcc
Code:
$ cat build.config.mtk.aarch64.gcc
ARCH=arm64
CROSS_COMPILE=aarch64-linux-gnu-
CC=gcc
# DEFCONFIG=defconfig
KERNEL_DIR=kernel-5.10
I hope to use the Arch Linux compiler - I should not need the *_PREBUILTS_* stanza?

It looks like the bangkok_NA_OM-defconfig will need some editing.
Code:
/tcl5102_kernel_source/kernel-4.19/arch/arm64/configs/bangkok_NA_OM_defconfig
Code:
cat bangkok_NA_OM_defconfig | grep SND

CONFIG_SND_HRTIMER=y
CONFIG_SND_DYNAMIC_MINORS=y
# CONFIG_SND_SUPPORT_OLD_API is not set
# CONFIG_SND_VERBOSE_PROCFS is not set
# CONFIG_SND_DRIVERS is not set
CONFIG_SND_USB_AUDIO=y
CONFIG_SND_SOC=y
CONFIG_MTK_SND_SOC_CODEC="mt6357"
CONFIG_SND_SOC_MTK_BTCVSD=y
CONFIG_MTK_SND_SOC_NEW_ARCH=y
#CONFIG_SND_SOC_RT5509=y
#CONFIG_SND_SMARTPA_AW881XX=y
CONFIG_SND_SOC_MT6357_ACCDET=y

In the 5.10 tree:
Code:
ls aosp_5.10/sound/soc/mediatek
common  Kconfig  Makefile  mt2701  mt6797  mt8173  mt8183

ls aosp_5.10/sound/soc/mediatek/mt6797
Makefile             mt6797-afe-pcm.c       mt6797-interconnection.h
mt6797-afe-clk.c     mt6797-dai-adda.c      mt6797-mt6351.c
mt6797-afe-clk.h     mt6797-dai-hostless.c  mt6797-reg.h
mt6797-afe-common.h  mt6797-dai-pcm.

vs the tcl 4.19 tree

Code:
ls tcl5102_kernel_source/kernel-4.19/sound/soc/mediatek

audio_dsp  codec   common_int  Makefile  mt6765  mt6797
aw87519    common  Kconfig     mt2701    mt6779  mt8173

It looks like the new 5.10 defconfig for the SND_SOC drivers should just need:
Code:
CONFIG_SND_SOC=y
CONFIG_SND_SOC_MT6797
Guessing that mt6797-mt6351.c probes/sets the specific chipset

https://android.googlesource.com/kernel/common/+/7472eb8d7dd12b6b9b1a4f4527719cc9c7f5965f

This is going to be a time consuming task but it would essentially allow me to keep the TCL A30 running on the latest AOSP stable code. I'm hoping that I can find a defconfig for a Mediatek P22 Helio device that is running Kernel 5.10.

Update.: Using Android12_5.10 kernel source and make ARCH-amd64 menuconfig, I stepped through the configuration of bangkok_NA_OM_defconfig[ and came up with a .config file. Next step is to see if I can get it to build.

Update: Have a 5.10 Image.gz file. Need to package and test.
 
Last edited:

971shep

Senior Member
Apr 11, 2022
59
14
mkbootimg does not have a man page and I'm not having getting many search hits on how to incorporate my Kernel 5.10 "Image" file into a boot.bin. I was also wondering if I could avoid overwriting boot.bin and sideload the image to the SDcard and boot it to test? Any url links to guides appreciated.

I'm hopeful that most of Mediatek's drivers have been incorporated into the newer kernel but I'm not optimistic.

On another front, Andy Yan and Phh have pooled their resources and are providing Vanilla Android 13 builds.
I've installed android_13.0.0_r14 ci-20221219/system-td-arm64-ab-vanilla.img.xz and it actually runs better than the Phh Android 12.1 than I initially tried. Phh's builds are sourced by many other projects
https://github.com/TrebleDroid/treble_experimentations/releases
 
Last edited:
mkbootimg does not have a man page and I'm not having getting many search hits on how to incorporate my Kernel 5.10 "Image" file into a boot.bin. I was also wondering if I could avoid overwriting boot.bin and sideload the image to the SDcard and boot it to test? Any url links to guides appreciated.

I'm hopeful that most of Mediatek's drivers have been incorporated into the newer kernel but I'm not optimistic.

On another front, Andy Yan and Phh have pooled their resources and are providing Vanilla Android 13 builds.
I;ve installed android_13.0.0_r14 ci-20221219/system-td-arm64-ab-vanilla.img.xz and it actually runs better than the Phh Android 12.1 than I initially tried. Phh's builds are sourced by many other projects
https://github.com/TrebleDroid/treble_experimentations/releases
I have been using a toold called mktool. I've attached it here for you to use. Basically, this tar contains the bins necessary. Extract, create 3 folders in the extracted folder: input, output, extracted. Place the working "stock" boot image in to input. Open the tool, use extract. It'll create 2 files in the extracted folder. delete the kernel image, replace with yours. Use the Mktool to zip it back up and it'll create an output img file. From here, use the python script avbtool.py to resign the new image and make its the 32mb:

python avbtool.py add_hash_footer --image new-image.img --partition_size 33554432 --partition_name boot

Now flash the image file (32mb) in the boot slot of mtkclient.
 

Attachments

  • mktool.tar.gz
    809.3 KB · Views: 5
  • Like
Reactions: 971shep

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Hey there guys and girls. I just bought a cheap TCL A509DL to experiment with and immediately hit a roadblock of megalithic proportions...no fastboot mode available on this cracker-jack prize equivalent phone. Seriously...no way to boot into fastboot mode.
    All the usual processes have been eliminated...enabled Developer options, enabled OEM Unlock for Bootloader, enabled Usb debugging, etc...all ready, set, don't go.
    I powered off the phone, restarted while holding the power+vol dwn, pwr+vol up, pwr+vol up and down, pwr+assistant key, pwr+vol up+assistant key and every combo thereof including every combon with the battery removed and USB connected while keys pressed. I gotta get to this fastboot or I'll go nuts...PLEASE!! Somebody help!!
    Hey just tried and succeeded, using python Git and mtkclient from https://forum.xda-developers.com/t/blu-b130dl-unlock-recovery-root-release.4350825/ basic same principle just swap around a few files and it worked, a509dl tcl a3 is rooted, not responsible for any damage to device, I hope y'all know what your doing
    1
    D
    Deleted member 1890170
    Check whether Fastboot is supported or not via ADB

    Code:
    adb devices
    adb reboot fastboot
    fastboot devices

    If a connection with bootloader got successfully established don't forget to end it

    Code:
    fastboot reboot
    1
    TCL is never known to have offered BL unlock for any of its device. On top of that, US carriers tend to enforce non-unlockable BL, Straight Talk / Tracfone (implied by the DL suffix) the worst among them.
    1
    Check whether Fastboot is supported or not via ADB

    Code:
    adb devices
    adb reboot fastboot
    fastboot devices

    If a connection with bootloader got successfully established don't forget to end it

    Code:
    fastboot reboot
    Hi I have tried all of the above commands and about a dozen more. I'm tempted to believe what
    I was recently told, that US Phone maker enforce the no Unlock bootloader policy. There would still need to be some window or method available for flashing in the event of a software failure, right? In the Developers menu it says the bootloader is already unlocked and the toggle is grayed out. When I reboot from ADB using adb reboot fastboot my phone reboots back to startup with no fastboot connection??
    1
    I also happened on one of these TCL A3's (A509DL), and I confirm that there is no fastboot mode, and only 3 options in recovery, no adb or sdcard or log access, strictly factory wipe and cache wipe.

    Hopefully mtkclient will crack this baby open a little bit, I left my laptop in a friend's truck, but when I get it back here in a few days ill hack the crap out of it!
    Hey bro. Thanks for responding. Let me know how it goes. I can't even find Stock Firmware for this little pain. Mine is branded TCL A509DL a friend has the exact device thru Cricket branded Alcatel with a different model number but same deal zero fastboot or bootloader for fastboot. Now I HAVE to crack this pain.