[LG V50 ThinQ Guides, News, & Discussion] cuynu:
Unlock LG V50/V50s/G8/G8x 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 LG V50/V50s/G8/G8x, 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 LG G8/G8x/v50 Bootloader Unlock and Magisk Root using Firehose

Prerequisites :

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

- LG V50/V50s/G8/G8x ThinQ (non T-Mobile variant) phone with working USB connection

- USB-C Cable

- Little knowledges about terminal commands

- EDL Tool by bkerler : GitHub

- G8abl.img : DOWNLOAD

- frp_lgesm8150.img : DOWNLOAD

STEPS :

Download G8abl.img, frp_lgesm8150.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

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 sm8150 (V50/V50s/G8/G8x) 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
edl r abl_b abl_b_backup.bin --memory=ufs

- Flash Engineering Bootloader to device

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

edl w abl_a G8abl.img --memory=ufs
edl w abl_b G8abl.img --memory=ufs

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

edl w frp frp_lgesm8150.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 6058758

- Unlock the bootloader

Type this command in the terminal :

fastboot oem unlock

Select "Unlock The Bootloader" with volume down button and press power button

View attachment 6058759

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 6058761

- 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

- Lock the bootloader

Type this command in the terminal :

fastboot oem lock

Select "Lock The Bootloader" with volume down button and press power button

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
edl w abl_b abl_b_backup.bin --memory=ufs

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 throw error : AttributeError: 'req' 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.

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

Seasee606 for Engineering bootloader, frp files