Installing Lineage OS on a Moto G3 / ‘osprey’

Looks like LineageOS17/Android10 is now available.

I’ve since managed to follow my own instructions doing the same on a G4 (XT1685). To get the model name:

> adb.exe shell getprop ro.product.model

The idea is to install the phone in the car with an ELM327, have it turn on and off with the ignition, and run Torque to show, for example, a boost gauge. (I am not capable of installing a normal boost gauge.)

Usual warning: you will brick your phone if you follow these instructions.
Better believe it: I did brick a Lenovo A7600-F trying to install TWRP.

1: Unlock the bootloader

First install the USB drivers.

Next, install abd and fastboot. In settings on the phone tap the version number 7 times to enable the settings settings page, then in the developer settings turn on USB debugging.

Instructions from Motorola on how to unlock the bootloader.

Even though adb.exe devices listed no devices, fastboot oem get_unlock_code still worked.

Changing the USB driver to the Google one and starting the phone into download mode fixed waiting for any device. This required installing the Android SDK — which I had anyway becuase I have AndroidStudio installed.

2: Install TWRP

We want TWRP for Moto G3 (osprey). Don't choose the wrong image because it will brick your phone.

Use the fastboot method because it does not require root.

Note: moto CT1072 is thea and not titan.

So:

C:\adb>fastboot.exe flash recovery twrp-3.2.3-0-osprey.img
(bootloader) has-slot:recovery: not found
Sending 'recovery' (7424 KB)                       OKAY [  0.782s]
Writing 'recovery'                                 OKAY [  0.409s]
Finished. Total time: 1.691s

C:\adb>fastboot.exe reboot
Rebooting
Finished. Total time: 0.007s

Did that work? Agonisingly long wait on the unlocked bootloader warning, but the phone restarted OK. Phew. The phone is factory reset.

3: Backup

Reboot into fastbook again (volume down + power) and go into recovery.

Got the dead android therefore flashed TWRP again. Power down and try again, TWRP now worked.

Yeah, whatever.
No, really. Remember I bricked that Lenovo tablet?

Reboot and copy off the backup.

There was no file in TWRP/Backup. Did the backup again, still nothing there. Rebooted into recovery, found that I could mount the internal storage as USB. The backup folder then showed up.

4: Remove the unlocked bootloader message

This appears to be setting a cusotom boot image. I'll come back to this; I want a Peugeot logo for the car.

Here are some boot logos. It is unclear what to do with the zip files.

5: Installing LineageOS

Download and install LineageOS.

C:\adb>adb.exe push MotoG3\lineage-14.1-20180818-nightly-osprey-signed.zip /sdcard/

Then install. Do not reboot.

5.1: Error 7 / E1001 on Moto G2 (2014) XT1072 thea

All the ROMs I tried simply refused to flash, except aokp which would flash sometimes. Purely by chance I found that if I wipe, then reboot then sideload it seems to work.

6: Install Google apps

Probably entirely pointless for this application, but I thought I'd better do it anyway just in case.

Note: ARM and not ARM64.

Do not install the stock version on Lineage17 / Android 10 because it maked the phone unusably slow. The pico package is OK, or if you don’t need anything Google then you could use use Aptoide to get apps instead.

C:\adb>adb.exe push MotoG3\open_gapps-arm-7.1-nano-20180821.zip /sdcard/

Then install. Do not reboot.

7: Root

Lineage has dropped addonsu for version 17. Instead use Magisk: install the APK, use the app to download the ZIP, then go into TWRP and install it and the phone will hang.
Finally got it by: install Lineage and GApps, reboot, install Magisk app, connect to wifi, use Magisk app to get installer zip, install from TWRP, do not let TWRP install itself, reboot.

C:\adb>adb.exe push MotoG3\addonsu-14.1-arm-signed.zip /sdcard/

Then install. Now reboot.

To get root to work you have to turn on developer options again and turn root in in there.

8: Startup on USB power connect

Vid

Enter fastboot and connect USB.

fastboot.exe oem off-mode-charge 0

9: Shutdown on USB power disconnect

Use MacroDroid; it can also start an app on startup.

There are two shutdown actions, and only one of them works for me.

10: Other settings

11: Installation

11: splash logo

I took a screenshot to find the screen size: 720 × 1280. The file format is bmp. Yes, really.

There is a Windows app for making boot logo zips. However, flashing via TWRP doesn't work -- there seems to be a bug in the flash script it writes. However, if you extract logo.bin from the .zip file then you can flash it like this.

C:\adb>fastboot.exe flash logo MotoG3\logo.bin
(bootloader) has-slot:logo: not found
Sending 'logo' (818 KB)                            OKAY [  0.084s]
Writing 'logo'                                     OKAY [  0.266s]
Finished. Total time: 0.420s
I opened an existing logo .zip and replaced the two startup images with my own.

12: Set default screen rotation

Do not set ro.sf.hwrotation=90 in /system/build.prop! It changes the screen but not the touch input.

This, however, may work:

adb.exe shell settings put system user_rotation 1

Finished

Vid.

Wallpaper

When you rotate the phone Android messes up the wallpaper trying to rotate that too. Create a landscape wallpaper, but the phone into landscape, and set the wallaper; then it will look as required in landscape and messed up in portrait.


Home | More stuff | Octad of the week