Implement charging mode
I've started with the packaging of the charging-sdl
which can be tested in the branch:
https://github.com/postmarketOS/pmbootstrap/tree/feature/charging-sdl
Building the package
pmbootstrap checksum charging-sdl
pmbootstrap build charging-sdl --arch armhf
Installation on the device
pmbootstrap install --add charging-sdl
or copy it into the device:
scp $work/packages/armhf/charging-sdl-0.1-r0.apk user@172.16.42.1:/home/user/
ssh user@172.16.42.1
apk add ./charging-sdl-0.1-r0.apk
Testing
export DFBARGS="system=fbdev,no-cursor,disable-module=linux_input"
charging-sdl -pcf /usr/share/fonts/ttf-dejavu/DejaVuSans.ttf
Todo
-
Package charging-sdl
with proper version tag -
Include charging-sdl
into theinitramfs-extra
-
Identify a common way to detect the charging mode on each device - qualcomm lk adds
androidboot.mode=charger
to the kernel cmdline when it's supposed to go to charger mode (see lk code) (thanks to @z3ntu) - some Samsung devices have
lpm_boot=1
in the kernel cmdline for charge mode
device | normal | charge mode |
---|---|---|
samsung-i9070 | lpm_boot=0 | lpm_boot=1 |
samsung-klte | androidboot.baseband=msm | androidboot.baseband=lpm androidboot.mode=charger |
samsung-maguro | - | androidboot.mode=charger |
huawei-y530 | - | androidboot.huawei_type=oem_rtc |
sony-seagull | startup=0x00000001 warmboot=0x00000000 | startup=0x00010004 warmboot=0x77665501 |
-
Update postmarketos-mkinitfs/init.sh.in to handle the charging mode -
Tweak the system to reduce performance and improve charging speed - example for LG G Watch (dory) here