[GUIDE][PORT] TWRP 3.0.X for Mediatek Devices.

HostZero

Senior Member
Jun 28, 2015
298
299
0
Last Of Us (Pittsburgh)
[GUIDE][PORT] TWRP 3.0.X for Mediatek Devices.

Requirements:
1. Windows/Linux/Mac PCs.
2. OFFICIAL CyanogenMod 13 Support
3. DSIXDA Kitchen.
4. Patience.
5. A bit of Computer Knowledge
6. Getting Recovery Partition Size of MTK Chipset (Google It)!


This Method is Universal Cross-Chipset Method means you can port Snapdragon Recoveries even to your MTK. dosen't matter 32bit or 64bit MTK Processor.




Thanks to @Dees_Troy for his Nexus Recoveries.

Step 1: Setting Up!
(i) Download your CyanogenMod Recovery from download.cyanogenmod.com.
(ii) Download DsiXDA Kitchen
(iii) If your on WINDOWS download CYGWIN to launch DSIXDA Kitchen.
(iv) Setup Done!

Step 2: Executing!
EXAMPLES YOU CAN USE OTHER RECOVERIES ALSO BUT AS SAME RESOLUTION AS YOUR DEVICE:
IF YOUR ON 480x850, 480x854 download: https://twrp.me/devices/lgnexus4.html latest TWRP 3.x Available!
IF YOUR ON 720x1280, 800x1280 download: https://twrp.me/devices/asusnexus720123g.html latest TWRP 3.x Available!
IF YOUR ON 1080x1920 download: https://twrp.me/devices/motorolanexus6.html latest TWRP 3.x Available!
Once Downloaded!
Download your CM RECOVERY from download.cyanogenmod.org/ Find your device codename and download.

Step 3: Setting Up Kitchen!
Note: In most cases of Commands Windows/Linux/Mac are same in different i will mention.

If Windows:
Code:
(i) Open Cygwin
(ii) cd <user_name>
(iii) cd kitchen
(iv) ./menu
If Linux/Mac
Code:
(i) Open Terminal
(ii) cd <kitchen_source_dir>
(iii) ./menu
Minimize The Kitchen Never Close.

Step 4: Setting up WORKING Directory

(i) Open Kitchen Installed Directory.
(ii) Make a new folder named WORKING_twrp
(iii) Copy your downloaded nexus_twrp.img to WORKING_twrp
(iv) Rename twrp.img to boot.img

Step 5: Unpacking STOCK and PORT

(i) Open DsiXDA kitchen back.
(ii) Type Options in Line:
Code:
0
12
w
press enter
(iii) Type Options in Line: If your following me as above just follow next command.
Code:
a
(iv) Now a new folder will be created in kitcher_dir named boot.img-xxxxxx (instead of xxxx some numbers) paste your downloaded cm recovery.img to boot.img-xxxxxx folder.
(v) Rename cmrecovery.img to boot.img
(vi) Open Kitchen Press Enter to continue.

NOW: BOOT-EXTRACTED = PORT
boot.img-xxxxxxxx = BASE


Copy Replace Files from BASE TO PORT and delete file in PORT:

Code:
COPY AND REPLACE FROM BASE TO PORT:
/zImage
/boot.img-ramdisk/default.prop
/boot.img-ramdisk/fstab.<codename>
/boot.img-ramdisk/uventd.rc
/boot.img-ramdisk/etc/recovery.fstab
/boot.img-ramdisk/etc/twrp.fstab (if exist no prob if it dosen't exist in PORT)
Code:
DELETE FILES FROM PORT:
/boot.img-ramdisk/fstab.<portcodename>

Step 6: Lets Repack!


Open DSIXDA Kitchen Back On!
Type Option in Line:
Code:
If you didn't close kitchen it will be minimized continue this:
[B]Option:[/B]
b
OUTPUT= /kitchen_dir/WORKING_twrp/boot.img This is your TWRP Recovery the OLD one has been replaced with REPACKED ONE

Make Sure You Provide Me PORT GUIDE Credits


I HOPE YOUR ENJOYING MY WORK :good: :laugh:

Q/A:
1. Will this Work on Above Resolution than 1080p?
A. Yes!

2. Is it mandatory to have official CM Support?
A. Yes! Because, CM and OMNI ROMS are only one which can build TWRP and CM is only one which even makes CM13 Recovery.

3. Must CM13 be based on 6.0.1 itself?
A. No, the CM Recovery Can be also on 6.0 but not 5.1 or bellow.

4. Why CM Recovery?
A. As per my knowledge CM Recovery is based on CWM as well as TWRP. so it will be easy to port TWRP for your device.

4. Bootloop?
A. Make sure you followed Step 5 Properly! and clear command line using kitchen (Options in line: 0, 12, p, press enter, press enter) if still bootloop is being faced try a different recovery!

5. Are you sure this will work? It's Not working for Me!.
A. Yes it will I am making UNOFFICIAL TWRP 3.x for my Sprout Devices: http://forum.xda-developers.com/cro.../unofffical-twrp-3-0-2-0-android-one-t3358636
 
Last edited:

MSF Jarvis

XDA Feed Mod/RC
Mar 31, 2015
3,820
7,470
113
Ghaziabad
msfjarvis.dev
@HostZero
Err, only the sprout devices have official cyanogenmod support. You should probably change the first step to "extract the stock recovery from your device" but great work anyways! Sorry for being such a wuss over PM. My bad.

Sent from my PixelV1 using XDA Labs
 
Last edited:

HostZero

Senior Member
Jun 28, 2015
298
299
0
Last Of Us (Pittsburgh)
@HostZero
Err, only the sprout devices have official cyanogenmod support. You should probably change the first step to "extract the stock recovery from your device" but great work anyways! Sorry for being such a wuss over PM. My bad.

Sent from my PixelV1 using XDA Labs
No issue, I am found a new and easy way, you don't even need recovery, you can use boot.img too.. i will update Post soon.
 

MSF Jarvis

XDA Feed Mod/RC
Mar 31, 2015
3,820
7,470
113
Ghaziabad
msfjarvis.dev
No issue, I am found a new and easy way, you don't even need recovery, you can use boot.img too.. i will update Post soon.
Yeah, if I remember correctly that's how stock ROMs replace the custom recoveries on first boot, by taking the boot.img, applying the recovery-from-boot.p patch on it and then flashing it as recovery.

Sent from my PixelV1 using XDA Labs
 

nezlek

Senior Member
Jun 13, 2016
226
88
0
Warsaw, PL
you might want to ...

If the device you are porting FROM has the same chipset and general parameters (e.g. RAM) as the device you are porting TO, try not moving ANYTHING from the ramdisk folder or sub folders. Just replace all the other stuff from the top level folder with what is in your stock recovery. You will probably need to tweak the recovery.fstab file in 'ramdisk\etc' when you are done but that seems to be a workable approach. At least it worked for me. I just removed a half-dozen or so references to things that don't exist on my unmodified device, TWRP stopped having a canary about them not being there, and I was good to go. And YES, I DID confirm that a backup and restore brought back everything I thought it should. ;)

NOW, if we could just get all these Chinese phone makers to more or less agree on mount points and partition naming - yeah, right. :p Who am I kidding ?? :cool:
 
Last edited:

Ngadhnjim

Senior Member
Sep 26, 2015
1,001
171
0
Prishtina
hi @HostZero

Need solution ,i port 3.1.0-1 from samsung galaxy s8 on cubot dinosaur mt6735 and booted all ok ,backup worked and all worked fine but restore no ,can you tell me what is problem
error mesages is
e:Unable to find file system first (first period)
e:Unable to find file system first (first period)
e:unknown restore method for ''/system''
e:adb restore failed

thenks again
 
Last edited:

Sharashchandra

Senior Member
Mar 8, 2016
109
15
0
Hi,
I ported twrp to my device ,I used MTK THAI developer tool to port
I used twrp of intex aqua star power
To intex aqua speed HD
everything working fine but
Its not Detecting internal storage
It gives E:unable to mount internal storage,invalid argument
And in file manager option when I enable the mtp ,pc detecting as intex aqua star power .
When I backup boot it backup whole OS , not only boot.
Please help me ,where its gone wrong
Thank you
 

BobbyDev

Member
Jul 19, 2016
5
0
0
Does Device Need CM13 Support?

Thank you for this great post.

You wrote that you can use any recovery image that has the same resolution as your device, but then later wrote that you need to use the CM13 recovery image specific to your device. Do I need both?

I want to root a Digiland DL8006 (MTK8127, 1280x800, Android 7.0), but CM13 does not support it. I’m really hoping I don’t need the CM13 recovery file to do this.
 
Last edited:

chankruze

Senior Member
Jun 30, 2017
224
246
0
Balasore
geekofia.in
Just a query !

JUST A QUERY :
Which image did you use from stock firmware ? (recovery.img or boot.img)
curious because i saw /boot.img-ramdisk/xxxxxxx in OP.
As far i know both recovery & boot image contains ramdisk,so i was :confused:

Again recovery.img or boot.img which one should i use from stock rom ?
 

ranchu-panchu

Senior Member
Nov 16, 2016
144
4
0
Thank you very much for this tutorial !

I would like to ask please:
Usually I find in most "rooting tutorial" that 1st stage is unlocking bootloader.
Isn't that required here ?

Thanks,
ranran
 

Augustoandro

Senior Member
Jun 20, 2017
551
224
53
Pune
Android Image Kitchen works better than Android Kitchen. Just ported a TWRP, so I am saying this on experience. A few extra steps like editing recovery.fstab and twrp.fstab are required.
 

traceback2019

New member
May 19, 2019
1
0
0
Xiaomi Mi Play - Nickname = Lotus twrp

Hi! I have been struggling with getting twrp recovery for Xiaomi Mi Play - Nickname = Lotus but still could not find anywhere. Can I build my own twrp with this guide? and Some links are dead. Please help if you want to!