yashsingh1/xdaforums huggingface dataset:
[Sony Xperia M] Agu_Ra:
Does any recovery support this type of archives? BTW, I didn't here about it before. And adding it needs changes in TWRP code itself. I just make minor changes in the device tree, I am not a developer to make major changes in code.
[Sony Xperia M] Agu_Ra:
Mass storage mode

Added (TWRP Gerrit is for GitHub users only, so you can't see the changes without GH account) mass storage mode. Will be in next official build if change will be merged in time. Luckily, changing build flags was enough, there were no need to write custom init.usb.rc. Screenies! BTW, apps on SD also wait merging.

And, of course, for those who don't want to wait there is download link from GDrive.
[Sony Xperia M] Agu_Ra:
Thread update

Added F.A.Q. and edited the OP a bit.
[Sony Xperia M] Power-Inside:
I installed TWRP 2.8.7.0 on my Xperia M, but adb does not list my device no matter how much I killed it and started it. Bug?
[Sony Xperia M] Agu_Ra:
Yes, just checked, seems that it doesn't work. But when I enable MTP in Mounts menu it works. I will look to init.recovery.usb.rc later, maybe we'll need custom init.recovery.usb.rc. But maybe it can be fixed in TWRP source. I will look for this.
[Sony Xperia M] Power-Inside:
Unfortunately it doesn't work for me when I enable MTP either! Is there any last known working version that I could use for the moment?
[Sony Xperia M] Agu_Ra:
Seems that it is driver issue. I changed the driver of unknown device to Android Composite ADB Interface and it started working even without MTP or UMS mode. But after some time my device went insane: "Safely remove hardware" icon start to appear and disappear very fast. Don't know what's wrong.
[Sony Xperia M] Power-Inside:
Indeed.. it seems to be some driver issue. I switched to linux and didn't have any problems. #tohellwithwindows :)
[Sony Xperia M] Agu_Ra:
Yeeeees! Android device drivers for Windows is a big pain in the ass sometimes. I remember what illogical things I had to do to make UMS mode working on Windows. But the most painfully was installing fastboot drivers on Windows 8.1, and I didn't have any Linux distro installed (there was Debian installed, but it was unaccessible, 'cause Grub was erased by crappy Windows installer).
[Sony Xperia M] Agu_Ra:
Xperia M in TWRP Manager

Yes! Finally nicki is here. App install now should work. So now we have complete official support!
[Sony Xperia M] SK:):
Can't able to flash zip via TWRP. SD card is not not mounted in recovery and asking me to partition my SD card.
[Sony Xperia M] Agu_Ra:
Does your SD work properly? Send me your recovery log (/cache/recovery/last_log).
[Sony Xperia M] Slasher_44:
Create NANDROID Backup of Stock 4.3 in Xperia M

Hi ,

I wanted to update my Xperia to 4.4 (CM11 the latest stable release available :( ) . So was trying to create a NANDROID backup before doing it . I already rooted it (towelroot) and unlocked boot-loader . Then I came to know that TWRP and CMW cannot be directly used with the custom rom . Can some one tell me how to create a nandroid backup of the device (stock 4.3) so that I can recover even if I screw up doing the 4.4 Upgrade ?

Also with some option in this is it possible to restore only user and app data after I update to 4.4 ?

I explored some options like Online Nandroid Backup ; but wanted to check with people who have done it if that is the best way or some other alternative is there .
[Sony Xperia M] Agu_Ra:
There are stock kernels with CWM or PhilZ, search the Xperia M forums and you will find, they can be used for Nandroid. Their backups are incompatible with TWRP (but you always can install CWM back, or not to install TWRP at all). BTW, you can simply flash KitKat kernel (boot.img file from zip) with Flashtool or fastboot:

fastboot flash boot boot.img

It already includes CWM recovery (you will be able to boot only into recovery before flashing, don't try booting into system).

And restoring user and app data can be done after flashing custom ROM. You can use Titanium backup for your user apps and data.
[Sony Xperia M] Devtaji:
Just to get this straight, this won't replace the Kernel I'm using right now?
[Sony Xperia M] Agu_Ra:
No. BTW, I wrote about it in F.A.Q., it is in the second post in the thread and nessessary to read.
[Sony Xperia M] kjinx01:
great work...
[Sony Xperia M] ndrancs:
Any update for official release with your latest commits?
[Sony Xperia M] Agu_Ra:
No, the latest version is still *.7.0. BTW, I have the build with these commits somewhere.
[Sony Xperia M] rexdrive:
Will fota get removed when I flash stock rom using flashtool?
[Sony Xperia M] DibyenduMaji:
yup, it will be removed, if you don't exclude "FOTA" from "Exclude" list on flashtool...
[Sony Xperia M] rexdrive:
Thank you so much for the information. :)
[Sony Xperia M] Devtaji:
I formatted /system, /data and /cache to f2fs in the latest available twrp.

But twrp says it cant mount any of them.

CM12.1 supports f2fs because it detected the f2fs filesystem but cannot install because twrp cannot mount the filesystem. Even after rebooting recovery. It shows filesystem as f2fs but cannot mount it.

Is there a solution for this or twrp for M does not support f2fs?
[Sony Xperia M] SdtBarbarossa:
To mount F2FS partitions the kernel must support it!

FOTA-Recoverys are different from others in one point... They dont use its own kernel!

Exactly its Like this: The kernel from boot partition will be loaded and if you go to recovery the ramdisk of boot will be replaced with the ramdisk of FOTAKernel partition!

So that mean if your boot partition (your main kernel) dont support F2FS it will not be able to mount it!

Do that:

Extract the boot.img from the rom you want to flash (the one with f2fs support)

Then flash the boot.img with flashtool

Then boot to recovery and it should work
[Sony Xperia M] Agu_Ra:
Try with NUI Kernel, someone there said that he succeed formatting to f2fs.
[Sony Xperia M] Devtaji:
The problem is, the rom I want to flash, cm12.1 detects the parrition while installing, and if there is f2fs, it patches kernel so that there is f2fs support.

But that stops because it is not mounted.

Is there any cm12.1 kernel that supports f2fs?
[Sony Xperia M] Agu_Ra:
I wrote you above. NUI Kernel supports f2fs.
[Sony Xperia M] ndrancs:
Try nui kernel, I wrote in nui kernel thread, only /data have good reason to formatted as f2fs, but it's use more space than ext4, ie: 400 MB data take more space than in ext4. So I switch back to ext4.
[Sony Xperia M] vrindavan_b:
[MENTION=5608002]Nicklas Van Dam[/MENTION]

Will it work on xperia m dual sim(C2004) too
[Sony Xperia M] Agu_Ra:
Of course.
[Sony Xperia M] Nicklas Van Dam:
Yes, it will worked like what OP answer :D
[Sony Xperia M] vrindavan_b:
And fota twrp?
[Sony Xperia M] Nicklas Van Dam:
Yes, Twrp and cwm is worked correctly for dual and single sim users
[Sony Xperia M] Nicklas Van Dam:
TWRP Stuck on splash logo with android 6.0 AOSP? how long i must wait or i must revert to stock recovery? :confused:
[Sony Xperia M] Agu_Ra:
Ahmm... Try this build. BTW, for me everything works, but I am using more fresh build than posted here, but still older one than this. Also TWRP can lag after boot (this issue appears on more fresh builds than posted here, but the bug is not present when using NUI Kernel, but NUI doesn't support M for now, system just doesn't boot).
[Sony Xperia M] Nicklas Van Dam:
problem still exist too? but i can enter twrp when i'm remove extsdcard from my phone, after that i can use TWRP properly. only way to install zip only on internal storage . and when i insert extsdcard TWRP directly to freeze again.

i think problem come from when twrp try to mount extsdcard , cause extsdcard is move from default twrp directory /mnt/ext_sdcard i think and that encrypted from marshmallow adoption as internal storage.

may be if you can fix read partition for extsdcard this problem can be solved :confused:

only my suggestion
[Sony Xperia M] Agu_Ra:
I think so too. So I'll repack it with changed fstab tomorrow.
[Sony Xperia M] Nicklas Van Dam:
okay, thanks for your confirmation sir :)
[Sony Xperia M] Agu_Ra:
Try this image. It has all latest commits in the tree.

UPD: new build with NTFS support. Please, test someone.
[Sony Xperia M] AlexiusItaly:
I'm on CM12.1, this is the last TWRP build for our xperia M so i can install it or i can install it only for flash cm13? :what:
[Sony Xperia M] Agu_Ra:
It's for any custom ROM. So you can install it on any CM version, and on any Kitkat, LP or M. Also I re-uploaded build, now it is with NTFS support. BTW, there is touchscreen freeze bug (but it is not present on NUI), just wait a bit and it will work.
[Sony Xperia M] Agu_Ra:
My OTG connector resurrected from the dead, so I tested NTFS-3g and it works. Even these screenshots were stored to my USB drive.
[Sony Xperia M] Nicklas Van Dam:
Okay, thanks for your support sir :). I will test it
[Sony Xperia M] Nicklas Van Dam:
sir [MENTION=5917809]cucumber09[/MENTION] , i've been installed and test it. . it's same like before result, still stuck on TWRP logo when extsdcard is plug in on phone. but work when extsdcard isn't insert on phone. and when i try to to enter TWRP without extsdcard insert and until TWRP go into first menu. i'm test to insert my extsdcard to my phone and i try to mount it. It seems TWRP can mount my extsdcard and when i go to menu install and go to my extsdcard directory TWRP freeze again and only show folder TWRP on my extsdcard with free size 14GB. although my extsdcard have free space only 3GB? i think TWRP still can't read extsdcard that encrypted by marshmallow adopt. or that happen from our AOSP that still unstable with that feature?:confused:

And i found double data partition when i'm on advanced format menu.
[Sony Xperia M] Agu_Ra:
Seems that SD encryption is not supported. I don't know for sure how does it work, also I'm now on CM. We need to wait for fixes in 6.0 TWRP tree. I now build from 5.1, as when building from 6.0 tree, it can't boot. BTW, I can try building from 6.0 TWRP source after my last commits. But I doubt it'll work now. As I noticed, when recovery ramdisk is too big, TWRP can't boot (that's why I needed to disable /data encryption to make ntfs working).
[Sony Xperia M] Nicklas Van Dam:
it's okay, thanks for your answer :). i will waiting for next build
[Sony Xperia M] Agu_Ra:
New build

TeamWin fixed issues in 6.0 branch. It was just SELinux problem. So I built TWRP (it is still 2.8.7.0) with the latest changes and it finally works. I even didn't have to cut down the functionality. I doubt, it will fix reading from external SD, but you can try at least. Touchscreen issue is very likely not fixed too and I have no time to work on it now, wait a bit after entering recovery and pressing any key on display or use NUI Kernel, it doesn't have this bug. Flash it using dd or TWRP method.

Download link>>>
[Sony Xperia M] Nicklas Van Dam:
Thanks [MENTION=5917809]cucumber09[/MENTION] for new TWRP, I will test it and give a result :)
[Sony Xperia M] Agu_Ra:
BTW, I tested the latest build with kernel from AOSP 6.0 (3.4.0-CM+) and touchscreen issue is still here. Just read kmsg, but could not find out where is a problem. But I'm sure it can be solved on kernel level as on NUI everything's fine. I hope, @PecanCM or @thichthat can help.
[Sony Xperia M] Antrikos48:
You know you could compare kmsg from AOSP and NUI and look at the differences
[Sony Xperia M] Agu_Ra:
Yes, I thought about this, but my USB is not near (I borrowed it to my goddamn neighbor) and I can't send NUI kmsg to my PC now, I'll do it later. But I already noticed that in NUI there is nothing about rmi4.img and in CM+ kmsg there is a line:
[Sony Xperia M] Antrikos48:
Lol. That would be the Synaptics touch driver. [MENTION=4929675]thichthat[/MENTION] messed a lot with it though, so he probably fixed it unintentionally or something.
[Sony Xperia M] Agu_Ra:
Yeah, I know that it is about synaptics. But I don't know what has broken it. It worked nice on older builds of TWRP 2.8.7.0 on any kernel, but on the later ones it started to freeze for about 1 minute on stock CM kernel. I noticed it after [MENTION=5161352]JustArchi[/MENTION]'s ArchiDroid installation but don't remember if this bug was present only on stock CM kernel or on ArchiKernel too (it would be nice if someone will test). I read recent TWRP commits but could not find anything related to touchscreen. In NUI Kernel there are a lot of optimizations for Synaptics, so that's probably why it works nice. We can ask Ron or thichthat to merge NUI's touchscreen driver to CM+ kernel.
[Sony Xperia M] Agu_Ra:
And I don't know why, but CM+ kernel initially loads Cypress touchscreen driver and then Synaptics.

And NUI Kernel doesn't.
[Sony Xperia M] Antrikos48:
Well, this is a bloody nightmare then.

Btw there is also this commit which looks semi-relevant
[Sony Xperia M] Agu_Ra:
Let me say I love you, man. I will build stock CM kernel with this to test if it fixes the problem.

UPD: But in comments it is said it doesn't fix the issue :(
[Sony Xperia M] Antrikos48:
I know, but atleast we found the function that causes the issue (it is the one that prints Firmware image not available) and considering that Nui kernel does work fine, I would suggest that you build it and test it anyway.
[Sony Xperia M] Agu_Ra:
Yes, I'll build it on my free time anyway.
[Sony Xperia M] Agu_Ra:
Yes, I fixed it! No! We fixed it! I'll push the commit to CM Gerrit and will upload flashable anykernel zip for LP ROMs (need to build for M too). It gave me error first time, but then I just disabled it in defconfig.
[Sony Xperia M] Agu_Ra:
Touchscreen fix for Lollipop

Ok, here is a fixed kernel for any LP ROM (on KitKat should work too, but I'm not sure). I already pushed the change to CM Gerrit, it is already included in nightlies from 4 Nov.
[Sony Xperia M] Nicklas Van Dam:
so this can try to our AOSP 6.0 ? :D
[Sony Xperia M] Agu_Ra:
No, it is for LP only (may work on KitKat). I'm almost sure it won't work on M, but you can try.
[Sony Xperia M] babyyeobo14:
im sorry but what is LP? sorry noob here
[Sony Xperia M] Antrikos48:
Lollipop
[Sony Xperia M] Agu_Ra:
Just tried building kernel for AOSP 6.0, but I've got the same error (I hope it's due to CM-12.1 build environment). I sent the pull request to Ron. Maybe he'll try to build it in AOSP-M tree.

UPD: Yes, fortunately, build fails even without this commit, so the problem is in my environment. I hope, [MENTION=4343949]PecanCM[/MENTION] will build the fixed kernel.
[Sony Xperia M] Antrikos48:
Can you post the error/log?
[Sony Xperia M] Agu_Ra:
Yes, of course. I just didn't do this, 'cause my system language is Russian, lol. But here it is (I tried to translate it to English):
[Sony Xperia M] Agu_Ra:
Touchscreen fix for Marshmallow!

Finally I compiled M kernel, the problem was in some files in kernel source folder ('make mrproper' solved the issue).

Download and flash as regular zip.

And, not to abuse GPL, here are sources.

Thanks to @Antrikos48 for some help and @thichthat for info about the reason of lag. They deserve at least cookies for it.
[Sony Xperia M] kh34d:
So it's for M only?
[Sony Xperia M] Mysteryagr:
I don't know how this is happening, but using twrp for M and I lock the screen and keep it locked until it turn off.. start it again, and touch is working.

didn't flash the kernel yet
[Sony Xperia M] Agu_Ra:
This kernel - yes (BTW, it doesn't contain the recovery itself, it is just kernel with touchscreen drivers fixed for TWRP), but I uploaded fixed Lollipop kernel yesterday.

I already noted that touch works after some time (according to kmsg log and documentation, the delay is 1 minute).
[Sony Xperia M] Agu_Ra:
Hey, the touchscreen fix in kernel is merged, it is already included in cm-12.1-20151104-NIGHTLY-nicki. KitKat users can flash fixed Lollipop kernel I posted earlier. And M users should flash fixed M kernel or wait for the next Marshmallow build from Ron. BTW, did anyone test if integrated SD can be read in the latest build?
[Sony Xperia M] Nicklas Van Dam:
Sir which version of twrp did you upload it? 2.8.0.0 ? For M version cause I've got error on FOTA Recovery and I revert it back to stock FOTA using flashtool.
[Sony Xperia M] Agu_Ra:
The latest recovery build is in this post. In post quoted by you there's only kernel (zImage, it is kernel itself, not the whole boot image, it doesn't contain ramdisk, so there can't be recovery).

BTW, what error have you got?
[Sony Xperia M] Nicklas Van Dam:
i don't know too, but i'm used twrpv3.1.1.0.img that you tell it for new FOTA Recovery :). and i flash it using dd if command but i'm not rename it to FOTAKernel.img , i directly to write twrpv3.1.1.0.img and flash it. after that i can't use any fotarecovery with any version. so i revert to fotakernel.sin and flash this kernel. so that's why i ask version from this recovery :).

but it's possible if i'm wrong with name file can be make problem like that? :confused:
[Sony Xperia M] babyyeobo14:
it think theres no problem with the name..
[Sony Xperia M] Agu_Ra:
Filename doesn't matter. Try installing official build from TWRP Manager and then flash the latest version using TWRP ("TWRP install method" in nicki official TWRP page).
[Sony Xperia M] Nicklas Van Dam:
okay it's great and that's make me better :laugh:

i'm installing twrp that you give it to me using dd if method. but it seems still stuck on TWRP splash logo and can't enter to TWRP menu :confused:? i think that from my extsdcard is inserted. and when i removed it, i can enter to TWRP menu with 2.8.7.0 version. and my extsdcard still can't read it with this twrp

View attachment 3534027

so i think move zip file to internal storage using twrp mtp mode is only way for installation zip now :D

Thanks for your hard work [MENTION=5917809]cucumber09[/MENTION]

will report again if i found any bugs
[Sony Xperia M] Agu_Ra:
Thank you for your reports. BTW, there is also adb sideload flashing zips method.
[Sony Xperia M] Nicklas Van Dam:
adb sideload? sounds interesting :D, can you tell me how sir? :confused:
[Sony Xperia M] Agu_Ra:
Go to Advanced > Sideload, connect the phone via USB, on PC:

adb sideload filename.zip
#replace "filename" with the name of needed zip
[Sony Xperia M] Nicklas Van Dam:
Interesting, but in where we must place zip file for adb sideload function? Our extsdcard can't be read in TWRP? In internal storage or maybe can be place it on PC?
[Sony Xperia M] Antrikos48:
On your computer. It is then transferred on demand to the phone.
[Sony Xperia M] Nicklas Van Dam:
Thanks for your information :) , I will try it :D

Confirmed working :D thanks all :D
[Sony Xperia M] Agu_Ra:
If someone wants to use TWRP with material design, multilanguage support and some other features, here are @StdBarbarossa's builds. The features are NOT third-party, they are taken from official TWRP Gerrit (excluding some modifications for full multilanguage as it is not finished in TWRP repo and experimental lockscreen) as open changes and will be merged in feature.

BTW, I've made for myself not so long ago a build with material theme (I'm too lazy to upload it) and it looks very nice and fresh.
[Sony Xperia M] coolboyforeva:
any update , when are we getting TWRP for cm13?
[Sony Xperia M] AlexiusItaly:
There is a way to flash it with TWRP?
[Sony Xperia M] Nicklas Van Dam:
[MENTION=5917809]cucumber09[/MENTION] sir , is new build can read our sdcard that encrypted from Marshmallow adopted function?
[Sony Xperia M] SdtBarbarossa:
until now...no... I talked to Dees_Troy last night and he said he dont own a device that runs MM and have a sdcard slot (lol)

the qustion is... where do you get the encryptionfooter from?
[Sony Xperia M] Nicklas Van Dam:
What you mean about encryption footer? Now I'm on marshmallow ROM.
[Sony Xperia M] SdtBarbarossa:
ah nothing .... sorry that wasnt really a question ^^
[Sony Xperia M] Nicklas Van Dam:
It's okay :D . I will wait for next update
[Sony Xperia M] Agu_Ra:
TWRP is for any custom ROM, so you can freely use it with CM13.

As is said above, the only problem is non-ability to use adopted SD card until someone implements it in TWRP code. As soon as it will be implemented, I'll provide build supporting it, so, [MENTION=5608002]Nicklas Van Dam[/MENTION], there's no real need to ask about it without visiting Omni Gerrit.
[Sony Xperia M] Nicklas Van Dam:
Ups sorry for that question sir [MENTION=5917809]cucumber09[/MENTION], I won't ask any further question about that again until you provide new build. -_- sorry about that
[Sony Xperia M] FakrudeenAhamed:
Link broken

Hey , this link is not working. I already flashed this version but if u update the link it will be helpful for new people. :)

Thanks for your work :good:
[Sony Xperia M] Agu_Ra:
There is a huge mess with builds on my PC and SD. So, here is the one I use. It is built with new and unmerged for now theme with material design. BTW, no adopted storage support for now.

And also I don't have now fully working compile environment, as I've switched to ArchLinux and haven't solved the compilation problems I've faced.
[Sony Xperia M] abhatia1435:
Could you please post some screenshots of the material recovery? (In case you don't know, press vol.down+power to take screenshot in recovery) :)
[Sony Xperia M] kh34d:
Did you mean this?

Can you make ZIP file for it? plz
[Sony Xperia M] Agu_Ra:
BTW, site works again. And thanks to [MENTION=5804988]FindYanot[/MENTION] for it.
[Sony Xperia M] Agu_Ra:
I mean this.

Why do you need zip? Can't you flash it via TWRP method from the instruction on the official device page?
[Sony Xperia M] kh34d:
I mean [URL https://drive.google.com/file/d/0B7UDzUZQdwovb0ZYTjk3ekZVbEU/view]here[/URL]

it's IMG file not ZIP file!!
[Sony Xperia M] Agu_Ra:
I mean, read the OP, man. There is a link to official instructions. *.img files are flashable via TWRP since 2.8.4.0.

The first thing everyone should do on forum when having questions is reading OP and F.A.Q. I don't like writing about things already written, and I doubt anyone likes.
[Sony Xperia M] SdtBarbarossa:
cucumber have you already heard about twrp trouble with cm13 and adoptable storage? for that we need to know where to find encryption footer of userdata ... do you know where it is placed? in /sys ?
[Sony Xperia M] Agu_Ra:
Heard since 1st Marshmallow alpha build. And I have no idea where the footer is located. BTW, userdata encryption was reported not to work on nicki custom ROMs, so I removed crypto support from device tree not to bloat the ramdisk. But I think, the adopted storage uses different mechanism. Otherwise, it would be easier to hack and already done by TeamWin, I think.

And one more thing to mention, I'm not on Marshmallow build now. So can't test anything related to adopted storage.
[Sony Xperia M] kh34d:
OK, sorry for misunderstanding
[Sony Xperia M] SdtBarbarossa:
twrp team hasnt worked on it yet (dees said he waits for android 6 to get more stable... also he has no android 6 device with sdcard yet )

but as far as i can sqy from other devices it seems like it uses same encryption footer like userdata partition
[Sony Xperia M] n00BXperia:
any way to get latest cwm on fota ??
[Sony Xperia M] Bonoboo:
Not last, but CWM: download
[Sony Xperia M] Agu_Ra:
If so, we'll need the build with this commit reverted (it would be better to be done manually as there are some commit dependencies). Also it may be necessary to set negative length of needed partition in fstab, like it was done for /data earlier. If recovery won't boot because of too big ramdisk, we'll likely need to revert NTFS-3g commit to fit the limitations (but I hope it would be needless with new theme). And I have no time now for fixing my build environment (I switched to non-deb Linux distro and now my builds fail for some reason which I haven't figured out) and building with this changes. If you'll find how to fix the adopted storage support, I'll merge it to the tree. I personally have no idea about how does the encryption in Android work, I am noob in it.
[Sony Xperia M] SdtBarbarossa:
1. the new theme saves a LOT of space (see my homebuilds)

2. dees found out how to decrypt adoptable storage... i will have a talk to him soon ^^