[Development] Custom Twrp porting
[Development] Custom Twrp porting
(06-07-2019, 05:41 PM)Raopiplus This is my first attempt at writing a guide for porting TWRP by manual method. So I will visit a few times to followup/ clarify any issues as required.You can share that twrp here so it can be helpful for other people's.
Porting of twrp on spreadtrum device posed a few challenges. I could not use autotwrp as the resultant image could be flashed but didnot boot to recovery.
Hence i decided to port manually. the first requirement was to find a compatible twrp image of same processor and specs. in my case the soc was sc9850ka.
First i failed but later i found that i have to get the TWRP image of same soc with the same extension which in my case was sc9850ka_2C30/20. Generally you can find it out when the pac file is loaded in SPD rearchdownload tool.(it will come out in the header of the Tool.) Otherwise you have to see the temporary files in the researchdownload tool for the xml file. It will be labelled like sc9850ka_2C30/20.xml.
Once you have the correct TWRP image file porting is more or less straightforward.
Using Carliv image kitchen extract twrp.img as port recovery. You may have to rename TWRP.img as recovery.img. copy the extracted recovery folder to a new folder and name it port
Take stock recovery.img and repeat same steps, copy the extracted folder to new folder and rename it stock.
now open stock folder and port folder side by side. each will contain recovery folder. Open both. Copy all the files except ramdisk folder from stock to port recovery folder.
Say yes to overwite all port files(9 recovery*.* in my case.)
Now open ramdisk folder in stock and port folders. Load fstab.* of port and recovery in notepad++. Run plugins compare, compare.
Notespad will highlight differences. Copy differing lines from stock to port, save port fstab.*(fstab.sp9850ka_2c30 in my case).
copy recovery folder of ported recovery and replace it in carliv image kitchen of TWRP image.
Now run carliv image kitchen and opt to repack ported recovery folder. It will repack adding date to output recovery image.
rename it to recovery.img and flash it either through fastboot or using spd flash tool.
Better to open two separate carliv image kitchen folders and use one for stock recovery image and another for port recovery image extraction and repacking.
HTH
(09-07-2019, 06:26 AM)Raopiplus Sorry as I do not wish to have any kind of cloud account. I can email to you if you wish to have a copy of TWRP.img of
Lemust or Ziox_duopix. No problem