Jack Moore

Email: jack(at)jmoore53.com
Project Updates

LineageOS on Nokia 7.1

12 Jan 2022 » system configuration, configuration, mobile, lineage

I’ve been fascinated with mobile open source computing lately and wanted to revisit installing lineage on a nokia7.1 I picked up sometime in 2019.

Back in 2019 there wasn’t a way to unlock the bootloader, and up until mid december 2021 there really wasn’t a way to unlock it. This post goes into how I unlocked the phone’s bootloader, and installed lineageOS with SU

Unlocking the Bootloader

Well, unfortunately there wasn’t much I could do on this one.

I was stuck for a while (nearly 2 years) and the fix I used wasn’t great. (I’m not too proud of how I fixed the issue.)

I ended up using a windows VM (because wine didn’t work) to unlock the bootloader. I had to install .NET>4.7.2, and some other jazz I wasn’t too thrilled about installing.

The presteps look like the following:

  1. Within Settings Tap build version of the phone 7 times to enable developer mode
  2. Within developer settings, enable debugging mode and allow oem unlocking

I followed this guide on unlocking the bootloader (Steps as follow):

  1. Download and Install Nokia USB Drivers
  2. Download Nokia Bootloader Unlock Tool
  3. Reboot the phone into bootloader (fastboot) mode:
  4. Generate OTP for the Unlock Tool
  5. Run the Unlock Tool and Unlock your phone

From here the phone was unlocked which is exactly what I needed. This was by far the hardest step, and I still haven’t seen what the executable does in the backend so until there is an official bootloader release I am on the fense with this guide. (It’s the best option right now for my hardware.)

Post unlock

Back in Linux, after the phone was unlocked I used adb to boot to the bootloader with the following:

# Note I have adb installed on linux as well
adb reboot bootloader

For the Nokia 7.1 this basically showed the android one page with the words “Download Mode” in the top left.

From here I knew I was in the recovery/bootloader mode and was able to use fastboot to load in images..

First I checked out the status of the oem unlock with fastboot oem device-info which listed out a bit of debugging info that was helpful (expecially the status of the device if it was locked or unlocked).

Once I saw the device was unlocked, I knew I would be able to push boot images to the device.

Specifically I pushed the twrp 3.6.0 image to the device with the following command:

# Fastboot install you may need to use boot_a or boot_b because there are two boot partitions
# Note twrp.img is what I renamed the img to before booting it
fastboot boot twrp.img

# Also available is setting twrp for recovery, but this didnt work for me :(
# I likely needed to set the recovery partition where I needed it to go
fastboot recovery twrp.img

In TWRP

First thing I did was factory reset from TRWP. I needed the blank slate. I wiped everything. Then I rebooted to twrp again, follow the same steps above to get back into twrp.

After booting to twrp there are a few guides on copying over zip files, but basically I copied over via adb push the lineageOS, su, and su for root access:

# Note the location, /sdcard is just the default where data goes
abd push ./lineage-os.zip /sdcard
adb push ./SR5-su-package.zip /sdcard

Once these were in twrp and visible tap install, pick the two files from the default location (in my case /sdcard). Reboot the device.

If you think you bricked it you likely just are booting from boot_a, and the OS is installed on boot_b.

To fix this, use fastboot to twrp and re-install the OS on the correct boot device.

I also think there is an option to boot with fastboot to the boot device which should also fix the problem as well.

© Jack Moore - This site was last built Fri 30 Aug 2024 12:31:24 PM EDT