[ROM][12.1][UNOFFICIAL] LineageOS 19.1 for Lenovo P2

Search This thread

leo_97

Senior Member
Jan 6, 2017
225
168
Lenovo P2
nJd0Bg.png

Code:
#include <std_disclaimer.h>
*
* Your warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
*

LineageOS is a free, community built, aftermarket firmware distribution of Android 12L (Sv2), which is designed to increase performance and reliability over stock Android for your device.

LineageOS is based on the Android Open Source Project with extra contributions from many people within the Android community. It can be used without any need to have any Google application installed. Linked below is a package that has come from another Android project that restore the Google parts. LineageOS does still include various hardware-specific code, which is also slowly being open-sourced anyway.

All the source code for LineageOS is available in the LineageOS Githup repo. And if you would like to contribute to LineageOS, please visit out Gerrit Code Review.

Installation:
If you are on stock OS, you need a custom recovery first. You can get the recommended LineageOS recovery in the official installation instructions link below.
You can use TWRP for installation, however it is no longer officially supported since we do not have full control of its update cycle and potential issues.

If you are coming from stock or other ROMs, you need to make a factory reset.
As always, make sure to backup before installing this ROM.

Installation Instructions:
Backup your data and see the next post below

Recommended TWRP Image:
twrp-3.7.0_9-0-kuntao.img

ROM Download Links:
Google Drive | SourceForge

Recommended Google Apps Package:
NikGapps-core-12.1
NikGapps-SetupWizard
NikGapps-AndroidAuto
Or
MindTheGapps-12.1 (Google Drive mirror)

Root Access:
Magisk v25.2 (more stable experience)
Magisk v26.1 (more updated build)

Recommended Useful Add-on:
p2oggle-1.2

Source Code:
https://github.com/LineageOS

ROM Firmware Required:
Any version of stock 6.0. Recommended P2a42_S251_171107_ROW

Acknowledgements:
Thanks to @mikeioannina for his hard work regarding kuntao and to all other Lineage OS developers
Special thanks to @Astridxx for the device tree sources and for helping me out and to @en666 for early testing the initial build

Important Notes:
As you can see from my profile, I'm not an experienced developer. I've made some builds as a considerable amount of users showed interest in having their devices updated with latest LineageOS code. Therefore, my main objective here is to bring the latest Android security patches to kuntao making monthly builds.
To be clear, I'm more in a situation of "user became builder" than of "ROM developer". Please, understand this.

Long live to our beloved kuntao!

XDA:DevDB Information
[ROM][12.1][UNOFFICIAL] LineageOS 19.1 for Lenovo P2

Contributors
@Astridxx ,@XiaoAk ,@Sohit5s, @mikeioannina
ROM OS Version: 12.x
ROM Kernel: Linux 3.18.x
Based On: LineageOS

Version Information
Status:
Stable

Created 2023-02-22
Last Updated 2023-05-09
 
Last edited:

leo_97

Senior Member
Jan 6, 2017
225
168
Lenovo P2
Installation Instructions

Remember, making a backup of your data before proceeding is recommended

If you are coming from Stock ROM, please refer first to the instructions below:
Install LineageOS on kuntao

If you are coming from astridxx previous build (aka lineage-19.1-20220822-UNOFFICIAL-kuntao) or my initial build (aka lineage-19.1-20230222-UNOFFICIAL-kuntao) or any version of LOS18.1 or below, you must perform a clean flash. Clean flash instructions:

0- Make a backup (optional, but recommended)
1- Reboot to recovery
2- Format data (will delete all your data!)
3- Reboot to recovery again
4- Wipe > Advanced Wipe:
- Dalvik
- System
- Vendor
- Data
- Cache
- Internal Storage (optional, but recommended)
5- Flash ROM ZIP, Gapps, Gapps add-ons, Magisk add-on, etc
6- Reboot to system
7- Wait until it boots for the first time (may take some minutes)

Update Instructions

NOTE: Dirty flash from any of the aforementioned builds is not supported, device trees were changed. You have been warned!

For updating from one of my builds to another (aka dirty flashing), please do the following:
1- Download ROM ZIP and copy it to the phone
2- Reboot to recovery
3- Flash ROM ZIP
4- Clean cache
5- Reboot to system
 
Last edited:

leo_97

Senior Member
Jan 6, 2017
225
168
Lenovo P2
Known Issues
- Storage encryption is partially broken (if your /data partition is unencrypted, trying to encrypt it using ROM menu will result in a dead OS; if already encrypted, storage encryption may or may not work. IFAIK, it's a kernel side issue)
- Device may not go to deep sleep
- Storage forceencrypt flag is disabled (to encrypt /data partition follow the instructions below)
- TWRP backups are broken (read notes below)
- You tell

Google Play Store Update Bug

If Google Play Store app keeps failing to find updates for apps with message "Something went wrong. Try again.", just clear its data and then it should work again

SafetyNet Check Fails

If your device is rooted, please, follow the instructions contained here

Magisk is Gone After First Boot

Please, just reflash Magisk again (i.e. Reboot to recovery > Flash ZIP > Reboot back to system)

How to encrypt data partition

0- Backup your files (this process will erase everything)
1- Boot to TWRP recovery
1.1- Wipe > Format data > Reboot to system
2- Settings menu > Security > Encryption & credentials > Encrypt phone
3- Reboot to system again

Error restoring TWRP system backups

It looks like TWRP backups are broken for now, so please, if this is a must have for you, you can try to install OrangeFox recovey and follow these instructions (thanks @Zdeslav for that)

ROM Change logs

Code:
02/22/2023
- Initial release

02/27/2023
- Sync latest LOS sources
- Device Tree change: Use old A12L dt instead of los
- Add Lenovo Parts menu (fp gestures, USB fast charge, in-call audio gain, screen kcal)
- Updates phone vibration strength
- Add fix to device deep sleep issue
- Many more changes

03/29/2023
- Fetch latest Device Tree sources
-- vendorsetup.sh: Add Trebuchet patch
-- AOSP WFD doesn't support protected Wi-Fi Display buffers
-- Overlays:
--- Enable voWIFI support
--- Disable IMS features for Turkiye networks
-- Don't warn user about FC in Vanced microG
-- DT rootdir:
--- Add cpuset for the camera daemon
--- Remove permission restrictions to the socket file
--- Restore iio sensor device6 on boot
-- Bump graphene camera version to 60
-- Don't force enable ims features
-- sepolicy: Address sensor hal denials
- Update LOS components
-- Manifest: Sync x86_64 webview prebuilts again
-- Update zlib source
- Sync latest LOS source
- Merge March security patch

04/09/2023
- Fetch latest Device Tree sources
-- Add navbar enable/disable support
-- fs: Revert sdfat update for OTG
-- block: Add zen io scheduler
-- dts: Decrease BCL low battery threshold to 5%
-- DeskClock:
--- Wallpaper based text coloring for digital
--- Adapt digital clocks to S style
--- Remove night mode
-- Trebuchet:
--- Kill haptics in recents
--- Make overview scrim transparent again
-- Nfc: Fix Mifare Classic reading
- Update LOS components:
-- lineage: Track the FMRadio App and dependencies
- Sync latest LOS source

04/19/2023
- Fetch latest Device Tree sources:
-- sepolicy: Silence tracingproxy_service neverallow denial
-- sepolicy: Allow system_app to access storaged via IPC
- Sync latest LOS source
- Merge April security patch

05/09/2023
- Fetch latest Device Tree sources:
-- Bump graphene camera version to 62
-- devicesettings: Protect broadcast to fingerprint gestures
-- rootdir: Remove permission restrictions to the socket file
- Sync latest LOS source
- Merge May security patch
 
Last edited:

leo_97

Senior Member
Jan 6, 2017
225
168
Lenovo P2
ROM Screenshots

Attached below. Others are available here.
 

Attachments

  • Screenshot_20230222-181743_Settings.png
    Screenshot_20230222-181743_Settings.png
    137.7 KB · Views: 75
  • Screenshot_20230222-182339_Trebuchet.png
    Screenshot_20230222-182339_Trebuchet.png
    169.3 KB · Views: 74
  • Screenshot_20230222-181629_Trebuchet.png
    Screenshot_20230222-181629_Trebuchet.png
    529.9 KB · Views: 66
  • Screenshot_20230222-210710_Android Setup.png
    Screenshot_20230222-210710_Android Setup.png
    58.6 KB · Views: 70
  • Screenshot_20230329-114159_Trebuchet.png
    Screenshot_20230329-114159_Trebuchet.png
    267.7 KB · Views: 23
Last edited:

leo_97

Senior Member
Jan 6, 2017
225
168
Lenovo P2
February 27th 2023 Release

Changelog:
- Sync latest LOS sources
- Device Tree change: Use old A12L dt instead of los
- Add Lenovo Parts menu (fp gestures, USB fast charge, in-call audio gain, screen kcal)
- Updates phone vibration strength
- Add fix to device deep sleep issue
- Many more changes

Download URLs: GDrive | SF

Dirty flash still not supported (tree changed), please make a clean flash
 

en666

Senior Member
Apr 23, 2011
101
68
@leo_97 thank you for this new build! Installed it straight away and now the phone is running since then and also, I've flashed with battery at 67% and atm, after a quite hard usage to test out the new features, I'm on 13%. Basically, so far so good!

p2a42, twrp 3.7, rooted, unencrypted
 
  • Like
Reactions: eried1 and leo_97

bidulez

New member
Feb 24, 2023
3
4
Thank you @leo_97 !
I was frustrated that Lineageos 18.1 was no longer maintained when I saw this update!
It's amazing :)
To all users and developers who tested and created this ROM, is it time to switch on this version ?
Or is it better to wait ?
For example, automatic update is possible after install ?
 
  • Like
Reactions: eried1 and Zdeslav

leo_97

Senior Member
Jan 6, 2017
225
168
Lenovo P2
Thank you @leo_97 !
I was frustrated that Lineageos 18.1 was no longer maintained when I saw this update!
It's amazing :)
To all users and developers who tested and created this ROM, is it time to switch on this version ?
Or is it better to wait ?
For example, automatic update is possible after install ?
You are welcome :)
If it's time to switch, I believe it's a matter of personal decision. Maybe you could wait the next build and then decide...
If with "automatic updates" you mean OTA updates, then the answer (as already pointed out by @utwer ) is no. But once the trees are stable enough, I hope every user will be able to just update to the newer versions flashing ROM ZIP through TWRP (just like it's done on LOS18.1)
BTW, IDK if you already saw it, but we are maintaining a monthly build of LOS18.1 which you can download from here. The source tree used there is far more tested (as it's older) than this one. Anyway, except by the encryption thing, you shouldn't have any problems using this LOS19.1 ROM as our amazing developers made an excellent job here.
 

Zdeslav

Member
Nov 24, 2017
26
9
Split
Reg, Ive installed it and I may say it is quite good. Not tried to root it yet. Dont have direct problems with ROM and functionality, for me everything works. Camera, Location, GSM, Data, WiFi. With developer options I've turned off Animation scale on three options to OFF, and is good. Stable reliable.
MindTheGapps-12.1 works every app from Google, Phone, Contact, Gmail, maps...etc...
What I need root mostly is for Call recording (Skvalex) and Viper4Android.

Some words about twrp-3.7.0_9-0-kuntao.img,
With this I have only problems, so far I lost a few backups and I need to install it all over again a few times allready. Disappointed very. I can't rally on this when I make a nandroid ba.ckups.
Also lost backups for LOS18.1 and I am been very pis....ed off. Error 255 on System recovery, other Data, Boot, EFS, Vendor, etc.. recovery is good.
So I've installed OrageFox for Kuntao. Tried several backups to restore already and I may say I am very satisfied. Puh

What is on my mind, when I installed a Magisk 25.2, no matter of LOS 18.1 or 19.1 with very few modules, after 7-8 reboots I've got boot loops which is beyond repairable.. Try to remove modules in TWRP in file manager, uninstall whole magisk, no way, but what it is seems that DATA got corrupted some how, everytime.
There were also installed TWRP mentioned above.

Now I am with OrangeFox and I will try tomorrow to Root it and see is there any connection between Magisk and recovery software (OrangeFox or TWRP).

Reg
 
Last edited:

MKbis

New member
Mar 12, 2023
2
3
Tried quickly this ROM yesterday. In general all working, but didn't test much.
Few feedbacks:
-Scaler for brightness level is weird, very different from the original Lenovo roms. Anyway, not really important, but something that I noticed.
-Missing haptic feedback when using the fingerprint reader as a gesture button. Again, not critical, but I am really accustomed to it and thus I noticed immediately.
-Missing haptic feedback intensity regulation, or could not find it. It's there for general call/notification vibration, but if I remember correctly lineage could also change haptic.

Impressed that you could integrate also some lenovo features, even if of course not all of them :)
If you want me to test something more specific, please let me know. Ah, my model is the 4 GB/ 64 GB combination.

Cheers!
 

eried1

Senior Member
May 27, 2016
438
72
Stockholm
You are welcome :)
If it's time to switch, I believe it's a matter of personal decision. Maybe you could wait the next build and then decide...
If with "automatic updates" you mean OTA updates, then the answer (as already pointed out by @utwer ) is no. But once the trees are stable enough, I hope every user will be able to just update to the newer versions flashing ROM ZIP through TWRP (just like it's done on LOS18.1)
BTW, IDK if you already saw it, but we are maintaining a monthly build of LOS18.1 which you can download from here. The source tree used there is far more tested (as it's older) than this one. Anyway, except by the encryption thing, you shouldn't have any problems using this LOS19.1 ROM as our amazing developers made an excellent job here.
So for 18.1 we can just flash the newer versions via TWRP and do not have to reinstall the entire ROM?
 

Zdeslav

Member
Nov 24, 2017
26
9
Split
Reg, Ive installed it and I may say it is quite good. Not tried to root it yet. Dont have direct problems with ROM and functionality, for me everything works. Camera, Location, GSM, Data, WiFi. With developer options I've turned off Animation scale on three options to OFF, and is good. Stable reliable.
MindTheGapps-12.1 works every app from Google, Phone, Contact, Gmail, maps...etc...
What I need root mostly is for Call recording (Skvalex) and Viper4Android.

Some words about twrp-3.7.0_9-0-kuntao.img,
With this I have only problems, so far I lost a few backups and I need to install it all over again a few times allready. Disappointed very. I can't rally on this when I make a nandroid ba.ckups.
Also lost backups for LOS18.1 and I am been very pis....ed off. Error 255 on System recovery, other Data, Boot, EFS, Vendor, etc.. recovery is good.
So I've installed OrageFox for Kuntao. Tried several backups to restore already and I may say I am very satisfied. Puh

What is on my mind, when I installed a Magisk 25.2, no matter of LOS 18.1 or 19.1 with very few modules, after 7-8 reboots I've got boot loops which is beyond repairable.. Try to remove modules in TWRP in file manager, uninstall whole magisk, no way, but what it is seems that DATA got corrupted some how, everytime.
There were also installed TWRP mentioned above.

Now I am with OrangeFox and I will try tomorrow to Root it and see is there any connection between Magisk and recovery software (OrangeFox or TWRP).

Reg

So,
Resolved issue of bootloops:
after you install SU like Magisk, and wan to freeze apps by Titanium Backup or Neo-Backup, Apps which causes bootloops are ROM's Phone and Massages (In my case, for 16.1, 18.1, 19.1), I freeze Audio.apk who need to be shutdown for Viper4Android app who takes audio management and freezing is OK.
But Phone and Massages which are frozen cause bootloops, so you need to return from freeze state somehow in TWRP or OrangeFox with file management or revert backup. Revert backup is easier :).

Camera; found issue when suddenly is out of work and cannot be connected to app. Also have problems with video cast Skype, Viber, Whatsapp, Telegram video is frozen. Hardly switch in Camera app from Camera mode to Video mode and vice-versa.

Clock & Info; missing dock icons and info, can't "capture" moment for reason when they disappear but after a while all is returned again.

viber_slika_2023-03-20_11-10-47-518.jpg


P2oggle, left switch button work okey in form of 0.4 version.
Reg,
thanks on the development for this 19.1 ROM.
 

leo_97

Senior Member
Jan 6, 2017
225
168
Lenovo P2
Camera; found issue when suddenly is out of work and cannot be connected to app. Also have problems with video cast Skype, Viber, Whatsapp, Telegram video is frozen. Hardly switch in Camera app from Camera mode to Video mode and vice-versa.

Clock & Info; missing dock icons and info, can't "capture" moment for reason when they disappear but after a while all is returned again.

P2oggle, left switch button work okey in form of 0.4 version.
Reg,
thanks on the development for this 19.1 ROM.
Hello,

I've been using this ROM as my daily driver and couldn't confirm this camera bug, could you please give a few extra details? I tested on Telegram app. Which version are you using? The Play Store's one or the one from Telegram's official website? Did you give the app "While using app" permission or "Ask every time" permission for camera? Are you sure the QS Tile "Camera access" is activated (available) when the mentioned bug occurs?

Regarding the Clock widget, yes, there's a small glitch and I'm not sure on how to fix it, if it doesn't load at all, a system reboot should fix it.

P2oggle v1.2 is 100% working as far as I can tell, so you guys can try it too if you want.
-Scaler for brightness level is weird, very different from the original Lenovo roms. Anyway, not really important, but something that I noticed.
-Missing haptic feedback when using the fingerprint reader as a gesture button. Again, not critical, but I am really accustomed to it and thus I noticed immediately.
-Missing haptic feedback intensity regulation, or could not find it. It's there for general call/notification vibration, but if I remember correctly lineage could also change haptic.
I'm not sure if it's possible to "fix" the brightness slider.

If with "haptic feedback" you mean the phone vibration, you can just adjust it to your liking in Settings > Lenovo parts > Vibration strength, it should affect fp reader too, dunno if it affects call vibration but IFAIK it should.

Regards
 

Zdeslav

Member
Nov 24, 2017
26
9
Split
Leo_97

I've been using this ROM as my daily driver and couldn't confirm this camera bug, could you please give a few extra details? I tested on Telegram app. Which version are you using? The Play Store's one or the one from Telegram's official website? Did you give the app "While using app" permission or "Ask every time" permission for camera? Are you sure the QS Tile "Camera access" is activated (available) when the mentioned bug occurs?
Yes on latest Telegram app from web site, tried with Google Meet, Whatsapp, Viber.., always breaking connection with API/drivers. Yes I gave all permissions to Camera. If I am not giving permissions for camera, I have always noticed to confirm what I am giving, so I am excluded from this solution. And clean storage and cashe from app regular but not prevail.
But, in a while after installed a new ROM without giving SU/Root I noticed this behavior, right after I wrote earlier post up. My bad :).
Choppy startup of camera, can't easily transfer from video 2 camera and vice-versa, so I tell to my self to test intensively.

Regarding the Clock widget, yes, there's a small glitch and I'm not sure on how to fix it, if it doesn't load at all, a system reboot should fix it.
Yes after a while it is returned back without reboot. weird.

P2oggle v1.2 is 100% working as far as I can tell, so you guys can try it too if you want.
Didn't know about P2oggle v1.2 app, thx
 

leo_97

Senior Member
Jan 6, 2017
225
168
Lenovo P2
March 29th 2023 Release

Changelog:
- Fetch latest Device Tree sources
- Update LOS components webview & zlib
- Sync latest LOS source
- Merge March security patch
- Many more changes
Full change log available on the bottom of this post

Download URLs: GDrive | SF

Note: Please, before flashing, carefully read the instructions from the 3rd post above to avoid breaking your system.

Enjoy!
 

pirogof

Senior Member
Dec 18, 2009
113
12
Great job, dude.
Previous versions had some buggy charging driver that left a wakelock running after each charging, and u had to restart phone each time or leave it to slowly drain battery by not going to sleep.
Somehow this problems seems to be gone in your build and that is awesome.
I've been using the build for about 2 weeks now and so far everything seems to be working fine.
 

leo_97

Senior Member
Jan 6, 2017
225
168
Lenovo P2
April 09th 2023 Release

Change log:
- Fetch latest Device Tree sources (lots of changes)
- Update LOS components:
-- lineage: Track the FMRadio App and dependencies
- Sync latest LOS source
- Many more changes
Full change log available on the bottom of this post

Download URLs: GDrive | SF

Note: Dirty flash is unsupported for this build, please make a clean flash

Enjoy!
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    May 09th 2023 Release

    Change log:
    - Fetch latest Device Tree sources:
    -- sepolicy: Silence tracingproxy_service neverallow denial
    -- sepolicy: Allow system_app to access storaged via IPC
    - Sync latest LOS source
    - Merge April security patch

    Download URLs: GDrive | SF

    Notes:
    - Magisk v26.x can be flashed through TWRP as usual, and IFAIK it works even without the "additional setup", so you can ignore it (trying to install Magisk via its app doesn't work, it keeps flashing boot image indefinitely)
    - If clean flashing from other ROM or previous android versions, a format data might be required
    - Starting from this release, only the most updated build will be available on Google Drive (due to storage limitations). Source Forge will remain normal, so if you need a past build, refer to the URL from first post, thanks for understanding.

    Enjoy!

    May 09th 2023 Release

    Change log:
    - Fetch latest Device Tree sources:
    -- sepolicy: Silence tracingproxy_service neverallow denial
    -- sepolicy: Allow system_app to access storaged via IPC
    - Sync latest LOS source
    - Merge April security patch

    Download URLs: GDrive | SF

    Notes:
    - Magisk v26.x can be flashed through TWRP as usual, and IFAIK it works even without the "additional setup", so you can ignore it (trying to install Magisk via its app doesn't work, it keeps flashing boot image indefinitely)
    - If clean flashing from other ROM or previous android versions, a format data might be required
    - Starting from this release, only the most updated build will be available on Google Drive (due to storage limitations). Source Forge will remain normal, so if you need a past build, refer to the URL from first post, thanks for understanding.

    Enjoy!
    Hi @leo_97 , big thank you as usual :)
    NB : The changelog is from april build

    Can we flash to this build from previous (April) build rooted with Magisk 26.1 and encrypted (19-20230419-UNOFFICIAL-kuntao) ? 🫣
    1
    Hi @leo_97 , big thank you as usual :)
    NB : The changelog is from april build
    Thanks for pointing it out, just updated it :)
    Can we flash to this build from previous (April) build rooted with Magisk 26.1 and encrypted (19-20230419-UNOFFICIAL-kuntao) ? 🫣
    Yes, I did it myself and it worked fine. But remember, it's always a good idea to have a backup, just in case.
  • 7
    nJd0Bg.png

    Code:
    #include <std_disclaimer.h>
    *
    * Your warranty is now void.
    *
    * I am not responsible for bricked devices, dead SD cards,
    * thermonuclear war, or you getting fired because the alarm app failed. Please
    * do some research if you have any concerns about features included in this ROM
    * before flashing it! YOU are choosing to make these modifications, and if
    * you point the finger at me for messing up your device, I will laugh at you.
    *

    LineageOS is a free, community built, aftermarket firmware distribution of Android 12L (Sv2), which is designed to increase performance and reliability over stock Android for your device.

    LineageOS is based on the Android Open Source Project with extra contributions from many people within the Android community. It can be used without any need to have any Google application installed. Linked below is a package that has come from another Android project that restore the Google parts. LineageOS does still include various hardware-specific code, which is also slowly being open-sourced anyway.

    All the source code for LineageOS is available in the LineageOS Githup repo. And if you would like to contribute to LineageOS, please visit out Gerrit Code Review.

    Installation:
    If you are on stock OS, you need a custom recovery first. You can get the recommended LineageOS recovery in the official installation instructions link below.
    You can use TWRP for installation, however it is no longer officially supported since we do not have full control of its update cycle and potential issues.

    If you are coming from stock or other ROMs, you need to make a factory reset.
    As always, make sure to backup before installing this ROM.

    Installation Instructions:
    Backup your data and see the next post below

    Recommended TWRP Image:
    twrp-3.7.0_9-0-kuntao.img

    ROM Download Links:
    Google Drive | SourceForge

    Recommended Google Apps Package:
    NikGapps-core-12.1
    NikGapps-SetupWizard
    NikGapps-AndroidAuto
    Or
    MindTheGapps-12.1 (Google Drive mirror)

    Root Access:
    Magisk v25.2 (more stable experience)
    Magisk v26.1 (more updated build)

    Recommended Useful Add-on:
    p2oggle-1.2

    Source Code:
    https://github.com/LineageOS

    ROM Firmware Required:
    Any version of stock 6.0. Recommended P2a42_S251_171107_ROW

    Acknowledgements:
    Thanks to @mikeioannina for his hard work regarding kuntao and to all other Lineage OS developers
    Special thanks to @Astridxx for the device tree sources and for helping me out and to @en666 for early testing the initial build

    Important Notes:
    As you can see from my profile, I'm not an experienced developer. I've made some builds as a considerable amount of users showed interest in having their devices updated with latest LineageOS code. Therefore, my main objective here is to bring the latest Android security patches to kuntao making monthly builds.
    To be clear, I'm more in a situation of "user became builder" than of "ROM developer". Please, understand this.

    Long live to our beloved kuntao!

    XDA:DevDB Information
    [ROM][12.1][UNOFFICIAL] LineageOS 19.1 for Lenovo P2

    Contributors
    @Astridxx ,@XiaoAk ,@Sohit5s, @mikeioannina
    ROM OS Version: 12.x
    ROM Kernel: Linux 3.18.x
    Based On: LineageOS

    Version Information
    Status:
    Stable

    Created 2023-02-22
    Last Updated 2023-05-09
    6
    Installation Instructions

    Remember, making a backup of your data before proceeding is recommended

    If you are coming from Stock ROM, please refer first to the instructions below:
    Install LineageOS on kuntao

    If you are coming from astridxx previous build (aka lineage-19.1-20220822-UNOFFICIAL-kuntao) or my initial build (aka lineage-19.1-20230222-UNOFFICIAL-kuntao) or any version of LOS18.1 or below, you must perform a clean flash. Clean flash instructions:

    0- Make a backup (optional, but recommended)
    1- Reboot to recovery
    2- Format data (will delete all your data!)
    3- Reboot to recovery again
    4- Wipe > Advanced Wipe:
    - Dalvik
    - System
    - Vendor
    - Data
    - Cache
    - Internal Storage (optional, but recommended)
    5- Flash ROM ZIP, Gapps, Gapps add-ons, Magisk add-on, etc
    6- Reboot to system
    7- Wait until it boots for the first time (may take some minutes)

    Update Instructions

    NOTE: Dirty flash from any of the aforementioned builds is not supported, device trees were changed. You have been warned!

    For updating from one of my builds to another (aka dirty flashing), please do the following:
    1- Download ROM ZIP and copy it to the phone
    2- Reboot to recovery
    3- Flash ROM ZIP
    4- Clean cache
    5- Reboot to system
    6
    April 09th 2023 Release

    Change log:
    - Fetch latest Device Tree sources (lots of changes)
    - Update LOS components:
    -- lineage: Track the FMRadio App and dependencies
    - Sync latest LOS source
    - Many more changes
    Full change log available on the bottom of this post

    Download URLs: GDrive | SF

    Note: Dirty flash is unsupported for this build, please make a clean flash

    Enjoy!
    5
    Known Issues
    - Storage encryption is partially broken (if your /data partition is unencrypted, trying to encrypt it using ROM menu will result in a dead OS; if already encrypted, storage encryption may or may not work. IFAIK, it's a kernel side issue)
    - Device may not go to deep sleep
    - Storage forceencrypt flag is disabled (to encrypt /data partition follow the instructions below)
    - TWRP backups are broken (read notes below)
    - You tell

    Google Play Store Update Bug

    If Google Play Store app keeps failing to find updates for apps with message "Something went wrong. Try again.", just clear its data and then it should work again

    SafetyNet Check Fails

    If your device is rooted, please, follow the instructions contained here

    Magisk is Gone After First Boot

    Please, just reflash Magisk again (i.e. Reboot to recovery > Flash ZIP > Reboot back to system)

    How to encrypt data partition

    0- Backup your files (this process will erase everything)
    1- Boot to TWRP recovery
    1.1- Wipe > Format data > Reboot to system
    2- Settings menu > Security > Encryption & credentials > Encrypt phone
    3- Reboot to system again

    Error restoring TWRP system backups

    It looks like TWRP backups are broken for now, so please, if this is a must have for you, you can try to install OrangeFox recovey and follow these instructions (thanks @Zdeslav for that)

    ROM Change logs

    Code:
    02/22/2023
    - Initial release
    
    02/27/2023
    - Sync latest LOS sources
    - Device Tree change: Use old A12L dt instead of los
    - Add Lenovo Parts menu (fp gestures, USB fast charge, in-call audio gain, screen kcal)
    - Updates phone vibration strength
    - Add fix to device deep sleep issue
    - Many more changes
    
    03/29/2023
    - Fetch latest Device Tree sources
    -- vendorsetup.sh: Add Trebuchet patch
    -- AOSP WFD doesn't support protected Wi-Fi Display buffers
    -- Overlays:
    --- Enable voWIFI support
    --- Disable IMS features for Turkiye networks
    -- Don't warn user about FC in Vanced microG
    -- DT rootdir:
    --- Add cpuset for the camera daemon
    --- Remove permission restrictions to the socket file
    --- Restore iio sensor device6 on boot
    -- Bump graphene camera version to 60
    -- Don't force enable ims features
    -- sepolicy: Address sensor hal denials
    - Update LOS components
    -- Manifest: Sync x86_64 webview prebuilts again
    -- Update zlib source
    - Sync latest LOS source
    - Merge March security patch
    
    04/09/2023
    - Fetch latest Device Tree sources
    -- Add navbar enable/disable support
    -- fs: Revert sdfat update for OTG
    -- block: Add zen io scheduler
    -- dts: Decrease BCL low battery threshold to 5%
    -- DeskClock:
    --- Wallpaper based text coloring for digital
    --- Adapt digital clocks to S style
    --- Remove night mode
    -- Trebuchet:
    --- Kill haptics in recents
    --- Make overview scrim transparent again
    -- Nfc: Fix Mifare Classic reading
    - Update LOS components:
    -- lineage: Track the FMRadio App and dependencies
    - Sync latest LOS source
    
    04/19/2023
    - Fetch latest Device Tree sources:
    -- sepolicy: Silence tracingproxy_service neverallow denial
    -- sepolicy: Allow system_app to access storaged via IPC
    - Sync latest LOS source
    - Merge April security patch
    
    05/09/2023
    - Fetch latest Device Tree sources:
    -- Bump graphene camera version to 62
    -- devicesettings: Protect broadcast to fingerprint gestures
    -- rootdir: Remove permission restrictions to the socket file
    - Sync latest LOS source
    - Merge May security patch
    5
    March 29th 2023 Release

    Changelog:
    - Fetch latest Device Tree sources
    - Update LOS components webview & zlib
    - Sync latest LOS source
    - Merge March security patch
    - Many more changes
    Full change log available on the bottom of this post

    Download URLs: GDrive | SF

    Note: Please, before flashing, carefully read the instructions from the 3rd post above to avoid breaking your system.

    Enjoy!