When I switch off my android device and connect it to charger, it goes in LPM mode and an animation comes on screen confirming that it is being charged. Now the USB port is used in charging and while charging the bootloader and kernel is up.
My problem is how to log the boot up messgaes so that next time I boot in normal mode, I have those logs reay withut being overwritten by the next boot up log.
I want to debug some charging related issues.
You have 2 options:
After reboot, check the contents of /proc/last_kmsg (instead of /proc/kmsg for the current messages)
Flash a custom kernel that includes the ADB daemon even in LPM mode. You’ll need to check for one for your device, or edit the lpm.rc file yourself before packaging the kernel in order to load that service when booting. After this, you’ll be able to adb into the device normally even during LPM mode.