[LG G5 ROMs, Kernels, Recoveries, & Other Developme] pedro1977:
Note: If you're only having problems with the camera/flash (esp. after flashing an 17.1 Official OTA update), then reboot you're phone and test again. If it's still not working after a couple of reboots then without the charging cable plugged in, shut down the phone and then power on the phone. If after trying this a few times it still doesn't work, you'll need to read the following notes. I recommend you read the entire post before proceeding to ensure you begin at the correct point.

These instructions are for those who are having issues with the camera/ flash, torch, sensors (esp. proximity sensor - use androsensor to test these), bluetooth, WiFi, NFC, auto rotate, GPS and possibly others not working after flashing 16.0 or 17.1 unofficial/ official. Anyone coming from stock or wishing to upgrade to 17.1 official from 15.1, 16.0, or 17.1 unofficial should also follow these instructions to avoid these bugs. If you're experiencing issues with the proximity sensor, first ensure the area above the screen is clean before testing. Also remember that applying screen protectors/ tempered glass may interfere with it's operation too.

Also note these instructions apply to Resurrection Remix flashes too. If you've flashed them before, you shouldn't have to flash the LOS equivalent again.

LOS 15.1 = RR 6 (Android 8)

LOS 16.0 = RR 7 (Android 9)

For example: if you flashed RR 6 and then RR 7 without bugs you can safely clean flash LOS 17.1 Official from second line below.

If you're coming from fulmics and experience boot loops after flashing an LOS rom you may have to flash an Android 7 stock bootloader to resolve.

Ensure you have flashed the latest twrp version before proceeding (3.4.0-1 at time of writing).

If appropriate, backup any important data first using twrp. If you haven't previously, create an individual backup of the EFS and Misc partitions with twrp before flashing anything, as some have previously had corruption of these partitions when flashing LOS roms, and they are troublesome to recover. When creating a twrp backup of the data partition, if you're going to encrypt your backup, ensure you have removed all device protections like pin, fingerprint, pattern etc. These are mutually exclusive, it's one or the other but not both. If you don't, your pin will not work upon restoring your backup and you will have to reset your phone with all your data lost.

Although Google's backup and restore is usually sufficient, if you wish to backup/ restore individual apps, data, permissions and settings, you can use an app like migrate. I recommend only backing up/ restoring apps (apks) as restoring anything else across different android revisions may generate bugs.

NOTE: Ensure when you migrate from stock to LOS it is from Android 7 (not 6 or 8) to ensure you have the correct baseband/ modem installed.

_________________________________________________________

For those coming from stock or have previously skipped flashing LOS 15.1 and or 16.0 (with or without bugs) at some point after coming from stock should follow the instructions from here. Everyone else skip to the line.

First clean flash 15.1:

Wipe: Delvik/ ART cache, System, Data, Cache

Then install/ flash 15.1

At this point, there's no need to flash gapps or magisk manager. These are optionally flashed after 17.1 - we'll revisit this later.

Reboot to system, skip setup and test everything mentioned in paragraph 2. (If there are bugs at this stage, you will more than likely have to flash back to stock, test again and if everything works reflash 15.1 again. When flashing stock, ensure you flash the correct build for your model otherwise you may hard brick your device)

If there's no bugs, then dirty flash 16.0:

Wipe Delvik/ ART cache, System, cache

Flash to_x86cpu.zip and then reboot to recovery.

Then flash/ install 16.0.

Reboot to system, skip setup and test everything again, if all is still working; skip the next paragraph and clean flash 17.1 official as described.

_______________________________________________________

Anyone who has completed the steps above previously (at any point after flashing from stock) and is on:

17.1 unofficial or official (esp. after dirty flashing) with 1 or more of the bugs in paragraph 2

Or

17.1 unofficial without bugs and wishes to upgrade to 17.1 official,

will all need to clean flash 17.1 official by following these instructions.

Wipe system & data.

Install/ flash latest, nightly official 17.1.

Wipe cache/ delvik again (the option should be there at bottom after it has flashed)

Install/ flash latest stable magisk (optional but recommended for root)

Install/ flash gapps (optional but recommend arm64, 10, nano - or Pico for those wishing to use Google family link),

Reboot to system, complete setup, and test everything again.

If you flashed magisk and its not in your app drawer, Install the latest magisk manager apk.

After completing this, if the camera/ flash doesn't work on boot or at any point; reboot the phone and test again, if necessary repeat this a few times. If it still doesn't work, without the charger plugged in, shut down and then power on the phone, if necessary try this a few times too. This advice also applies when the camera doesn't work after an OTA update as mentioned previously. Sometimes this process will resolve some of the other issues indicated in paragraph 2 too.

Note (Setup):

Device Protection (Pin, pattern, fingerprint etc)

When prompted to setup a pin, skip this and create one via settings after boot, as the phone may lock up. If you try to create one and the phone freezes, upon rebooting there may still be no pin prompt. When trying to create one after this, you may be asked for a pin but the pin you entered during setup will not be accepted.

To correct this bug, install and open the app find my device, login with your account, select secure device, then enter your preferred numerical pin. After this, you can enter settings to add a fingerprint etc. You can also use this method to setup a pin without using setup or via settings.

Voice Match (Google Assistant)

As there are bugs, Voice Match (Google Assistant) is disabled at the moment. If you come to Voice Match (Google Assistant) during setup (all Gapps flashes except Pico), you won't be able to continue. At this point you will have to go back to the WiFi screen, disconnect WiFi etc and skip the connection/ adding Google account which you've added on the first pass. Eventually you'll come to a lineage os screen with the option to help lineage, continue from there. Sometimes you may have to go back and forth several times before it appears.

Edit: in the latest versions of Gapps you may be able to complete setup of voice match but it will still be disabled.

Battery Calibration.

After setting up you may want to use a battery calibration app to reset your battery stats. You can also use this app if your battery is reaching around 20% battery and switching off. If it still doesn't work after calibrating your battery, it's usually time for a new battery.

https://play.google.com/store/apps/details?id=eu.roggstar.batterycalibrator

This allegedly repairs your battery.

https://play.google.com/store/apps/details?id=com.batterypro.batteryrepairlife2020

Replacement batteries

UK

https://www.amazon.co.uk/dp/B07TF4GMF3/ref=cm_sw_r_other_apa_i_nDl5Eb4E54R64

https://www.amazon.co.uk/dp/B07BVWFXVX/ref=cm_sw_r_other_apa_i_QEl5EbX5R0795

USA

https://www.amazon.com/dp/B07RYM9MPJ/ref=cm_sw_r_cp_awdb_btf_t1_s9cHFb9BY3WDP

A highly reliable app for testing the actual capacity of your battery - Accubattery.

https://play.google.com/store/apps/details?id=com.digibites.accubattery

Play Store Certification / Safetynet

To pass safetynet in Magisk Manager and device certification in play store.

1. Ensure you have Magisk 20.4 flashed and magisk manager installed on your device.

2. Within magisk, under downloads, search for and install the "Busybox for Android NDK" magisk module by osm0sis.

Click the back arrow instead of reboot then:

3. Download and manually install the safety patch v3 module from within magisk.

https://mega.nz/file/wwgVSRZC#rlI3D27s3xIKj13pQNBbwPvgV_l3UkRe2vgCRDyBCwA

Reboot

4. Install and use a root enabled file explorer app i.e. mix explorer, root explorer, es file explorer to open the following file:

data/adb/module/safety patcher/post-fs-data.sh

delete line 11

mount -o bind /data/local/tmp/cmdline /proc/cmdline

Save it, then reboot.

Open Magisk manager and click on safetynet check to see if it passes. If safetynet check fails, try enabling Magisk hide in Magisk manager settings, you may have to reboot, before testing again.

Also check the play store app to see if the device is certified (settings, last line). If not you may have to force close the play store, clear it's data/ cache and reopen it before it will become certified.

Debloating

it isn't possible to uninstall a system app in android 10, however you can try the following.

1. Freeze the app with the app link2sd, this will disable/ hide it.

2. Use a root explorer app like mixplorer, navigate to system/priv-app and delete the folder of the app you wish to uninstall, reboot.

https://xdaforums.com/showthread.php?t=1523691&p=23109280

3. Another option is to use the Magisk modules: App systemizer or app debloater.

Never used them, they may just disable/ hide them rather then uninstalling them.

Android Encryption

Do not use android encryption, there is no TWRP encryption support for LOS 17.1. Although you can enable and successfully encrypt this rom, upon entering TWRP you will be asked for a password to access the data partition, but none will work. Therefore, you won't be able to create backups; or apply OTA updates either as they're stored on the data partition. To resolve this, you'll have to wipe the data partition (aka. factory reset the phone), therefore losing all your data. Upgrading an encrypted 16.0 to 17.1 will also not work.

Note: You can enable encryption if you use the LOS recovery, but there's no backup facility. You can also flash OTA updates.

https://twrp.me/faq/encryptionsupport.html

Not working (and probably never will)

WiFi calling, VOLTE, Radio, 5ghz Hotspot, project treble, usb-c to HDMI and anything else that has been missing from all the previous LOS versions will most likely never be fixed due to kernel/ LG proprietary code issues etc. Therefore there's little reason to ask about them or their progress in this thread.

Downloads

TWRP Download

https://twrp.me/Devices/LG/

If you download any of the following files, copy them to your internal memory or SD card and flash via TWRP.

Unofficial 15.1, 16.0 ROM.zip/ to-x86cpu.zip

https://drive.google.com/drive/mobile/folders/0B51rjK5Hd_P5NmpwY1o4VmlyaUk

Official 17.1 Rom (Nightly)/ change log, previous builds (select model no.)

https://download.lineageos.org/

After first nightly flash, use LOS updater thereafter.

Opengapps

Always flash these, before booting, after flashing Lineage OS as per the instructions in the installation section of this article:

https://wiki.lineageos.org/gapps.html

ARM64, 10.0, Nano (recommended)

https://opengapps.org/?arch=arm64&api=10.0&variant=nano

ARM64, 10.0, Pico (Recommended for Google Family Link)

https://opengapps.org/?arch=arm64&api=10.0&variant=pico

Magisk (.zip)/ Magisk Manager (APK) - Root manager.

https://github.com/topjohnwu/Magisk/releases

H850 Europe Stock Inc. Flashable bootloader, baseband/ modem.

https://xdaforums.com/lg-g5/development/stock-h850-20v-eu-rom-flashable-zips-kdz-t3788620/amp/

H830 USA Stock Inc. Flashable bootloader, baseband/ modem.

https://xdaforums.com/tmobile-lg-g5/development/stock-h830-20a-rom-flashable-zips-imgs-t3511294

RS988 USA Stock Inc. Flashable bootloader, baseband/ modem.

https://xdaforums.com/lg-g5/development/stock-21c-roms-flashable-zips-imgs-t3679907

Other

LOS Server Status

https://status.lineageos.org/