LG G3 Europe (lg-d855)

From postmarketOS
Jump to: navigation, search
LG G3 (Europe)
LG G3 running Weston demos
LG G3 running Weston demos
Manufacturer LG
Name G3 (Europe)
Codename lg-d885
Released 2014
Original software Android 4.4.2 on Linux 3.10
Hardware
Chipset Qualcomm MSM8974AC Snapdragon 801
CPU Quad-core 2.5 GHz Krait 400
GPU Adreno 330
Display 1440x2560 IPS
Storage 16/32 GB
Memory 2/3 GB

Contributors

  • Nutcake

What works

  • Compiling the LineageOS kernel
  • SSH
  • Booting (see "Signing the boot image" to boot without pmbootstrap command)
  • Flash light
    • Use led:flash_torch in /sys/class/leds. led:flash_0 and led:flash_1 can be used to individually address the dual-tone flash LEDs but they turn off again after a second.
  • RGB front LED
  • Backlight control
  • Battery
  • Weston + Touchscreen

What does not work

  • WiFi, Bluetooth, etc...
  • USB OTG
  • Graphical terminal in weston crashes instantly

There is also a bug where the screen is not updated. Workaround: login using ssh and run the following command:

ssh user@172.16.42.1
sudo su
while [ ! ]; do cat /sys/class/graphics/fb0/modes > /sys/class/graphics/fb0/mode; done

As this devices' screen is 1440x2560px, small elements in weston are extremely hard to click and the on-screen keyboard is pretty much unusable, so DPI scaling is needed in weston. However, right now the fbdev backend doesn't support scaling.

Fastboot

Before you can use fastboot on this device you need to remove LGs Download mode, which hides the standard fastboot mode. You can do this by zeroing out a partition called 'laf':

adb shell
su
dd if=/dev/block/platform/msm_sdcc.1/by-name/laf of=/sdcard/laf.img #backup LGs Download mode to the internal SD just in case
dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/laf #Overwrite laf with zeroes, enabling fastboot
exit
adb reboot bootloader #reboot directly to fastboot

More detailed instructions for this can be found here

Afterwards, you can boot into fastboot by following these steps:

1. Turn of phone completely
2. Hold Volume Up.
3. Plug in USB-cable while still holding Vol. Up until fastboot pops up

Signing the boot image

pmbootstrap will successfully flash system and kernel, however the device will only boot if you use the
pmbootstrap flasher boot command, as it will otherwise show this error:

ERROR : boot certification verify
[630]_________________________________________
[640]
[640] Secure booting Error!
[640] Cause : boot certification verify
[640]
[640]_________________________________________

The message is shown for 3 seconds, then the screen blacks out and the LED will blink red and blue indefinitely.
This happens because the bootloader on the d855 variant of the LG G3 can not be unlocked and you have to trick the bootloader into thinking your boot image is legitimate.
To do this, you need to first export your boot.img-lg-d855:

mkdir -p /tmp/pmOS_export
pmbootstrap flasher export /tmp/pmOS_export

Then we need a tool called Open_Bump, which can sign boot images for our device. (Requires Python 2. Also works for older LG devices?):

git clone https://github.com/CyboLabs/Open_Bump
cd Open_Bump
python2 open_bump.py "/tmp/pmOS_export/boot.img-lg-d855"

This will create a signed image called boot_bumped.img-lg-d855 in /tmp/pmOS_export/.
Now first flash System and kernel images using pmbootstrap and then manually flash the signed image over these:

pmbootstrap flasher flash_system
pmbootstrap flasher flash_kernel
fastboot flash boot /tmp/pmOS_export/boot_bumped.img-lg-d855

Links

Photos