Jump to content

LG K40 AT&T (lg-mmh4x)

From postmarketOS Wiki
(Redirected from LG K40 (lg-mmh4x))
LG K40 (AT&T)
LG K40 running postmarketOS with Xfce4
LG K40 running postmarketOS with Xfce4
Manufacturer LG
Name K40 (AT&T)
Codename lg-mmh4x
Released 2019
Type handset
Hardware
Chipset MediaTek MT6765
CPU 4x 2.0 GHz
4x 1.5 GHz
GPU PowerVR Rogue GE8320
Display 720x1440 IPS
Storage 32 GB
Memory 2 GB
Architecture armv7
Software
Original software
The software and version the device was shipped with.
Android 9
Extended version
The most recent supported version from the manufacturer.
Android
FOSS bootloader no
postmarketOS
Category downstream
Mainline
Instead of a Linux kernel fork, it is possible to run (Close to) Mainline.
no
pmOS kernel
The kernel version that runs on the device's port.
4.9.190
Unixbench score
Unixbench Whetstone/Dhrystone score. See Unixbench.
3140.0
Device package device-lg-mmh4x
Kernel package linux-lg-mmh4x
Features
Flashing
It is possible to flash the device with pmbootstrap flasher.
Works
USB Networking
After connecting the device with USB to your PC, you can connect to it via telnet (initramfs) or SSH (booted system).
Works
Battery
Charging and battery level reporting works
Broken
Screen
Display works. Ideally with sleep mode and brightness control.
Works
Touchscreen
Works
Multimedia
3D Acceleration
Broken
Audio
Audio playback, microphone, headset and buttons.
Untested
Camera
Broken
Connectivity
WiFi
Untested
Bluetooth
Broken
GPS
Untested
NFC
Near Field Communication
Untested
Modem
Calls
Untested
SMS
Untested
Mobile data
Untested
Miscellaneous
FDE
Full disk encryption and unlocking with unl0kr.
Broken
USB OTG
USB On-The-Go or USB-C Role switching
Works
Sensors
Accelerometer
Auto screen rotation works in desktops e.g. Phosh or Plasma Mobile
Broken
Magnetometer
Sensor to measure magnetism
Broken
Ambient Light
Untested
Proximity
Untested
Barometer
Sensor to measure air pressure
Untested
Power Sensor
Sensor to monitor current, voltage and power. Not fuel gauge!
Untested

Contributors

  • BenTheTechGuy

Users owning this device


How to enter flash mode

The LG K40 doesn't have a useful recovery mode (it's just a factory reset button), and fastboot doesn't exist at all on the device; the only useful mode is Download Mode, but that requires a signed image to flash.

Luckily, the mtkclient tool can make use of vulnerabilities in the MediaTek SoC itself in order to unlock the bootloader and flash images. In the below examples, the command mtk is used, but if you installed from source, you'll need to run python mtk inside the repo.

To enter into a mode that mtkclient can be used in, follow these steps:

  1. Power off the device.
  2. Run an mtkclient command, like mtk printgpt.
  3. While mtkclient waits for the device, hold Volume Up and plug it into the computer.
  4. mtkclient should output a lot of text at this point. The button can be released.
  5. As long as mtkclient did its job properly, the command will succeed. Now, other commands can be run with mtkclient.

Unlocking the bootloader

  1. Enable developer options, and OEM Unlocking from there.
  2. Follow the steps in #How to enter flash mode.
  3. Erase the userdata partition:
    mtk e metadata,userdata,md_udc
  4. Unlock the bootloader:
    mtk da seccfg unlock
  5. Reset mtkclient:
    mtk reset
  6. The bootloader should now be unlocked. From here, the device can be unplugged and powered on to go through setup.

Installation

  1. Run pmbootstrap init. DRM is not supported yet, so Xfce4 is the best graphical option for now.
  2. Run pmbootstrap install.
  3. Follow the steps in #How to enter flash mode.
  4. Run pmbootstrap flasher flash_kernel.
  5. Run pmbootstrap flasher flash_rootfs.

Status

What doesn't work:

  • WiFi: Haven't attempted to figure out how MTK's proprietary WiFi setup works on MT6765. Hoping the mainline effort gets there first.
  • Modem: Same
  • FDE: osk-sdl crashes with the following message and the device reboots:
    ERROR: Mode 720 x 1440 not available: f
    (!!!) *** UNIMPLEMENTED [fusion_get_fusionee_pid] *** [fusion.c:4147]
    (*) FBDev/Mode: Setting 720x1440 RGB32

    When set to use a 16 bit pixel format, osk-sdl hangs before it can reach this point, and the screen shows a corrupted version of its previous contents. The device reboots shortly after.
  • Battery: Always reports 0; the device will reboot after a short time if not plugged in, even if the battery is full.
  • Sensors: Not detected and don't know where to start getting it working.

See also