This blog is about anything technically opensource or copyleft-ed/ GPL-ed, obviously most of it Linux or connected to Linux in some way.

Sunday, September 1, 2019

Lineage 15.1 on Redmi 5

Xiaomi Redmi 5 called Rosy recently had a MIUI update that slowed it down further more. Congratulations MI, you lasted more than a year on my phone. Last phone MIUI lasted 3 months into the warranty, before I replaced it with Cynogen Mod (CM). Although, unfortunately, CM died down, Lineage continued where they left off. Lineage has no official release for Redmi 5, but an unofficial 15.1 can be downloaded from here. For gapps, prefer pico for 8.1 and then download whatever else you need from Google Playstore once installed.

Details follow. Remember that all this is risky and you can brick your phone:

  • Unlock Redmi 5
    • Enable USB debugging
      • Go to phone settings -> about phone -> click on build number continuously 7-8 times to enable additional settings.
      • Go back and go to additional settings and activate USB debugging.
    • Apply for unlocking the phone on MI website or using the Windows tool
    • If you choose the latter, make sure that the tool is unzipped in C: root or C:\Program Files. Else you will spend an eternity without getting the "Unlock button" to turn active, troubleshooting your drivers and USB cable! 
    • Run the same, unlock, confirm unlock and wait for 72 hours at least for MI to approve unlocking! 
    • Back up phone completely as unlocking it will delete all your data!!
    • After 72 hours at least, repeat the unlock run and hopefully it will be successful. If so... proceed.
  • Download Lineage 15.1 ROM img and whichever gapps zip you prefer from above link.
  • Download latest TWRP here.
  • Download SuperSU to root your phone here.
  • Copy all of the above downloaded images and zips onto a USB pendrive and keep an OTG cable ready as USB mount has trouble at times on TWRP. It didn't work at all for me!
  • Download and setup adb (I found Redmi driver on Windows a pain to get to work. Try everything available online including universal and naked drivers).
  • Repeat the process of activating USB debugging listed at the very beginning.
  • Install TWRP
    • Copy TWRP img file in adb folder. 
    • Open command line there by clicking Ctrl+Shift+mouse right click.
    • Connect phone to PC USB through the data cable.
    • Run: adb reboot bootloader. If this doesn't work, power off the phone and once off, keep Power up +Volume down pressed together till fastboot mode shows up on screen.
    • Run: adb devices OR fastboot devices to ensure that it lists your phone.
    • Run: flashboot flash recovery recovery-xxx-xxx.img to flash the TWRP image where xxx-xxx are the version identifiers.
    • Run: flashboot boot recovery-xxx-xxx.img to get into TWRP mode.
  • Mount OTG.
  • Wipe cache (and preferably more).
  • Install -> image -> select downloaded TWRP image. This is with the hope that MI protection doesn't replace TWRP with fastboot. Mostly it will nonetheless and you will need the above commands to reenter TWRP mode!!
  • Install -> zip -> select downloaded lineage 15.1 zip.
  • Wipe cache (and preferably more).
  • Install -> zip -> select downloaded gapps.
  • Reboot system into Lineage 15.1.

Followers