[LG G7 ThinQ  Guides, News, & Discussion] cuynu:
Unlocking LG G7/V35/V40 ThinQ bootloader under Linux Environment
​

DISCLAIMER: I AM NOT RESPONSIBLE IF YOUR PHONE BRICKS! YOU ARE FOLLOWING THIS GUIDE AND ITS YOUR CHOICE TO DO IT OR NOT TO DO IT AND YOU'RE THE ONE DOING IT. I JUST WANT TO HELP OTHERS OUT.

There are many other instructions about unlocking bootloader for LG G7 ThinQ, but these are just for Windows + QFIL + LGUP only...

If you are using Windows and came here by mistake, go to this thread instead : [GUIDE] Guide to unlock bootloader for every LG SDM845 except G710TM (With PHOTOS)

Prerequisites :

- PC running Linux (Arch Linux, Ubuntu, Debain, Mint, Fedora, CentOS, etc)

- LG G7/V35/V40 ThinQ (non T-Mobile variant) phone with working USB connection

- USB-C Cable

- Little knowledges about terminal commands

- EDL Tool by bkerler : GitHub

- V35abl.img : DOWNLOAD

- frp.img : DOWNLOAD

- fastbootfix.sh : DOWNLOAD

STEPS :

- Download V35abl.img, frp.img, fastbootfix.sh above

- Install required dependency :

For Arch Linux/Manjaro/etc

sudo pacman -S android-tools python python-pip python-setuptools git xz
sudo pacman -R modemmanager

For Debian/Ubuntu/Mint/etc

sudo apt install adb fastboot python3-dev python3-pip liblzma-dev git
sudo systemctl stop ModemManager
sudo systemctl disable ModemManager
sudo apt purge ModemManager

For Fedora/CentOS/etc

sudo dnf install adb fastboot python3-devel python3-pip xz-devel git

- Clone the EDL repository source code and firehose loader binaries :

[For now, bkerler repository haven't merged fixes yet, so use this fork temporary]

git clone https://github.com/ColdWindScholar/edl.git
cd edl
git submodule update --init --recursive
pip3 install -r requirements.txt

For Arch, you may need to remove the restriction of pip before do the above step :

sudo rm /usr/lib/python3.12/EXTERNALLY-MANAGED

- Install EDL Tool by bkerler :

sudo cp Drivers/51-edl.rules /etc/udev/rules.d
sudo cp Drivers/50-android.rules /etc/udev/rules.d
python3 setup.py build
sudo python3 setup.py install

- Run fastbootfix.sh script (ONLY FOR MACHINE WITH USB 3.0 PORTS)

Open terminal in directory that have all downloaded prerequisites file and type

chmod +x fastbootfix.sh
./fastbootfix.sh

Enter your user password (if have)

Output should be :

18d1:d00d:k
ID : 18d1:d00d
Applied fixes.

If you have SELinux enabled, you may need to set it to permissive mode temporarily to prevent permission issues. SELinux is commonly used by RedHat-like distros (for example, RHEL, Fedora, and CentOS). You can set it to permissive run-time until next boot with

sudo setenforce 0

- Enter EDL Mode :

I) Connect the phone to the PC;

II) Hold VOL- and Power;

III) As soon as the screen turns black repeatedly press VOL+ while holding VOL- & Power button.

OR FOLLOW THIS VIDEO :

Make sure your device has entered EDL Mode, check it by lsusb command, if its entered then output should be appear an device like this

Bus XXX Device XXX: ID 05c6:9008 Qualcomm, Inc. Gobi Wireless Modem (QDL mode)

INFO : As this EDL tool are have firehose loader for LG sdm845 included by default and will work out of box, its will automatically load the firehose loader when you use any command of this tool so you don't have to find firehose programmer like on QFIL in Windows !

- Read original abl partition

Make sure your device has entered EDL Mode !

Dump abl_a & abl_b with this command in terminal :

edl r abl_a abl_a_backup.bin --memory=ufs --lun=4
edl r abl_b abl_b_backup.bin --memory=ufs --lun=4

Example output :

Qualcomm Sahara / Firehose Client V3.62 (c) B.Kerler 2018-2023.
main - Trying with no loader given ...
main - Waiting for the device
main - Device detected :)
sahara - Protocol version: 2, Version supported: 1
main - Mode detected: sahara
sahara -
Version 0x2
------------------------
HWID: 0x0008b0e100310000 (MSM_ID:0x0008b0e1,OEM_ID:0x0031,MODEL_ID:0x0000)
CPU detected: "SDM845"
PK_HASH: 0x1030cd12ce708f29d6914d7529df75149d8ef91c27daf0e1f84b90f4b707329a
Serial: 0xecab9722

sahara - Found loader: /usr/lib/python3.11/site-packages/edlclient-3.62-py3.11.egg/edlclient/../Loaders/LG/6000000000010000_1030cd12ce708f29_fhprg.bin
sahara - Protocol version: 2, Version supported: 1
sahara - Uploading loader /usr/lib/python3.11/site-packages/edlclient-3.62-py3.11.egg/edlclient/../Loaders/LG/6000000000010000_1030cd12ce708f29_fhprg.bin ...
sahara - 64-Bit mode detected.
sahara - Firehose mode detected, uploading...
sahara - Loader successfully uploaded.

- Flash Engineering Bootloader to device

Flash V35abl.img to abl_a & abl_b using this command in terminal (cd to folder that have all prerequisites files):

edl w abl_a V35abl.img --memory=ufs --lun=4
edl w abl_b V35abl.img --memory=ufs --lun=4

- Flash frp.img (for device with NO OEM UNLOCK toggle on Developer options) using this command :

edl w frp frp.img --memory=ufs --lun=6

- Prepare your hand

Now, hold VOL- and type this command in terminal

edl reset

Device will reboot and enter Fastboot Mode like this :

View attachment 6056026

- Unlock the bootloader

Type this command in the terminal :

fastboot oem unlock

IMPORTANT : IMMEDIATELY INTERRUPT WITH CTRL + C WHEN OUTPUT SHOWING ERASING USERDATA AND CACHE

REASON FOR INTERRUPT : During bootloader unlock process, bootloader will erase laf_a and laf_b, so you have to interrupt soon as possible or backup laf_a and laf_b in EDL then restore it manually after unlocked bootloader. I recommend you INTERRUPT so you dont have to backup laf_a and laf_b !

Press VOL+ until you see on screen "Reboot to bootloader" then press power button and wait for it to reboot back in fastboot

Device should be shown : UNLOCKED : YES

View attachment 6056027

- Erase Userdata and cache manually

Type this command in the terminal :

fastboot erase userdata && fastboot erase cache

Wait until its done (usually take 75 seconds)

- Flash back original abl to device :

Type this command in the terminal : (cd to folder that have your backed up abl_a and abl_b files)

fastboot flash abl_a abl_a_backup.bin
fastboot flash abl_b abl_b_backup.bin
fastboot reboot

OKAY, YOU ARE DONE. DEVICE WILL BOOT TO SYSTEM NORMALLY !

- OPTIONAL : Relocking bootloader [FOR WHO WANT TO RELOCK BOOTLOADER ONLY]

Make sure you are in stock unmodified firmware!

Enter EDL and flash Engineering Bootloader like above, reset device and boot to fastboot mode

- Erase Userdata and cache first

Type this command in the terminal :

fastboot erase userdata && fastboot erase cache

Wait until its done (usually take 75 seconds)

- Lock the bootloader

Type this command in the terminal :

fastboot oem lock

IMPORTANT : IMMEDIATELY INTERRUPT WITH CTRL +C WHEN OUTPUT SHOWING ERASING USERDATA AND CACHE

REASON FOR INTERRUPT : During bootloader relock process, bootloader will erase laf_a and laf_b, so you have to interrupt soon as possible or backup laf_a and laf_b in EDL then restore it manually after relock bootloader. I recommend you INTERRUPT so you dont have to backup laf_a and laf_b !

After that, enter EDL again with this command :

fastboot oem edl

If this command doesn't work, enter EDL manually

Flash back original abl to device with this command in terminal (cd to folder that have your backed up abl_a and abl_b files)

edl w abl_a abl_a_backup.bin --memory=ufs --lun=4
edl w abl_b abl_b_backup.bin --memory=ufs --lun=4

Reset device with command :

edl reset

Troubleshoots :

EDL tool throw error : AttributeError: 'NoneType' object has no attribute 'version' :

- Reinstall EDL tool with latest fork : https://github.com/ColdWindScholar/edl.git

EDL tool stuck at "Device detected :)" :

- Hold VOL- and POWER for ~30 seconds, then enter EDL and try again.

EDL tool does not detect device :

- Try change other cable, usb port or reboot your machine. If still doesn't work, the problem maybe belong to your LG, its could be charging port issue or hardware faults.

Stuck on Fastboot mode :

- Flashback original abl_a & abl_b and reboot, if still doesn't work, its might be you dont immediately interrupt bootloader unlock process with CTRL + C.

Download your current running firmware and extract with kdztool then flashback laf.img_XXXXX to device with EDL :

edl w laf_a laf.img_XXXXX --memory=ufs --lun=4
edl w laf_b laf.img_XXXXX --memory=ufs --lun=4
edl reset

Fastboot doesn't work and showing "Press anykey to shutdown" :

- Follow "Run fastbootfix.sh script (ONLY FOR MACHINE WITH USB 3.0 PORTS)" step

Pylzma dependencies failling to install (usually happens on Arch based distros) :

- Clone this fork

git clone https://github.com/electimon/pylzma.git

- Install manually

python setup.py build
sudo python setup.py install

Credits :

bkerler for EDL Tools

EmanuelCN for V35abl.img, frp.img files​