Lineage OS 16/17/GSI Install Guide for LG G7 ULM

Search This thread

sirbow2

Senior Member
May 21, 2013
53
9
UPDATE: I kept finding bugs in josh1x's rom, so i installed the LOS17 GSI instead. Guide for that outline in reply #11

Figured this out and thought i'd write a simple tutorial that covers stock (i was at 20e) to lineage. You'll need the LG USB Drivers and adb/fastboot. There are a couple other things to download through out the tutorial and the unlock tutorial in step 1.
LG USB Drivers 4.2.0
ADB/Fastboot
LGUP with partition DL

Note: I was able to reach download mode and fastboot at any point in this process and even when it went wrong (kernel crashes, boot loops etc) while figuring out this tutorial. I found that i could just hold vol down or up in a bootloop with the usb connected to get to the mode i wanted.

Typical combos:
-Download mode: power off phone with usb disconnected. hold vol up and plug in cable
--NOTE: after wiping laf_a and boot_b, you must switch to slot b to access download mode (run command: fastboot -ab)

-fastboot: power off phone with usb disconnected, hold vol down and plug in cable. or adb reboot bootloader
--NOTE: after wiping laf_a and boot_b, you can only access fastboot from slot a by holding vol up on boot (for 20e/21d, on 11g vol down still works).

-Recovery: power off. hold power and vol down, when you see the white LG G7 logo temporarily release just the power button. Continue to hold power and vol down till you get to the option menu. Select Yes three times.

Guide:
1. Follow the universal unlock method here.

1.5. You need to zero out laf_a and boot_b before flashing 21d/20e to maintain fastboot access. Use adb to run the following commands
Code:
dd if=/dev/zero of=/dev/block/bootdevice/by-name/laf_a
dd if=/dev/zero of=/dev/block/bootdevice/by-name/boot_b

1.75. Enable usb debugging (should already be done). Open LGUP and connect to your phone. dont close it. If you open it after booting to DL mode it wont recognize it

2. 21d ULM firmware (here) must be flashed to use the latest twrp (20e works as well). The 11g twrp cannot install lineageos. I would imagine the EU firmware could be flashed as well, but I used ULM.
Code:
Boot into fastboot
fastboot -ab
Boot into download mode
Use the lg up linked in this post to flash 20e/21d without laf_a and boot_b with partition dl mode

3. Format userdata to decrpyt your file system so TWRP can access it. Then flash TWRP; boot_twrp-june.img can be found here. It's from Josh1x's post here. Note: this TWRP is non persistant.
Code:
Boot to bootloader
fastboot format userdata
fastboot flash boot_a boot_twrp-june.img 
fastboot flash boot_b boot_twrp-june.img
Select restart in fastboot 
Boot to recovery

4. Obtain the latest lineage build here. This is from Josh1x's post here. I attempted to flash gapps at this point and it failed, see the next steps.
Code:
Wipe everything
Transfer lineageos to your phone and install it
Restart normally

5. Gapps
Code:
Reboot to bootloader
fastboot flash boot_a boot_twrp-june.img 
fastboot flash boot_b boot_twrp-june.img
Reboot to recovery
Transfer opengapps 9.0 to your phone and install.
Reboot to bootloader

6. We need to flash the stock lineage boot image (here) again now that we are done. The file was obtained with this method
Code:
fastboot flash boot_a boot.img
fastboot flash boot_b boot.img
Restart normally

if you have magisk, it would be magisk_patched_boot.img (here). this one was made from the above image with magisk on my phone.
Code:
fastboot flash boot_a magisk_patched_boot.img
fastboot flash boot_b magisk_patched_boot.img
Restart normally

Any time you want to flash something via twrp you will have to flash twrp via fastboot again (hence the non persistance), do your stuff in twrp, and then reflash the boot img (it will not boot if you dont do this or use josh1x's boot file). Just like steps 5-6 for gapps.

I am so glad to be off of stock, enjoy guys and girls!

Bugs (from my ULM phone)
-flash doesnt work in the camera. also probably why gcam crashes (gcam works on an EM phone somehow)
-brightness slider is calibrated incorrectly compared to stock. way too bright when set to 0%
NOTE: using ULM vendor fixed the flash and brightness, but gcam still doesnt work. This would make it the most functional rom for this phone at this point (vibrate does work).
 
Last edited:
  • Like
Reactions: Aseiel

loonycgb2

Senior Member
Sep 3, 2010
242
107
Moto G Play
Google Pixel 6
Being that since day1 of g710pm/ulm could be boot unlocked, all ypu had to do is flash the eu firmware and go to lineage frlm there due to twrp incompatibility.

I have not tested it, but does being on lineage based off EU blobs, do you still get full LTE and/or volte.

If sprint users have switched to eu/lineage do you have full lte/ril compatibility.
 
  • Like
Reactions: sirbow2

sirbow2

Senior Member
May 21, 2013
53
9
Ah crap I didn't know that. I tried unlocking through LG when I got it a couple months ago and that didn't work of course. At that time the phone was working well (not going on a background apps killing spree), so I didn't bother. I couldn't find anything on here at the time for unlocking, but I obviously missed that.

LTE and wifi are working fine. Maybe that has something to do with me never flashing the EU rom to install lineage? Anyways, I couldn't find a volte toggle, but I'd assume it is working. I'm on Verizon and I believe they are killing their cdma network, so I'll find out.

Would this work on sprint phones? There is a warning at the end of the unlocking guide about sprint phones loosing fastboot when upgrading to ulm pie.
 

sirbow2

Senior Member
May 21, 2013
53
9
does it work for EM too ? because i dont have any boot for linage to make it boot after i flash gapps also magisk bootloops too
If it boots on the lineage bootimg before flashing twrp again for Gapps, then yes, if you get that bootimg and flash it again after using twrp it will boot again.

Though I'm not sure why josh1x's boot img wouldn't work for your phone. That's what he used on his EM model after all.
 

EmanuelCN

Senior Member
Mar 29, 2017
399
237
LG G7 ThinQ
Xiaomi Poco F3
If it boots on the lineage bootimg before flashing twrp again for Gapps, then yes, if you get that bootimg and flash it again after using twrp it will boot again.

Though I'm not sure why josh1x's boot img wouldn't work for your phone. That's what he used on his EM model after all.

nonono i meant like magisk from the stock rom it was bootlooping so that means those images works for EM model too ? (bootimg and magisk) ... also i saw a guy saying gcam works on the lineage and i installed it and didnt work it was crashing if i would install camera2 api module from magisk will it work or ?
 
Last edited:

sirbow2

Senior Member
May 21, 2013
53
9
nonono i meant like magisk from the stock rom it was bootlooping so that means those images works for EM model too ? (bootimg and magisk)
oh yea. i see, yes, they might as they are from the lineage rom.


... also i saw a guy saying gcam works on the lineage and i installed it and didnt work it was crashing if i would install camera2 api module from magisk will it work or ?
It wont let me install that camera2 module. Says incompatible device. I tried the gcam patch and that didnt work either.

Also, flash does not work properly on the included camera. It flashes for the focus, but then doesnt for actually taking the picture.
 
  • Like
Reactions: EmanuelCN

EmanuelCN

Senior Member
Mar 29, 2017
399
237
LG G7 ThinQ
Xiaomi Poco F3
oh yea. i see, yes, they might as they are from the lineage rom.



It wont let me install that camera2 module. Says incompatible device. I tried the gcam patch and that didnt work either.

Also, flash does not work properly on the included camera. It flashes for the focus, but then doesnt for actually taking the picture.

i installed everything and now gcam somehow works its perfect thank you so much i couldn't do it without your guide
 

sirbow2

Senior Member
May 21, 2013
53
9
nonono i meant like magisk from the stock rom it was bootlooping so that means those images works for EM model too ? (bootimg and magisk) ... also i saw a guy saying gcam works on the lineage and i installed it and didnt work it was crashing if i would install camera2 api module from magisk will it work or ?

i installed everything and now gcam somehow works its perfect thank you so much i couldn't do it without your guide

Sweet man, so just to clarify, you have a 710EM and what firmware did you flash before lineage? 21dulm or 21d EM?


I think im going to try Andy's lineage GSI.
 

sirbow2

Senior Member
May 21, 2013
53
9
Edit: Update 2: dont use the vendor in this post. I patched the ULM vendor, but vibrate and gcam are still an issue with a GSI. links here: https://forum.xda-developers.com/showpost.php?p=81563763&postcount=41 Also, using the ulm vendor on Josh1x's rom fixed everything but gcam.

I ended up moving to the GSI. I tried Deepflex's lineage 16 GSI but it was buggy and not working correctly. AndyYan's lineage 17 rom is working much better. Camera flash even works and the brightness slider is correct. List of all GSIs

If starting from stock, follow this new guide after doing the fastboot format userdata command in step 3 of the original guide in post #1

1. Flash vendor_gsi image (sourced from aosp trebble g7 EM this thread)
Code:
fastboot flash vendor_a vendor_gsi.img
fastboot flash vendor_b vendor_gsi.img

The above is the only file used from the source i linked above. I had to use a different twrp (the one from the existing thread wouldnt go past the lock screen after first reboot) so i tried the one below which worked, but only with the vbmeta img from josh1x's lineage 16 rom.

2. Flash vbmeta from josh1x's LOS16 rom (as mentioned before). File attached.
Code:
fastboot flash vbmeta_a vbmeta.img
fastboot flash vbmeta_b vbmeta.img

3. Flash latest twrp 3.3.1 (sourced from this thread). If you have magisk, here's the version i patched.
Code:
fastboot flash boot_a twrp_20b.img
fastboot flash boot_b twrp_20b.img

4. Flash GSI of whatever flavor you want. needs to be amd64 and for the A/B (bvN) partition type. I used this one
Code:
fastboot flash system_a system.img
fastboot flash system_b system.img

5. Reboot while wiping data (shouldnt wipe internal "sdcard", didnt for me). Should boot into lineage now.
Code:
fastboot -w reboot

6. For gapps, just reboot into recovery (none of that non persistant boot stuff), and flash the beta android 10 gapps from here
Note: I had to resize the system partition for the LOS17 rom for this as it didnt fill the entire filesystem when it was flashed. Go to the TWRP terminal and run mount to find the device path for /system and then run resize2fs /device/block/whatever.
 

Attachments

  • vbmeta.img
    64 KB · Views: 92
Last edited:

lolwatpear

Senior Member
Nov 24, 2011
306
45
I ended up moving to the GSI. I tried Deepflex's lineage 16 GSI but it was buggy and not working correctly. AndyYan's lineage 17 rom is working much better. Camera flash even works and the brightness slider is correct. List of all GSIs

If starting from stock, follow this new guide after doing the fastboot format userdata command in step 3 of the original guide in post #1

1. Flash vendor_gsi image (sourced from aosp trebble g7 EM this thread)
Code:
fastboot flash vendor_a vendor_gsi.img
fastboot flash vendor_b vendor_gsi.img

The above is the only file used from the source i linked above. I had to use a different twrp (the one from the existing thread wouldnt go past the lock screen after first reboot) so i tried the one below which worked, but only with the vbmeta img from josh1x's lineage 16 rom.

2. Flash vbmeta from josh1x's LOS16 rom (as mentioned before). File attached.
Code:
fastboot flash vbmeta_a vbmeta.img
fastboot flash vbmeta_b vbmeta.img

3. Flash latest twrp 3.3.1 (sourced from this thread). If you have magisk, here's the version i patched.
Code:
fastboot flash boot_a twrp_20b.img
fastboot flash boot_b twrp_20b.img

4. Flash GSI of whatever flavor you want. needs to be amd64 and for the A/B (bvN) partition type. I used this one
Code:
fastboot flash system_a system.img
fastboot flash system_b system.img

5. Reboot while wiping data (shouldnt wipe internal "sdcard", didnt for me). Should boot into lineage now.
Code:
fastboot -w reboot

6. For gapps, just reboot into recovery (none of that non persistant boot stuff), and flash the beta android 10 gapps from here
Note: I had to resize the system partition for the LOS17 rom for this as it didnt fill the entire filesystem when it was flashed. Go to the TWRP terminal and run mount to find the device path for /system and then run resize2fs /device/block/whatever.

Thanks. You're process got my audio working on GSI. Not sure what incorrect image I was installing or what the issue was.

Just need to disable the LED notification and get vibration working.
 

loonycgb2

Senior Member
Sep 3, 2010
242
107
Moto G Play
Google Pixel 6
EM devices vendor partition differ slightly compared to ULM devices, so camera issues and such will happen since you are using a slightly different blob.

There was a post of someone getting ULM to work with twrp so if someone can flash ULM and modify the vendor to load without encryption check and dmverity disabled then backup the vendor img.

Use that new vendor img will fix minor issues for ULM based devices on new gsi's.
 

sirbow2

Senior Member
May 21, 2013
53
9
EM devices vendor partition differ slightly compared to ULM devices, so camera issues and such will happen since you are using a slightly different blob.

There was a post of someone getting ULM to work with twrp so if someone can flash ULM and modify the vendor to load without encryption check and dmverity disabled then backup the vendor img.

Use that new vendor img will fix minor issues for ULM based devices on new gsi's.

thats what i was kind of thinking the issue was. thats over my head though.
 

sirbow2

Senior Member
May 21, 2013
53
9
EM devices vendor partition differ slightly compared to ULM devices, so camera issues and such will happen since you are using a slightly different blob.

There was a post of someone getting ULM to work with twrp so if someone can flash ULM and modify the vendor to load without encryption check and dmverity disabled then backup the vendor img.

Use that new vendor img will fix minor issues for ULM based devices on new gsi's.

Ask someone from the thread of flashing ulm 20d to backup their vendor if they havent flashed to EM firmware or lineage yet

Oh, so all we have to do is get it to boot through twrp (or just a boot with root?) and then dd it? I could probably just flash the 21d ULM kdz again and do that?
 

loonycgb2

Senior Member
Sep 3, 2010
242
107
Moto G Play
Google Pixel 6
Oh, so all we have to do is get it to boot through twrp (or just a boot with root?) and then dd it? I could probably just flash the 21d ULM kdz again and do that?

Once you got twrp running with stock then do the normal thing of format userdat to decrypt it then flash the no dmverity zip mentioned in the thread or magisk then backup vendor via twrp or dd...

That will give you a usable vendor for lineage and such.

All josh1x or whoever did to the EM vendor was modify fstab to remove the force encrypt so that way decrypted roms would work.
 

Awesomeslayerg

Senior Member
Jul 5, 2014
793
365
Los Angeles
I ended up moving to the GSI. I tried Deepflex's lineage 16 GSI but it was buggy and not working correctly. AndyYan's lineage 17 rom is working much better. Camera flash even works and the brightness slider is correct. List of all GSIs

If starting from stock, follow this new guide after doing the fastboot format userdata command in step 3 of the original guide in post #1

1. Flash vendor_gsi image (sourced from aosp trebble g7 EM this thread)
Code:
fastboot flash vendor_a vendor_gsi.img
fastboot flash vendor_b vendor_gsi.img

The above is the only file used from the source i linked above. I had to use a different twrp (the one from the existing thread wouldnt go past the lock screen after first reboot) so i tried the one below which worked, but only with the vbmeta img from josh1x's lineage 16 rom.

2. Flash vbmeta from josh1x's LOS16 rom (as mentioned before). File attached.
Code:
fastboot flash vbmeta_a vbmeta.img
fastboot flash vbmeta_b vbmeta.img

3. Flash latest twrp 3.3.1 (sourced from this thread). If you have magisk, here's the version i patched.
Code:
fastboot flash boot_a twrp_20b.img
fastboot flash boot_b twrp_20b.img

4. Flash GSI of whatever flavor you want. needs to be amd64 and for the A/B (bvN) partition type. I used this one
Code:
fastboot flash system_a system.img
fastboot flash system_b system.img

5. Reboot while wiping data (shouldnt wipe internal "sdcard", didnt for me). Should boot into lineage now.
Code:
fastboot -w reboot

6. For gapps, just reboot into recovery (none of that non persistant boot stuff), and flash the beta android 10 gapps from here
Note: I had to resize the system partition for the LOS17 rom for this as it didnt fill the entire filesystem when it was flashed. Go to the TWRP terminal and run mount to find the device path for /system and then run resize2fs /device/block/whatever.

Nevermind
 
Last edited:

Awesomeslayerg

Senior Member
Jul 5, 2014
793
365
Los Angeles
I tried using the vendor from ULM 20e and it doesnt work, i even tried flashing dm verity right after. How would one modify the vendor partition anyways?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Edit: Update 2: dont use the vendor in this post. I patched the ULM vendor, but vibrate and gcam are still an issue with a GSI. links here: https://forum.xda-developers.com/showpost.php?p=81563763&postcount=41 Also, using the ulm vendor on Josh1x's rom fixed everything but gcam.

    I ended up moving to the GSI. I tried Deepflex's lineage 16 GSI but it was buggy and not working correctly. AndyYan's lineage 17 rom is working much better. Camera flash even works and the brightness slider is correct. List of all GSIs

    If starting from stock, follow this new guide after doing the fastboot format userdata command in step 3 of the original guide in post #1

    1. Flash vendor_gsi image (sourced from aosp trebble g7 EM this thread)
    Code:
    fastboot flash vendor_a vendor_gsi.img
    fastboot flash vendor_b vendor_gsi.img

    The above is the only file used from the source i linked above. I had to use a different twrp (the one from the existing thread wouldnt go past the lock screen after first reboot) so i tried the one below which worked, but only with the vbmeta img from josh1x's lineage 16 rom.

    2. Flash vbmeta from josh1x's LOS16 rom (as mentioned before). File attached.
    Code:
    fastboot flash vbmeta_a vbmeta.img
    fastboot flash vbmeta_b vbmeta.img

    3. Flash latest twrp 3.3.1 (sourced from this thread). If you have magisk, here's the version i patched.
    Code:
    fastboot flash boot_a twrp_20b.img
    fastboot flash boot_b twrp_20b.img

    4. Flash GSI of whatever flavor you want. needs to be amd64 and for the A/B (bvN) partition type. I used this one
    Code:
    fastboot flash system_a system.img
    fastboot flash system_b system.img

    5. Reboot while wiping data (shouldnt wipe internal "sdcard", didnt for me). Should boot into lineage now.
    Code:
    fastboot -w reboot

    6. For gapps, just reboot into recovery (none of that non persistant boot stuff), and flash the beta android 10 gapps from here
    Note: I had to resize the system partition for the LOS17 rom for this as it didnt fill the entire filesystem when it was flashed. Go to the TWRP terminal and run mount to find the device path for /system and then run resize2fs /device/block/whatever.
    2
    Oh, so all we have to do is get it to boot through twrp (or just a boot with root?) and then dd it? I could probably just flash the 21d ULM kdz again and do that?

    Once you got twrp running with stock then do the normal thing of format userdat to decrypt it then flash the no dmverity zip mentioned in the thread or magisk then backup vendor via twrp or dd...

    That will give you a usable vendor for lineage and such.

    All josh1x or whoever did to the EM vendor was modify fstab to remove the force encrypt so that way decrypted roms would work.
    1
    UPDATE: I kept finding bugs in josh1x's rom, so i installed the LOS17 GSI instead. Guide for that outline in reply #11

    Figured this out and thought i'd write a simple tutorial that covers stock (i was at 20e) to lineage. You'll need the LG USB Drivers and adb/fastboot. There are a couple other things to download through out the tutorial and the unlock tutorial in step 1.
    LG USB Drivers 4.2.0
    ADB/Fastboot
    LGUP with partition DL

    Note: I was able to reach download mode and fastboot at any point in this process and even when it went wrong (kernel crashes, boot loops etc) while figuring out this tutorial. I found that i could just hold vol down or up in a bootloop with the usb connected to get to the mode i wanted.

    Typical combos:
    -Download mode: power off phone with usb disconnected. hold vol up and plug in cable
    --NOTE: after wiping laf_a and boot_b, you must switch to slot b to access download mode (run command: fastboot -ab)

    -fastboot: power off phone with usb disconnected, hold vol down and plug in cable. or adb reboot bootloader
    --NOTE: after wiping laf_a and boot_b, you can only access fastboot from slot a by holding vol up on boot (for 20e/21d, on 11g vol down still works).

    -Recovery: power off. hold power and vol down, when you see the white LG G7 logo temporarily release just the power button. Continue to hold power and vol down till you get to the option menu. Select Yes three times.

    Guide:
    1. Follow the universal unlock method here.

    1.5. You need to zero out laf_a and boot_b before flashing 21d/20e to maintain fastboot access. Use adb to run the following commands
    Code:
    dd if=/dev/zero of=/dev/block/bootdevice/by-name/laf_a
    dd if=/dev/zero of=/dev/block/bootdevice/by-name/boot_b

    1.75. Enable usb debugging (should already be done). Open LGUP and connect to your phone. dont close it. If you open it after booting to DL mode it wont recognize it

    2. 21d ULM firmware (here) must be flashed to use the latest twrp (20e works as well). The 11g twrp cannot install lineageos. I would imagine the EU firmware could be flashed as well, but I used ULM.
    Code:
    Boot into fastboot
    fastboot -ab
    Boot into download mode
    Use the lg up linked in this post to flash 20e/21d without laf_a and boot_b with partition dl mode

    3. Format userdata to decrpyt your file system so TWRP can access it. Then flash TWRP; boot_twrp-june.img can be found here. It's from Josh1x's post here. Note: this TWRP is non persistant.
    Code:
    Boot to bootloader
    fastboot format userdata
    fastboot flash boot_a boot_twrp-june.img 
    fastboot flash boot_b boot_twrp-june.img
    Select restart in fastboot 
    Boot to recovery

    4. Obtain the latest lineage build here. This is from Josh1x's post here. I attempted to flash gapps at this point and it failed, see the next steps.
    Code:
    Wipe everything
    Transfer lineageos to your phone and install it
    Restart normally

    5. Gapps
    Code:
    Reboot to bootloader
    fastboot flash boot_a boot_twrp-june.img 
    fastboot flash boot_b boot_twrp-june.img
    Reboot to recovery
    Transfer opengapps 9.0 to your phone and install.
    Reboot to bootloader

    6. We need to flash the stock lineage boot image (here) again now that we are done. The file was obtained with this method
    Code:
    fastboot flash boot_a boot.img
    fastboot flash boot_b boot.img
    Restart normally

    if you have magisk, it would be magisk_patched_boot.img (here). this one was made from the above image with magisk on my phone.
    Code:
    fastboot flash boot_a magisk_patched_boot.img
    fastboot flash boot_b magisk_patched_boot.img
    Restart normally

    Any time you want to flash something via twrp you will have to flash twrp via fastboot again (hence the non persistance), do your stuff in twrp, and then reflash the boot img (it will not boot if you dont do this or use josh1x's boot file). Just like steps 5-6 for gapps.

    I am so glad to be off of stock, enjoy guys and girls!

    Bugs (from my ULM phone)
    -flash doesnt work in the camera. also probably why gcam crashes (gcam works on an EM phone somehow)
    -brightness slider is calibrated incorrectly compared to stock. way too bright when set to 0%
    NOTE: using ULM vendor fixed the flash and brightness, but gcam still doesnt work. This would make it the most functional rom for this phone at this point (vibrate does work).
    1
    Being that since day1 of g710pm/ulm could be boot unlocked, all ypu had to do is flash the eu firmware and go to lineage frlm there due to twrp incompatibility.

    I have not tested it, but does being on lineage based off EU blobs, do you still get full LTE and/or volte.

    If sprint users have switched to eu/lineage do you have full lte/ril compatibility.
    1
    nonono i meant like magisk from the stock rom it was bootlooping so that means those images works for EM model too ? (bootimg and magisk)
    oh yea. i see, yes, they might as they are from the lineage rom.


    ... also i saw a guy saying gcam works on the lineage and i installed it and didnt work it was crashing if i would install camera2 api module from magisk will it work or ?
    It wont let me install that camera2 module. Says incompatible device. I tried the gcam patch and that didnt work either.

    Also, flash does not work properly on the included camera. It flashes for the focus, but then doesnt for actually taking the picture.