Nexus 4 / Nexus 7 CrossUpgrade from Cyanogenmod to Lineage OS

EDIT: Experimental Builds were deleted now, as initial stated by LineageOS Team in this post. CrossUpgrade is not possible anymore, best bet would be to wipe the device and start from scratch. So just skip the second step with EXP Image and WIPE EVERYTHING in TWRP and install the latest nightly. Please also stay alert on bugs which are included in LineageOS. This link will give you access to the unresolved section of the Nexus 4 / Mako device, while this link will give you access to the same for the Nexus 7 2013 Wifi / flo :). Also, you can find the latest changes for mako here and for flo here.

As CyanogenMod ended their services - and Lineage OS took over, we need to cross-upgrade to the new system.

0.) Basic idea:
To upgrade to Lineage OS, they setup an so called experimental image. This exp image exists soley for the reason of migrating old CM installations to LOS installations. An really ugly-nag-screen will remind you of that. So the upgrade path will be: CM -> LOS Exp -> LOS Nightly. Also, you need to upgrade to the correct version. I.e. LOS does supply Nexus 7 LOS 14.1 images, so you need to upgrade your Nexus 7 first to CM 14.1, then install the LOS Exp 14.1, then the LOS Nightly 14.1

1.) Nexus 4 (mako)
- Install latest TWRP Version: https://twrp.me/devices/lgnexus4.html
- Make sure your device is on CM 14.1, if not, upgrade via: https://download.cyanogenmod.org/?device=mako
- Download LOS 14.1 Exp and install via TWRP (clean caches!) and reboot: https://download.lineageos.org/mako
- Download LOS 14.1 Nightly and install via TWRP (clean caches!): https://download.lineageos.org/mako

2.) Nexus 7 2013 Wifi (flo)
- Install latest TWRP Version: https://twrp.me/devices/asusnexus72013wifi.html
- Make sure your device is on CM 14.1, if not, upgrade via: https://download.cyanogenmod.org/?device=flo
- Download LOS 14.1 Exp and install via TWRP (clean caches!) and reboot: https://download.lineageos.org/flo
- Download LOS 14.1 Nightly and install via TWRP (clean caches!): https://download.lineageos.org/flo

And thats it! 🙂

More Infos needed? Just check out this older blog entry - you can use 2) and 3) but please do not delete anything except caches on 3) - and you do not need to flash GAPPS - as we want to upgrade, not reinstall from scratch 🙂

Nexus 4 Upgrade to CM 14.1 / Android 7.1 Nougat + Updates

[UPDATED 10.12.2016]
A little bit problematic, but... works in the end.

Warning: Bleeding Edge!
Will bootloop, you'll need to format your phone, it will break eggs, pcs, glass and burn down your house.
Comes with no support what-so-ever from my side.
You have been warned!

1.) Get all the files
CM: https://download.cyanogenmod.org/?device=mako (Latest version was: https://download.cyanogenmod.org/get/jenkins/187896/cm-14.1-20161202-NIGHTLY-mako.zip)
GAPPS: http://opengapps.org/ (ARM, 7.1 GAPPS, Picco Version)
TWRP: https://twrp.me/devices/lgnexus4.html (Download from: https://dl.twrp.me/mako)

2.) Flash TWRP
- Press Vol Down and Power Button to shut down the Phone.
- Press Vol Down and Power Button again to boot to the Bootloader
- Upload TWRP via fastboot: fastboot flash recovery twrp.img

3.) Flash and Install
- Boot to Recovery
- Delete all Files from your Phone
- Upload CM and GAPPS file via MTP to sdcard
- Flash CM, then GAPPS
- Clean Cache

4.) "Debug"
You would get an bootloop, if you would reboot now. According to http://androidforums.com/threads/twrp-bootloop-fix-after-update-ota.922585/ you need to go to the Terminal (or adb shell) and enter following commands:
dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/fota
(enter) - and then
dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/misc
(enter)

5.) Reboot
And you're good to go. However, somehow the update functions are bricked, so... check out the forums and bug reports:

http://forum.xda-developers.com/nexus-4/orig-development/official-cyanogenmod-14-1-nexus-4-t3507532/page7
https://www.cmxlog.com/14.1/mako
https://review.cyanogenmod.org/#/c/173328/

EDIT / REGARDING UPDATES:
Updates seem to be bricked because of some error in TWRP which sends Android 7.1 into a bootloop after EVERY update. So if you're updating via regular "Fullsized Images" from get.cm, you need to run the 4th Section / Debug EVERY time you update! However, you can get around that, if you use CyanDelta Updater (https://play.google.com/store/apps/details?id=com.cyandelta). Just install CyanDelta Updater on your phone, choose your CURRENT cm.zip (i.e. the one you installed your phone with, in this tutorial the cm-14.1-20161202-NIGHTLY-mako.zip) and let it index that. After this, it will try to find newer CM versions on the net and only download the delta, i.e. the changes to your current image. This will most likely break down your new 330+ MB download to an about 40+ MB download (which is nice!) - and after that, you can just install the update via the same app (actually it will ask you, just give it root rights and let it do its job, next reboot will take a while, but it works! :)). In any case, the TWRP Bootloop problem is solved with that, update downloads are smaller and everyones happy ;).

IMPORTANT: Best strategy before attempting ANY kind of update would be to make a full backup via TWRP and move it to a secure location (i.e. your pc harddrive) in case you brick your phone and need to restore it! At least one backup after your initial install (with all apps and stuff) should be made. It makes life so much easier in case something goes wrong :).