My phone keeps rebooting. I want to know what dmesg says at the moment it reboots, so I can diagnose.
Unfortunately, the reboots don't happen predictably, and only when I'm using it. I can't keep my phone connected to my laptop for days on end. I have it connected via adb right now, and of course the little varlet isn't rebooting. There is no last_kmsg, either.
The version is LineageOS 14. I'm posting here because the answer to this question would presumably apply to all unix-based systems. If you don't like, I suppose punt it over to Android.
What I'm envisioning is it writing to the log constantly until it reboots. I realise that if the phone doesn't reboot itself, the log will eventually fill up the SD card. So I'm picturing a script like:
dmesg to log.1 if log.1 >1mb, delete it dmesg log.2 if log.2 >1mb, delete it dmesg to log.1
I don't have the skills to write it though. Can anyone help?