LG K40 AT&T (lg-mmh4x)
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 | Android |
Original version | 9 |
FOSS bootloader | no |
postmarketOS | |
Category | testing |
Pre-built images | no |
postmarketOS kernel | 4.9.190 |
Unixbench Whet/Dhry score | 3140.0 |
Flashing |
Works |
---|---|
USB Networking |
Works |
Internal storage | |
SD card | |
Battery |
Broken |
Screen |
Works |
Touchscreen |
Works |
Multimedia | |
3D Acceleration |
Broken |
Audio | |
Camera |
Broken |
Camera Flash | |
Connectivity | |
WiFi | |
Bluetooth |
Broken |
GPS | |
NFC | |
Modem | |
Calls | |
SMS | |
Mobile data | |
Miscellaneous | |
FDE |
Broken |
USB OTG |
Works |
Sensors | |
Accelerometer |
Broken |
Magnetometer |
Broken |
Ambient Light | |
Proximity | |
Haptics | |
Barometer | |
Power Sensor | |
Contributors
- BenTheTechGuy
Users owning this device
- BenTheTechGuy (Notes: Researching mainline)
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:
- Power off the device.
- Run an mtkclient command, like
mtk printgpt
. - While mtkclient waits for the device, hold Volume Up and plug it into the computer.
- mtkclient should output a lot of text at this point. The button can be released.
- As long as mtkclient did its job properly, the command will succeed. Now, other commands can be run with mtkclient.
Unlocking the bootloader
- Enable developer options, and OEM Unlocking from there.
- Follow the steps in #How to enter flash mode.
- Erase the userdata partition:
mtk e metadata,userdata,md_udc
- Unlock the bootloader:
mtk da seccfg unlock
- Reset mtkclient:
mtk reset
- The bootloader should now be unlocked. From here, the device can be unplugged and powered on to go through setup.
Installation
- Run
pmbootstrap init
. DRM is not supported yet, so Xfce4 is the best graphical option for now. - Run
pmbootstrap install
. - Follow the steps in #How to enter flash mode.
- Run
pmbootstrap flasher flash_kernel
. - 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
- pmaports!3231 Initial merge request
- Device package
- Kernel package
- Device Info