Unofficial TWRP Mako 3.0.2.0 EXT4/F2FS/NTFS

vocoderism

Senior Member
Sep 5, 2012
1,581
3,075
0
45
Milan
Unofficial TWRP Touch Recovery for Google Nexus 4 codename MAKO with ext4 f2fs and NTFS support





TWRP is an open source, community project. TWRP development is done by roughly 4 people at this point. We also have a large support community with many people who are willing to answer questions and help people with their devices either through our IRC channel or on forums like xda-developers.

Team Win was originally formed to work on porting WiMAX to CM7 for the HTC EVO 4G. After our work on the EVO 4G we wanted to work on a project that would work on more devices than just the EVO 4G and we settled on working on a recovery. Today TWRP is the leading custom recovery for Android phones.

A custom recovery is used for installing custom software on your device. This custom software can include smaller modifications like rooting your device or even replacing the firmware of the device with a completely custom “ROM” like OmniROM

You can find the source code for TWRP at github.com/omnirom/android_bootable_recovery/

Screenshots:




Flashing Instructions:
To install recovery images use Flashify / Rashr from Play Store or flash in your current recovery. Otherwise do the following:
1. Go in fastboot mode (hold down Power + Vol down for a ew seconds.
2. Open terminal window/command prompt to execute following commands
Code:
fastboot flash recovery TWRP_Mako-3.0.0-ext4-f2fs.img
3. With volume up and down select recovery mode e click power
4. Enjoy you reboot in TWRP 3.0.0

Download Links:
TWRP-3.0.2.0

XDA:DevDB Information
Unofficial TWRP Mako 3.0.2.0 EXT4/F2FS/NTFS, Tool/Utility for the Google Nexus 4

Contributors
vocoderism, Dees_Troy
Source Code: https://github.com/TeamWin


Version Information
Status: Stable
Current Stable Version: 2.2
Stable Release Date: 2016-04-08

Created 2016-02-06
Last Updated 2016-04-08
 

bfoos

Senior Member
Sep 15, 2015
216
117
63
Oneonta, NY
It'd be nice to have native USB-OTG support without replacing the kernel. While mounting, backup to, restore from and install from all work as expected, I'm unsure of how installing ROM's (LP and MM ROM's specifically) using this method might be affected.
 

dimaka1256

Senior Member
Dec 31, 2011
260
117
0
Sevastopol
I'm assuming he's referring to the zip file contained in the following thread...
http://forum.xda-developers.com/nexus-4/development/recovery-mod-twrp-2-6-3-0-externally-t2412689

And yes, it needs to be a powered OTG cable, either a premade y-cable or as I did, bought a cheap normal OTG cable and splice an old 5v charger into it.
yes, you're right in both cases
backupping and restoring to usb work ok, both with twrp2831 and this one and kernel replacing
installing 5.1.1 rom works ok with 2831 and kernel replacing
seems like M should also have no problems
external power will be needed until some crazy man dismantles the board and solders 5v bus power:D
ps congrats on becoming senior!
 
  • Like
Reactions: vocoderism

dimaka1256

Senior Member
Dec 31, 2011
260
117
0
Sevastopol
well, i've got a first problem
"magic" zip contains franco's 191 kernel which doesn't support f2fs so f2fs partitions are unaccessible by a recovery modded this way
i've tried to find the solution by exxtracting boot.img from quanta kernel but (my bad) i don't remember how to compile boot.img from zImage or extract it froom working device
upd: will try flashify or some other app to backup a boot.img from working device
 

dimaka1256

Senior Member
Dec 31, 2011
260
117
0
Sevastopol
i've done it!
concluding previous post
I tried to convert my /data and /cache to f2fs and keep usb-otg functionality in recovery
i applied the zip from here http://forum.xda-developers.com/nexus-4/development/recovery-mod-twrp-2-6-3-0-externally-t2412689 and lost my f2fs partitions (the kernel contained there is franco's r191 and doesn't support f2fs
as a daily driver for my phone i use quanta #10 kernel http://forum.xda-developers.com/nexus-4/development/kernel-sabermod-franco-kernel-r211-t2858561 that works with stickmount nicely
So my job was:
-extracting boot.img from alive system with quanta kernel (done with flashify)
-replace boot.img in "magic" zip with acquired in previous step
so i got usbotg-replace-recovery-kernel-q10.zip

additionally, quanta kernel does not allow USB OTG by default - we should enable it in companion app or by terminal command
Code:
echo "1" > /sys/module/msm_otg/parameters/otg_hack_enable
So i created another zip that does one job - makes it ;)

so, howto:
1. flash twrp recovery provided in OP post
2. flash usbotg-replace-recovery-kernel-q10.zip once
3. flash usbotg-q10_enable.zip EVERY TIME you boot the recovery to use USB OTG in it

disclaimer:
i'm not responsable for any consequences with your devices, at least I've flashed factory image for several times until i realised the problem - it helps ;)
maybe i've violated some copyrights sorry and feel free to contact me
the job done is quick and dirty - i'll be glad to see, if someone makes my ideas better
yes, and it works for me:D

Credits:
@zaclimon for creating marvellous kernel
@zman0900 for most of work on "magic" zip
@ziddey for messing with USB OTG stuff
@vocoderism for messing with this recovery

upd: installing MM omniROM 6.0.1 20160207 succeeded with all this stuff
 

Attachments

Last edited:

dahawthorne

Senior Member
Nov 15, 2014
1,919
1,765
143
Brighton
For info only.
My Nexus 4 running Chroma ROM February revision (based on 6.0.1 MMB29Q) appeared to work ok with TWRP 3.0, but refused to back up because it saw zero space available. It also didn't keep settings between boots. I restored 2.8.7.0 and this works fine - it sees over 10GB free, performs the backup, and retains settings.
Occasional random reboots make me think that perhaps I have a hardware problem, so maybe it's just my N4?
 
  • Like
Reactions: vocoderism

bfoos

Senior Member
Sep 15, 2015
216
117
63
Oneonta, NY
i've done it!
concluding previous post
I tried to convert my /data and /cache to f2fs and keep usb-otg functionality in recovery
i applied the zip from here http://forum.xda-developers.com/nexus-4/development/recovery-mod-twrp-2-6-3-0-externally-t2412689 and lost my f2fs partitions (the kernel contained there is franco's r191 and doesn't support f2fs
as a daily driver for my phone i use quanta #10 kernel http://forum.xda-developers.com/nexus-4/development/kernel-sabermod-franco-kernel-r211-t2858561 that works with stickmount nicely
So my job was:
-extracting boot.img from alive system with quanta kernel (done with flashify)
-replace boot.img in "magic" zip with acquired in previous step
so i got usbotg-replace-recovery-kernel-q10.zip

additionally, quanta kernel does not allow USB OTG by default - we should enable it in companion app or by terminal command
Code:
echo "1" > /sys/module/msm_otg/parameters/otg_hack_enable
So i created another zip that does one job - makes it ;)

so, howto:
1. flash twrp recovery provided in OP post
2. flash usbotg-replace-recovery-kernel-q10.zip once
3. flash usbotg-q10_enable.zip EVERY TIME you boot the recovery to use USB OTG in it

disclaimer:
i'm not responsable for any consequences with your devices, at least I've flashed factory image for several times until i realised the problem - it helps ;)
maybe i've violated some copyrights sorry and feel free to contact me
the job done is quick and dirty - i'll be glad to see, if someone makes my ideas better
yes, and it works for me:D

Credits:
@zaclimon for creating marvellous kernel
@zman0900 for most of work on "magic" zip
@ziddey for messing with USB OTG stuff
@vocoderism for messing with this recovery

upd: installing MM omniROM 6.0.1 20160207 succeeded with all this stuff
Awesome! I was doing this exact thing last night but had to go to bed. All I was missing was the terminal command. Here's a little tip though, use Android Image Kitchen to unpack and repack your boot.img. This will gzip the image and vastly reduce its size. And yup installing MM roms works just fine.
 
Last edited:

bfoos

Senior Member
Sep 15, 2015
216
117
63
Oneonta, NY
Since TWRP will obviously happily boot and function to varying degrees with just about any old kernel, I think this merits more testing. Since Quanta is an AnyKernel, it just modifies the RAM Disk of whatever base kernel you install it on. Perhaps there exists a full kernel that has OTG hard coded and enabled, thus negating the need for using a script to enable it every time. F2FS isn't really that important to me, but it is obviously for others. I think I'm going to play around with some LP/MM kernels and see what I can come up with. I'll happily share my findings with you fine folks.
 
  • Like
Reactions: shawnbrennan55

zaclimon

Recognized Contributor
Aug 14, 2011
4,365
7,292
0
Montréal
Since TWRP will obviously happily boot and function to varying degrees with just about any old kernel, I think this merits more testing. Since Quanta is an AnyKernel, it just modifies the RAM Disk of whatever base kernel you install it on. Perhaps there exists a full kernel that has OTG hard coded and enabled, thus negating the need for using a script to enable it every time. F2FS isn't really that important to me, but it is obviously for others. I think I'm going to play around with some LP/MM kernels and see what I can come up with. I'll happily share my findings with you fine folks.
Why don't you guys simply don't change TWRP's init script to add an entry to enable the OTG switch at boot? I'm pretty sure it can be done without any additional external script because it was self-compiled beforehand. :p
 

bfoos

Senior Member
Sep 15, 2015
216
117
63
Oneonta, NY
Yeah, I was gonna go that route, but instead I just copied the enable.sh script from @dimaka1256's zip file, dumped it in sbin and called it as a service from within init.rc. Repacked the image and flashed it... SUCCESS!!! USB-OTG enabled on boot!

***EDIT***
Here's some technical information (including the steps used to create it) about the attached zip file.

I first flashed the boot.img contained in the latest PureNexus release, then Quanta v10. Rebooted into system and used flashify to do a kernel backup. I then replaced the ziddey-boot.img image in the "magic" zip file referenced earlier in this thread, rebooted into recovery and flashed it. Rebooted recovery and flashed @dimaka1256's usbotg-q10_enable.zip and tested to see if OTG and F2FS were working... SUCCESS!!! I then rebooted back into system and used flashify to do a recovery backup. I unpacked the image with Android Image Kitchen, took the enable.sh from usbotg-q10_enable.zip and dumped it into the ramdisk's sbin directory and edited the init.rc file to call the enable script as a service. Repacked the image and flashed it, tested OTG and F2FS once more and it passed. Zipped the image as it was just over the 8MB attachment limit for .img files here. So, extract and flash away and enjoy something we should have natively... OTG!!!
 

Attachments

Last edited:

dimaka1256

Senior Member
Dec 31, 2011
260
117
0
Sevastopol
Yeah, I was gonna go that route, but instead I just copied the enable.sh script from @dimaka1256's zip file, dumped it in sbin and called it as a service from within init.rc. Repacked the image and flashed it... SUCCESS!!! USB-OTG enabled on boot!
seriously you can remove most of lines of the script that are related to checking board name (no need to it, since recovery is ok and launched) and leave just setting permissions and echo'ing the parameter

nice work!
 
  • Like
Reactions: bfoos

bfoos

Senior Member
Sep 15, 2015
216
117
63
Oneonta, NY
Yup, a little teamwork by some like-minded individuals and we now have in my opinion, the best of everything TWRP has to offer our beloved N4's. 3.0.0-0, OTG, F2FS, etc.