FORUMS
Remove All Ads from XDA

[Recovery][Lenovo P2][P2a42] Official TWRP for the Lenovo P2 (3.1.1-1)

1,120 posts
Thanks Meter: 1,128
 
By celoxocis, Senior Member on 7th January 2017, 10:46 AM
Post Reply Email Thread
Team Win Recovery Project 3.1.1-1



This is for the Lenovo P2a42 only! Do not flash on the Lenovo P2c72!

WARNING: Rooting The Lenovo P2 with SuperSu currently works only in System-Mode, which prevents you from installing OTA Updates!
INFO: Follow the full rooting steps below, in order, to allow system modifications!

WHAT IS TWRP?

Oh come on, you know what it is - don't try to fool me!
In case you're serious, though...

Team Win Recovery Project is a custom recovery for Android devices.
It allows you to back up and restore your data, flash custom ROMs to your device, repair broken file systems, and root your device.

Read more about TWRP here: https://twrp.me/about/

DOWNLOAD

You can find the Official Download here (Version: 3.1.1-1): recommended!
https://goo.gl/kvbiRP

You can find the Pre-Official Download here (Version: 3.1.1-1):Currently no Pre-Official!
See Post #3


This is the download link, for instructions on how to flash it, see below.

You can find up to date fastboot & adb binaries here!

FULL STEPS FOR OBTAINING ROOT

Follow these instructions until someone nice comes along and makes a video from them (without ads):
[LIST=1][*]Extract/ install adb & fastboot to your computer.
[*]Download TWRP for Lenovo P2 (P2a42).
[*]In your ROM, go to Settings -> About device. Tap 8 times on Build number to enable Developer options.
[*]Now go to Settings -> Developer options. (above About device)
You need to enable OEM unlock, otherwise you might end up with boot problems or be unable to flash later on.

Once you tap the unlock the bootloader it will ask you to formally submit the request, when you accepted the void warranty thing you will have to wait 14 days.
[*] After 14 days . Reboot your device into fastboot mode. To do this, select reboot from the power menu and hold the [Volume Down] + [Power] buttons while your device reboots or boots from power off.
[*]Once you're in fastboot mode, you need to unlock your bootloader. To do this, run this command:
fastboot oem unlock
WARNING: Unlocking your bootloader will erase all userdata on the device! Your device will be completely reset to factory defaults!
[*]Once your bootloader is unlocked, you're ready to flash TWRP. To do this, run these commands in order:
fastboot flash recovery twrp.img
fastboot boot twrp.img

[*]At this point, you will reach the screen asking you if you want to allow system modifications.
By swiping right, you will trigger system modifications for TWRP and TWRP will be installed permanently!
If you are going to root your device and follow the rest of these steps, then it is safe to swipe right and enable modifications.
[*]If your device asks for a password to mount internal storage, and your password doesn't work or you haven't set one, see below under known issues for a fix!

[*]If you want to be rooted see Post #2:

UPDATING TWRP

To update TWRP, simply download the new twrp.img on your phone, then boot into your current TWRP and flash it.
To flash a twrp.img, navigate to [Install] -> [Flash Image] -> select your twrp.img -> [x] Recovery -> Flash!
After that, just use [Reboot] -> [Recovery] to reboot into the updated TWRP.

CHANGES
  • v3.0.3-0 (beta) - Initial public beta v1 release.
  • v3.0.3-0 (beta) - public beta v2 release.
    - Enable double-tap to wake in recovery
    - Fixed MTP Issues
  • v3.0.3-0 (Official) - public release.
    - fix device name for update.zip's
  • 3.1.1-0 (Official) - Official release.
    - Completely rebased on Nougat
    - Included OTA support.
  • 3.1.1-1 (Official) - Official release.
    - Fix "Format Data" when using default (f2fs)
    - Enabled OTA support.

FEATURES
  • MTP support
  • USB OTG storage support
  • Hardware Qualcomm-based full-disk encryption support
  • f2fs file system support (read, write, format, backup & restore)
  • exFAT file system support (read, write, format)
  • ADB root
  • Full SELinux support
  • Built in android 7.1 tree

KNOWN ISSUES
  • SuperSU will only work by default in System-Mode because the data partition is F2FS! (by default from Lenovo)
  • SuperSu's Systemless Mode will work when the data partition is changed to EXT4!

DECRYPTION NOT WORKING?

If your device isn't decrypting in TWRP, chances are you set a boot up password.
You can solve this by disabling your boot up password in your device OS's settings.
By disabling your password your OS will rewrite your crypto key to be compatible with TWRP and TWRP will decrypt with the default password.

WHY DOES F2FS MAKE TWRP SO SLOW?

When TWRP boots up or wipes partitions and a few other scenarios, it checks each partition to see how much disk space is used. Ext4 handles disk usage calls quite efficiently and will finish this very fast. F2FS on the other hand is very slow when it comes to checking disk usage. We're unsure why this is. Every file on the F2FS formatted partition adds a little more time, and a device that is 30 GB full could take up to 10 minutes to boot TWRP!
I suggest switching your data partition to ext4 - all the f2fs hype is merely from benchmarks that don't actually represent real world use (ie. you're not writing thousands of files per second)
For someone who doesn't do lots of write access to their data partition, ext4 can actually be advantageous (it has faster access times and reads!)

CONTACT & SUPPORT

You can find TeamWin on IRC at #twrp on chat.freenode.net.
You can also post in this thread and I will attempt to answer any questions you may have.

SOURCE CODE

TWRP: https://github.com/omnirom/android_bootable_recovery (android-7.1)
Device tree: https://github.com/Celoxocis/android...ovo_kuntao_row (android-7.1)

CONTRIBUTIONS

Gerrit for TWRP: http://gerrit.omnirom.org/
Gerrit for officially supported devices: http://gerrit.twrp.me/

XDA:DevDB Information
Team Win Recovery Project for the Lenovo P2, Tool/Utility for the Lenovo P2

Contributors
celoxocis, Maintainer & Developer
Gilotto, Closed Beta Tester
HaJeeEs, Closed Beta Tester


Version Information
Status: Official
Current Official Version: 3.1.1-1
Official Release Date: 2017-08-02

Created 2016-01-07
Last Updated 2017-08-03

Download Counter:
Initial Beta Release v1: 57
Initial Beta Release v2: 20
Official Version: It's Over 5000!

So you are generation Y? too much to read or you don't real at all? Prefer a video? Head over to Youtube!
Video Tutorials on Youtube for Systemless Mode ROOT METHOD
How to ROOT LENOVO P2 | Install TWRP Recovery | Works on Marshmallow Only
How to ROOT Lenovo P2 with Android Nougat | Lenovo P2 Root Tutorial
Thanks to TechXplicit

----- General Information -----
Here is an info for everyone patiently waiting and want to help in any way possible for the Project "Official LineageOS for the Lenovo P2".

All donations which are send to me (TWRP appreciation donations)
Will be put forward to buy new PC components/hardware for Mike (Official LineageOS developer)
He is developing and working on an 8+ Year old PC and i think we all can agree that an upgrade would be an amazing way to show our collective appreciation to him and keep him motivated on the project.

Donation Link, please see my signature!
The Following 37 Users Say Thank You to celoxocis For This Useful Post: [ View ] Gift celoxocis Ad-Free
 
 
7th January 2017, 10:46 AM |#2  
celoxocis's Avatar
OP Senior Member
Flag Belgrade
Thanks Meter: 1,128
 
More
Confirmed and working ROOT methods!
Up-to-date: For root with Nougat please use phh's supersu
Use version 2.59 from here
Install phh's SuperUser in the Play Store
to manage root access of apps.
Simply flash it and enjoy.
--------------------------------
If you prefer Magisk:
Prio to installing Magisk you will have to change the data partition from F2FS to EXT4 because the Lenovo Kernel is missing an F2F2 feature.

How to format data to EXT4:
Make sure while the first time you boot TWRP.
You "KEEP SYSTEM in READ ONLY MODE" by clicking "Keep Read Only"
then Go to:
Wipe>Advanced Wipe>Select "Data">Repair or Change File System>Change File System>EXT4
You will receive and Error but don't worry about that. Simply Ignore it. It worked.

Install Magisk
and once you booted up the system install Magisk manager.

Proof that Magisk works see attachment!

too much to read? Prefer a video? Head over to Youtube!
Video Tutorials on Youtube for Systemless Mode ROOT METHOD
How to ROOT LENOVO P2 | Install TWRP Recovery | Works on Marshmallow Only
How to ROOT Lenovo P2 with Android Nougat | Lenovo P2 Root Tutorial | Works on Nougat!
Thanks to TechXplicit

--------------------------------

Outdated Root Method for Marshmallow ONLY:

Here is for confirmed and working ROOT METHODS !!! Marshmallow ONLY !!!
(FOR SYSTEM MODE ROOT ONLY!)

download this pack https://goo.gl/KFtyzl
and extract its content into the adb&minimal fasboot folder
enter TWRP
do
Code:
adb push dot.supersu /data/.supersu
Select "ADB Sideload" in TWRP menu, (Advanced>ADB Sideload) make sure to select "Wipe Cache" and
Swipe to to Start Sideload and use following command to push SuperSu files.
Code:
adb sideload SuperSU.zip
Reboot into System. Done!

--------------------------------
FOR SYSTEMLESS MODE ROOT ONLY: (preferred method!) !!! Marshmallow ONLY !!!

As i stated in the Opening Thread. SuperSu can not be installed in Systemless-Mode by default because by default the /data partition is formated in F2FS.
More detailed explanation here: here

The current workaround is to disable the encryption (fully optional) and wipe the /data partition and format the /data partition to EXT4, which is also supported by the boot.img (thank you Lenovo!) and install SuperSu in Systemless-Mode. EXT4 formatting can be done through the "advanced wipe" of TWRP.

It has been tested and confirmed working. The main advantage is working OTA due to systemless SuperSu. As the OTA doesn't care if /data is actually F2FS or EXT4. Lenovo was so kind to provide both options in the stock boot.img.

Attached Thumbnails
Click image for larger version

Name:	Screenshot_1970-06-16-00-47-00.png
Views:	700
Size:	167.3 KB
ID:	4225721   Click image for larger version

Name:	Screenshot_20170728-133133.jpg
Views:	706
Size:	105.0 KB
ID:	4225731  
The Following 8 Users Say Thank You to celoxocis For This Useful Post: [ View ] Gift celoxocis Ad-Free
7th January 2017, 10:47 AM |#3  
celoxocis's Avatar
OP Senior Member
Flag Belgrade
Thanks Meter: 1,128
 
More
Factory Images for P2a42 Marshmallow/Nougat & TWRP Test Image & Kernel Sources
Q: I messed up help me?!
So you screwed up and didn't follow Rule Number One in the IT-Handbook?
Which is: Always create a backup before working on a system?

(FACTORY IMAGES FOR Marshmallow ONLY!)

Warning! Following images are all confirmed working for the P2a42!
Do NOT attempt to use it on the P2c72 it will brick your device!
If you need an P2c72 factory flasher version! Let me know i will provide you with one!

Download the Factory State Images for Marshmallow. Which are all flashable with fastboot: https://goo.gl/JTCwKj

Place the files you want replaced into the "Minimal ADB & Fastboot" installation directory and start it's shell:
If you want to flash back the stock recovery. Simply run:
Code:
fastboot flash recovery recovery.img
You can also replace all partitions if required.
There is an flashall.bat file in the SW directory. Run it in case you want to restore all partitions.
But i highly recommend to replace just the partition you messed up. In most cases it will be boot,recovery or system.

One exception would be if you want to upgrade from an Old Firmware and you simply do not receive any OTA update files.
In that case you want to run a complete upgrade by running the flashall.bat file.

(FACTORY IMAGES FOR Nougat ONLY!)

Warning! Following images are all confirmed working for the P2a42!
Do NOT attempt to use it on the P2c72 it will brick your device!
If you need an P2c72 factory flasher version! Let me know i will provide you with one!

Download the Factory State Images for Nougat. Which are all flashable with fastboot: https://goo.gl/b7Dx37


too much to read? again?! do you ever read?
don't worry TechXplicit got you covered!
Head over to Youtube!
Lenovo P2 STOCK Firmware | Restore Bootlooped Lenovo P2 | How to get back to OTA updates
Thanks to TechXplicit

--------------------------------
Pre-Official TWRP Images:

TWRP 3.1.1-0 (latest version)
Currently no Pre-Official.

Q: Why Pre-Official?
A: It's is an "canary build" meaning, in test phase before it gets pushed Official but it is fully tested on Marshmallow and Nougat. Even confirmed working for the P2c72.

--------------------------------
Lenovo P2a42 Kernel Sources for Marshmallow/Nougat:

Official Lenovo Download Link
Mega Mirror in case above Links get removed from Lenovo in the future: *Uploading*
The Following 8 Users Say Thank You to celoxocis For This Useful Post: [ View ] Gift celoxocis Ad-Free
7th January 2017, 11:45 AM |#4  
wimmetje's Avatar
Senior Member
Thanks Meter: 83
 
More
Great work,
Now only an seperate forum
Shall i request it?
7th January 2017, 11:58 AM |#5  
celoxocis's Avatar
OP Senior Member
Flag Belgrade
Thanks Meter: 1,128
 
More
Quote:
Originally Posted by wimmetje

Great work,
Now only an seperate forum
Shall i request it?

No need to I will request one once I upload all sources and pushed TWRP Official.
The Following 2 Users Say Thank You to celoxocis For This Useful Post: [ View ] Gift celoxocis Ad-Free
7th January 2017, 01:44 PM |#6  
celoxocis's Avatar
OP Senior Member
Flag Belgrade
Thanks Meter: 1,128
 
More
As a reminder! Always create a backup of the boot and system partition (as image!) before installing anything to stay save!
The Following User Says Thank You to celoxocis For This Useful Post: [ View ] Gift celoxocis Ad-Free
7th January 2017, 01:54 PM |#7  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by celoxocis

Small Update: DO NOT Flash the latest System-Mode SuperSU. It was reported to cause a bootloop on the Lenovo P2. Stick with Version 2.76!
As a reminder! Always create a backup of the boot and system partition (as image!) before installing anything to stay save!

I was to fast! I installed version 2.79. I reinstalled version 2.76, but it wont boot Any idea how I can fix it? Of course I'm an idiot who didn't make a back up.
7th January 2017, 02:07 PM |#8  
celoxocis's Avatar
OP Senior Member
Flag Belgrade
Thanks Meter: 1,128
 
More
Quote:
Originally Posted by BDM101

I was to fast! I installed version 2.79. I reinstalled version 2.76, but it wont boot Any idea how I can fix it? Of course I'm an idiot who didn't make a back up.

Look for "Unsu" script here in the forum. It will take you out from the bootloop.
7th January 2017, 02:13 PM |#9  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by celoxocis

Look for "Unsu" script here in the forum. It will take you out from the bootloop.

Thx!!!! That worked
7th January 2017, 02:30 PM |#10  
celoxocis's Avatar
OP Senior Member
Flag Belgrade
Thanks Meter: 1,128
 
More
Updated Post #2 here https://forum.xda-developers.com/sho...35&postcount=2
for confirmed and working Root Method!
7th January 2017, 02:56 PM |#11  
Senior Member
Flag Albano Laziale
Thanks Meter: 32
 
More
Fantastic! Is possible to have a separate forum for the p2?
Post Reply Subscribe to Thread

Tags
lenovo p2, lenovo-p2, p2a42, twrp

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes