Problems installing Lineage OS 14.1 on Lenovo P2 (black screen/blue LED) I have a Lenovo P2 (42a) with Android 6, which I tried switching to Lineage 14.1, as my carrier hasn't provided any security/OS updates since 2016. I have previously done this with my old Motorola Moto G from Android 5.

I took a backup with adb (under linux mint), using the -system and -all options.

I unlocked the bootloader.

I flashed/booted TWRP 3.2.1.0 for this phone ("kuntao").

I transferred zip files. At one point the phone switched off while transferring with TWRP having mounted the "Internal Storage" partition, but it appears I got all things over on second attempt. It seems that sometimes TWRP gets stuck if the screen switches off while it is doing something, but the timeout can be increased if that is really the case.

I flashed the Lineage OS 14.1 file for the P2 ("kuntao").

I tried flashing the stock GApps zip, it let me know this was the version for 14.0 and I needed a different GApps file.

I then started over, flashing the Lineage OS 14.1 file and the GApps zip for 14.1 (Android 7.1).
This would stop in various places, at least 3 different ones. 

I then started over with the Lineage OS 14.1 file and the micro GApps zip for 14.1.

This completed, but when booting I get a black screen, a single long vibration and a continuously blue LED.
The phone cannot switch off, only restart into bootloader or recovery, which at least isn't the worst news.

My adb backup does not restore - if I try this under TWRP, it seems to react to it, but get stuck, although with the screen on. When the command line process finishes, the result is the same as above.

Only issue I know of is that the provider can have added a few features, so that the flashing of the 14.1 file doesn't work exactly as intended. That would mean I need a complete image for Lineage OS or an image to restore to the "standard" Lenovo P2 state, as indicated here and here.

Any good ideas/procedures? Thank you.
OK, fixed - in the end I did this:

Tried "flashback" to stock android 6 with this zip file.

That didn't just work, so I tried with the automated script "flashall" in the zip.

That failed for the partition/image prov/prov32.mbn with the error message:
FAILED (remote: Do not allow to flash Bootloader image on Unlock device)

I then went into the 
PRODUCT_CONFIGURATION_KUNTAO_ROW.xml file and looked at the command list.

I then executed all remaining steps except the ones to delete partitions, for instance

&lt;KUNTAO_ROW_IFLASH&gt;
...
&lt;step operation="flash" filename="prov32.mbn" partition="prov"/&gt;
(first failure in script)

&lt;step operation="flash" filename="sbl1.mbn" partition="sbl1"/&gt;


became


  fastboot flash sbl1 sbl1.mbn (failed with same error)


&lt;step operation="flash" filename="sbl1.mbn" partition="sbl1bak"/&gt;


became


  fastboot flash sbl1bak sbl1.mbn (worked)


and so on all the way through, but skipping the instructions to erase (although I would have done it if the phone didn't start up). It did and I now have ROW (Rest Of World or normal) firmware rather than a carrier-specific version blocking OTA updates due to compatibility with one of their own apps.

I could then pick up a series of normal OTA updates from Lenovo, including Android 7, so I now don't need Lineage OS to get an upgrade for this device (at least not before they do an official Android 8 ROM for it :) ).

&lt;step operation="flash" filename="rpm.mbn" partition="rpm"/&gt; - didn't work
&lt;step operation="flash" filename="rpm.mbn" partition="rpmbak"/&gt;
&lt;step operation="flash" filename="devcfg.mbn" partition="devcfg"/&gt; - didn't work
&lt;step operation="flash" filename="devcfg.mbn" partition="devcfgbak"/&gt;
&lt;step operation="flash" filename="lksecapp.mbn" partition="lksecapp"/&gt;
&lt;step operation="flash" filename="lksecapp.mbn" partition="lksecappbak"/&gt;
&lt;step operation="flash" filename="tz.mbn" partition="tz"/&gt; - didn't work
&lt;step operation="flash" filename="tz.mbn" partition="tzbak"/&gt;
&lt;step operation="flash" filename="keymaster.mbn" partition="keymaster"/&gt; - didn't work
&lt;step operation="flash" filename="cmnlib.mbn" partition="cmnlib"/&gt; - didn't work
&lt;step operation="flash" filename="cmnlib.mbn" partition="cmnlibbak"/&gt;
&lt;step operation="flash" filename="cmnlib64.mbn" partition="cmnlib64"/&gt; - didn't work
&lt;step operation="flash" filename="cmnlib64.mbn" partition="cmnlib64bak"/&gt;
&lt;step operation="flash" filename="emmc_appsboot.mbn" partition="aboot"/&gt; - didn't work
&lt;step operation="flash" filename="emmc_appsboot.mbn" partition="abootbak"/&gt;
&lt;step operation="flash" filename="logo.bin" partition="logo"/&gt;
&lt;step operation="flash" filename="NON-HLOS.bin" partition="modem"/&gt; - didn't work
&lt;step operation="flash" filename="fsg.mbn" partition="fsg"/&gt;
&lt;step operation="erase" partition="modemst1"/&gt; - skipped
&lt;step operation="erase" partition="modemst2"/&gt; - skipped
&lt;step operation="flash" filename="adspso.bin" partition="dsp"/&gt;
&lt;step operation="flash" filename="boot.img" partition="boot"/&gt;
&lt;step operation="flash" filename="recovery.img" partition="recovery"/&gt;
&lt;step operation="flash" filename="systemchunk0.img" partition="system"/&gt;
&lt;step operation="flash" filename="systemchunk1.img" partition="system"/&gt;
&lt;step operation="flash" filename="systemchunk2.img" partition="system"/&gt;
&lt;step operation="flash" filename="systemchunk3.img" partition="system"/&gt;
&lt;step operation="flash" filename="systemchunk4.img" partition="system"/&gt;
&lt;step operation="flash" filename="systemchunk5.img" partition="system"/&gt;
&lt;step operation="flash" filename="systemchunk6.img" partition="system"/&gt;
&lt;step operation="flash" filename="systemchunk7.img" partition="system"/&gt;
&lt;step operation="flash" filename="systemchunk8.img" partition="system"/&gt;
&lt;step operation="flash" filename="systemchunk9.img" partition="system"/&gt;
&lt;step operation="flash" filename="systemchunk10.img" partition="system"/&gt;
&lt;step operation="flash" filename="systemchunk11.img" partition="system"/&gt;
&lt;step operation="flash" filename="systemchunk12.img" partition="system"/&gt;
&lt;step operation="flash" filename="cache.img" partition="cache"/&gt;
&lt;step operation="erase" partition="userdata"/&gt; - skipped
&lt;step var="config bootmode factory" operation="oem"/&gt; - skipped


EDIT: On the plus side, I just got the newly released Lineage 15.1 ROM to work for this phone.