Since my device was unproperly shut down because the battery stopped functioning (the battery is getting completely discharged at a level higher than 1%), it is rebooting in loops even in safe mode (more exactly it reboots about 3 to 5 seconds after finishing booting).
So it means a file or permission wasn’t properly written in /data.
But in my case, the /data partition is on the sd card thanks to Magisk root, so I have full access to it.

Using a computer, I tried to put an additional Magisk startup script which is executed at boot in order to stream kernel log to a file, but the result isn’t useful as the last line of the log file looks something like this :

[   72.480828] Ke

So which is the command to execute or file to write in /proc or /sys in order to disable automatic reboot after a kernel panic so the kernel finish to flush the log file ?

  • last_kmsg or pstore is the best ways to get kernel panic log. You don't need to write kernel log to a file. Details here: android.stackexchange.com/a/213460/218526. But you haven't stated in your question how a malfunctioning battery relates to kernel panics or reboots / bootloop and why you want to get kernel log. // Btw you can control reboot behavior on kernel panic by writing (directly or by using sysctl) to different files (including panic and panic_on_oops) in /proc/sys/kernel/. Jun 24 at 15:32
  • @IrfanLatif unfortunately last_kmsg and pstore don’t return the kernel log on my device. And as I said, I suppose it’s because of the improper shutdown since I replaced by the exact same battery model from Samsung. Jun 24 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.