yashsingh1/xdaforums huggingface dataset:
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] celoxocis:
Did you actually read what I said above?

The vendor source kernel is NOT complete.

You will NOT have a successful build.

You need an kernel source cleanup!

You can Kang alberto's Moto Z Play device tree but you can't copy it 1:1.

You will have to apply all devices related changes.

Especially since Moto Z Play is an ARM (32bit) (device and kernel).

And the P2 is an arm64 (device and kernel)!
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] wzedlare:
I understood you, I will try it if you give the defconfig :)

If you dont trust me, just look at the first device tree;

https://github.com/Wzedlare/android_device_lenovo_kuntao
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] celoxocis:
It got nothing to do with trust.

I'm just not home yet to be able to share the defconfig.

Some corrections/suggestions.

It should be android_device_lenovo_kuntao_row

Only kuntao would indicate support for both the P2A42 and P2c72. And I don't think you want that as the P2c72 is an CDMA device.

I'm 100% sure that modem specific vendor blobs will not work with the P2c72 device.

Also the fstab is wrong. You can extract the correct fstab from stock images in post#3 it is in boot.img.

Also don't use CM13 as a base as CM is dead!

And especially CM13 will not receive any love!

Stick with Alberto's LinageOS CM14.1 branch as a Kang base! Branches are still named the old way.

It is here: https://github.com/Alberto97/android_device_motorola_addison
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] wzedlare:
Yes you are right about kingdom_row, I will fix that.

About cm13, I dont want to try nougat until I create

a bugless tree for marshmallow.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] ilmervanhattem:
Good job and thank you

Good job and thank you guys. I have to wait for ten more days until I can unlock the bootloader... ****ed up my device already though, by data migration. Go for LineageOS! If you want any idea's I'll be glad to 'help'.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] celoxocis:
****ed up? Go and read post#3.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] celoxocis:
Official TWRP is in the work. Should be up any day now.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] wimmetje:
:good: Thank you for all the work!!

I receive my P2 tonight so i will be active on the upcoming forums.

Regards Wim
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] noone1982:
great! can't wait to have the unlocked bootloader... do you think that there will be any chance to have the systemless su in the future? or we probably will stick to the system mode? (it's fine for me, just a curiosity)
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] wzedlare:
Thank you so much for TWRP, still waiting for the defconfig, I guess you forgot it :)
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] celoxocis:
Yes I forgot was busy building LineageOS for my other device I maintain. (Oppo R7Sf).
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] celoxocis:
There probably will. But I'm to busy to keep debugging the problem. It might even just work if encryption is disabled. See post#3.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] celoxocis:
to anyone interested here is the reason why read/write of SuperSu fails when trying to install SuperSu in systemless mode.

https://xdaforums.com/showpost.php?p=70492947&postcount=8793

So my guess was right. It is because /data is formatted as f2fs and the kernel is missing

+	.read	= new_sync_read,
+	.write	= new_sync_write,

i can fix it for the TWRP kernel. No problem.

BUT

once booted into the system. The kernel is a different one (from stock ROM).

I doubt Lenovo will fix that issue ever!

So if you want systemless SuperSu and be able to receive OTA's.

A: You will have to convert /data to ext4 to make it work.

B: Wait for a custom kernel for the Lenovo P2. Which works with the stock ROM.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] wimmetje:
Nice find, this explains a lot.

If I switch to custom Roms (In the near future) I don't care about OTA from Lenovo anymore.

So not a big deal for me.

How far away is the official TWRP release?

Regards wjm
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] medwatt:
Thanks for the update.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] celoxocis:
if you have an p2a42 the official one is fool proof.

most reported issues are from users trying to run this twrp which was specifically build for the p2a42 on a p2c72.

and for unknown reason that has been a hit and miss.

I can't tell because I don't have a p2c72.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] phaleg:
Was it any better before you started modding it?

it is considered a good device for its price...
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] potatoman4321:
If it's all ****, start developing yourself then.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] senseijtitus:
Every developer was a noob at first. It just takes a little urge to learn and some free time to start. I have the first one. But don't have the second. That is the problem I am facing. If you have both, I m sure you can also become a dev.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] pluscsc:
Guys, I am seeing the comments here, and today, do you recommend unlocking the bootload and installing TWRP in p2c72 turned into p2a42?

Or rather wait?
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Rushi_Kohok:
How to unlock bootloader without wait of 14 days
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Aegir81:
That's not possible.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] noone1982:
if i flash twrp and the fastboot boot twrp.img i am in twrp... but at next reboot holding vol down and power there is again the stock recovery
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] pippideniro:
In my case, i have to rename the download recovery file to twrp and follow command on OP to get the recovery install on my P2:silly:
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Aegir81:
I have a similar problem, I just keep the buttons pressed and after a while it boots in TWRP.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] noone1982:
ok... i wil try it... another thing... i cannot root it... some months ago, at the beginning i did manage to root my device... recently i restored from stock rom (started from 62 and updated to 244) after this... if i try to flash the root zip as suggest in the second post i get black screen and blue led (ps. yes i have a p2a42 i suppose... it's 4gb ram and 32gb storage)
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Mathurin239:
Hello I have a P2 p2c72 with rom p2a42 bought at gearbest.

I just want to root it to use titanium backup (root access), should I use twrp recovery or can I stay with the original recovery and flash magisk after unlock bootloader ?

I don't want custom rom.

Thank you.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] lp2yisdfu:
If you are using LineageOS, maybe try to root using LineageSuperSU.zip, it is available through the LineageOS website. That worked for me to get root, the other way of rooting gave me a soft brick the same as you.

---------- Post added at 02:28 PM ---------- Previous post was at 02:28 PM ----------

Use TWRP and take a full backup, or don't mess with your phone!
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] medwatt:
You can find all this info in a thread I made in the guides sub.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Mathurin239:
Thanks, i think it this:

https://xdaforums.com/lenovo-p2/how-to/lenovo-p2-owners-click-t3668029

I read it but it say

"Recoveries

TWRP 3.1.1-1 (latest custom recovery)

Stock Recovery for Android 6

Stock Recovery for Android 7

If you're going to be installing custom ROMs, it is better to replace the stock recovery with TWRP

So that why my question, don't want custom rom. :)

But if it better than stock recovery i'll do it.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Ramesh788:
Must reply

I've flashed newest version of twrp in my lenovo p2 but whenever I try to flash SuperSU zip file with twrp it doesn't appear on app drawer and root checker shows "no root access available on this device". And magisk zip also not installing by twrp plz help me
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] mojoman11:
Change data partition to ext4
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Ramesh788:
How do it do? Please tell me
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] mojoman11:
In twrp In the advanced section of the wipe section i think there s an option to change file format. Check the data check box and convert from f2fs to ext4. But be careful it will wipe ALL data so take a backup.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Ramesh788:
Thanks a lot bro, you resolved my problem. You guys are always ready to assist us.???

Hey bro, after changing data partition my phone's play store layout changed. Now play protect feature not showing and device uncertified is shown.

Is it normal?
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] mojoman11:
Yep. Its normal. There's a patch zip for it i think but it frankly doesn't matter. Happy to help XD
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Mathurin239:
Wow it's a problem for playstore and dl apps after twrp and root ??

The patch can fix it, and where can we find it ?

Sorry for question, i don't have this problem in my old root LG G3.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] mojoman11:
There's no problem with anything.. Everything works normally after rooting. What I mean to say is that there is a safety net zip to pass the safety net and get your device certified as some apps don't work otherwise. Also if you root with magisk there shouldn't be a problem as opposed to super su. So you don't really need the patch. If you still want it for whatever reason just search a bit on the forum, you'll find it.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Mathurin239:
Thank you, precisely I wanted to root with magisk that seems better from what I read on the forum.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] :
after 14 day wait i unlocked by p2 bootloader & flagged twrp.

i want to know is it necessary to switch data part. to ext4 for rooting with phhs su file? what if i wanna move to Magisk later or if want to unroot fully?
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Sutcliffe9:
You only need ext4 if you want to use Magisk. You can unroot ok with ext4. I would recommend rooting with Magisk.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] :
thank you bro.

this is the only device i have as a daily driver, IF i want to unroot later how would i do that? flashing stock boot & recovery on stock rom would get me unroot?
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] celoxocis:
anyone who wants to test the current alpha build for the lenovo p2a42. (untested on p2c72)

feel free to do so and report back. you can grab a copy here

this build:

- is based on the latest msm8953 android 7.1.2 kernel code.

- countless other kernel related fixes

- includes the latest f2fs build

yes f2fs loopback interface mounting support works on this build because it does NOT use lenovo's stock kernel unlike the official build.

but this means. if you use stock kernel in ROM you will not have supersu's or magisk root working on f2fs. because the stock kernel is missing "loopback interface mounting support" on its f2fs.

so if you want root and keep f2fs you will need a kernel that has the required patch. NOT STOCK KERNEL!

why is this an alpha build?

- because it includes patches which haven't even been merged by the TWRP team yet.

- this TWRP will be used for the Official LOS Lenovo P2 release. once i becomes Official.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Mathurin239:
Twrp recovery installed and root with magisk, it's ok for me, thanks to all of members help me and for guides.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Mazip007:
:cool:
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] pluscsc:
There is a possibility of leaving a version for p2c72. I'm afraid to do on my p2c72 with this twrp.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] gaetanolip:
Me too

Inviato dal mio Lenovo P2a42 utilizzando Tapatalk
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Wmateria:
Shouldn't be a problem cause i have the same p2c72 model and i was conceened myself long ago when rooting. As long as you use the latest official Twrp 3.1.1-1 provided here and that you have your bootloader unlocked, and flash it properly using the fastboot flash recovery ______.img command with whatever you named the file with in front of ".img" via adb...you should be fine.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] pluscsc:
good to know. Do you use any custom room? And to do root, it's even orbigado put in ext4
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Wmateria:
I use AICP and i sometimes switch to the Alpha Aex 5 Oreo Rom. I believe you do have to put your Data partition to ext4.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] zao.remy:
Which one is better (more stable)? Magisk or Supersu?
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] zao.remy:
I was looking at another guide and I swiped for system modifications, instead of pressing read only. Can I still change the system to EXT4?
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] gamefreaksuraj:
additional magisk features make it better than super su

---------- Post added at 10:39 PM ---------- Previous post was at 10:38 PM ----------

dude system is by default in ext4 only, u need to make data partition to ext4
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] zao.remy:
Sorry. So is it okay now if I change the data partition to EXT4 after I didn't follow the tutorial properly?
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] gamefreaksuraj:
you can format data partition to ext4 no issues, just backup everything from internal storage
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] zao.remy:
Thanks mate! I'm trying this **** for the first time in my P2, scary as hell. :D
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] gamefreaksuraj:
dont worry if anything happens (which wont happen) fastboot will save you
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] srirams:
Updated twrp Link: https://dl.twrp.me/kuntao_row/
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] garvit girotra:
Its still same as before man u see it now
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] srirams:
the download link in the OP doesn't work .. so just updated that link.... Wrong choice of words it seems... :D:D
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] razr96:
3.2.1-0 is up

https://dl.twrp.me/kuntao_row/twrp-3.2.1-0-kuntao_row.img.html
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] The WiTcH Er:
Updated link for 3.2.1-0

https://dl.twrp.me/kuntao_row/twrp-3.2.1-0-kuntao_row.img.html
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] yuanw:
How long will it take to flash magisk? it has been taken 10 min to show flashing new boot image while I install magisk. stll doesn't end.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Aegir81:
That seems too long. It only took a couple of minutes too flash v14.5.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] celoxocis:
Updated Opening Thread to reflect latest TWRP build.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] abhayruparel:
I'm using the 3.2.1.0 twrp official. When I tried to flash a rom on decrypted device it automatically started to encrypt the device on first boot.

Same thing happened with [MENTION=5963689]gamefreaksuraj[/MENTION] can anyone else confirm?
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] celoxocis:
It depends if the ROMs boot.img would be set to force encrypt. If if is force encrypt and the ROM supports proper device encryption then thats what it would do.

Has nothing to do with TWRP.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] abhayruparel:
Suraj tried flashing the twrp flashable s251 using 3.2.1 which I created by taking system dump & boot.img his device got encrypted on first boot. well I tested the package on my device (unencrypted) serveral times and it didn't start force encryption ( twrp 3.1.1-1) .

Maybe what I said is confusing so let me know it its I will write up again in brief.

Regards

Abhay Ruparel

Edit:- just wanted to let you that the pin error on restoring backup is still there.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] VVitaly:
twrp-3.2.1-0-kuntao_row.img - has an error while restoring the boot partition.

Recovery freezed but dont' restoring boot partition backup.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] celoxocis:
never run into such an issue when restoring boot.

please give this build a try and report back if you encounter the issue.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] VVitaly:
This version have the same problem with TWRP recovery function. And error with install boot partition from img file.

I tryed different TWRP for Lenovo P2 - but all of them have error with restore boot partition from backup (3.0.3 , 3.1.1 , 3.2.1).

:(
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] celoxocis:
I just tried flashing an boot.img from img I build and I have absolutely no trouble flashing it. I suspect whatever boot.img you are flashing is at fault.

Which would explain why it doesn't work on any of the listed versions. Especially since the one I linked is on a totally different base than the official one.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] VVitaly:
But how emmc raw image can be wrong? Only if his size more then partition for flash. By the way, this boot image by dd command flashed well.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Mayankkr26:
One thing i am not getting.... Whenever i try to restore any backup with saved data the pattern is like it doesn't work.... Any solution...
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] :
Hi.

Sorry in advance if this problem was solved or written before.

I have no boot on TWRP recovery.

I can't enter to it.

EDIT: I got enter to Twrp but when I try to do something with Internal Storage appears "Invalid partition selection"

I tried several versions with the same result.

EDIT 2: I solved it! Flashing stock recovery and afterwards twrp. What a relief!
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] eried1:
For the country codes I'm getting the usual ES, FR, GB, HK and so on, but they are followed by chinese letters. Was it the same for you?
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Divine1604:
Greetings!

I was hoping to try out my luck in rooting my P2 and install TWRP, but is it possible to install this without use of computer? I don't have any laptop or PC with me at the moment, so I cannot follow the steps required (as early as step 1, with ADB and fastboot).
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] ASP02:
No ...u need a computer to unlock Ur bootloader...after the 14 days of waiting...try to get hold of a friends pc
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Divine1604:
Sucks to know, but I guess I have no choice if I don't want my unit to get bricked early. Thanks!
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] ryd3r89:
Hello everyone

I'm running an oreo rom and tried to update to latest twrp recovery. Flashed it via twrp but the phone does not boot into recovery, just blue light and some vibrations and black screen?

I tried going back to stock, but it fails at flashing boot, some error about downgrading with unlocked bootloader. What can I do?
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] dkgagan7:
bro can u please provide me EFS - modem twrp backup of lenovo p2

my modem partition got deleted

please contact me on facebook dkgagan7 or on email dkgagan7@gmail.com
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Kevindiepenmaat:
Did you manage to solve your issue? As far as i know you do not need those file, just flashing back the stock rom should do the trick, see also this thread
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] dkgagan7:
yes sir...i solved it via twrp backup of someone ...i downloaded it from google drive link...sm1 shared it on forums link...

thank you for the reply :)
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Kevindiepenmaat:
Nice, glad you didn't had to use this great device as a brick or something.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] gemerttower:
Oh my. How to do that factory reset? To my knowledge I did all I could in TWRP, but I can't get it solved.. Any ideas?

Nvm, looks solved with installing S251 stock rom, hopefully!

Edit 2: Then flashing to another custom rom I get the same message, but now in Dutch :) -> I used the right passcode, but the data is damaged, is the message in Dutch.. Still needs a factory reset.. Meh
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Kevindiepenmaat:
I've had the same issue. This is because the format of the partitions are changed when flashing a ROM.

Which do you want to use?
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] gemerttower:
Goedenavond :)

I wanted to switch from Android Open Source Illusion Project to Cardinal-AOSP, updatewise.

Btw, in the mean time the stock rom stops with the same message.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Kevindiepenmaat:
Haha Goedeavond,

That can be because every ROM has it's own partition format table. Normally every ROM assumes you came from stock.

So if you have the partitions the same as stock (Stock s251 uses all partitions as EXT4 and Data as F2FS).

When flashing a custom rom the format can be changed, depending on the ROM. For Stock it does not matter if is EXT4 or F2FS.

The most important thing is that you should be able to wipe the partitions from recovery (like TWRP for example).

If you get an error message, something like "wrong format", or "unable to wipe".

You need to change the format, this can be time consuming.

Keep in mind i do not use Cardinal, i only use LOS.

I'll write the steps below, these worked for me (i have TWRP).

Make an backup of internal storage.

Reboot phone into recovery.

Check if you're able to perfom a wipe (System, Cache and Data), this should perform without any error. If you get an error (check which partition) you need to change the partition format of that partition. See step 3.

System = EXT4

Cache = EXT4

Data = F2FS (in most cases it is this partition)

Go to Wipe > Advanced Wipe > Select Partition > Repair / Change File System and select a different format than the correct one.

<example: if Data then change to ext4>

After changing format reboot directly into recover perfom the previous step again but now select the correct format.

Reboot again into recovery.

Perform full wipe (Cache, System, Data & Internal Storage), now it should give no errors.

Reboot into recovery

Go to Advanced > ADB sideload

Open an command promp on PC and connect your phone to the computer.

Execute following commands to sideload the Zip files (ROM + GAPPS (if required)).

adb sideload C:\path\Romfilename.zip

adb sideload C:\path\GAPPS.zip

See also this link for detailed information

When flashing is done, reboot your phone and now it should start.
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] gemerttower:
I'll get to that, think it will work. I did a feeling it had to go that way, but many thanks for confirming this!!

En heb een goed weekend!
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] Kevindiepenmaat:
No problem man glad i could help.

Van hetzelfde he ;)
[Lenovo P2 ROMs, Kernels, Recoveries, & Other Devel] gemerttower:
Took a lot of work (and reading! :)) finding the right version of adb, but it worked, I have a working phone again. Thanks again for the explanation, forgot to say that, because RTL7 at 20:30 on friday! Big thanks :good: