I suffer from the infamous random reboots (more specifically: 4-5 second freezes followed by what seems to be a watchdog reset) of the Fairphone 2. I’m using (a self-built) LineageOS on the 16.0 branch.
I know that I can do an adb logcat - however, since I don’t know when the reboots will occur, that’s not so much use for me. I would need to gather the logs after the crash has occurred.
I researched a bit and found that there should either be a /proc/last_kmesg file - which is not there - or a file called /sys/fs/pstore/console-ramoops - which isn’t there either (depending on the Android version, if I got this right; the directory /sys/fs/pstore doesn’t even exist). According to Reading kernel logs — Halium documentation (which is an entirely different project, but since it uses the same kernel? I guess it should also apply) suggest activating
Small update: I enabled the CONFIG_PSTORE kernel option in the config and rebuilt LineageOS.
Initially, I only wanted to reflash the kernel / boot.img via fastboot, but that didn’t work, fastboot complained about unsigned or incomplete image
FAILED (remote: bootimage: incomplete or not signed)
I followed the instructions at Signing boot images for fastboot - z3ntu to sign the image, but still, the result was the same. I’m very much interested what went wrong here.
Anyway, I flashed the complete ZIP file. But the directory /sys/fs/pstore is still not present. I also did an adb shell, in which I entered su to become root, followed by
mount -t pstore pstore /sys/fs/pstore
Which resulted in the error message
mount: 'pstore'->'/sys/fs/pstore': No such file or directory
So it looks like I won’t get crash logs any time soon. Any ideas what else I might try?
Another update: ''fastboot boot ‘’ didn’t work, neither with the signed nor with the unsigned image.
''fastboot flash boot ‘’ worked only with the unsigned image. When I attempted to flash the signed boot image, FP2 would always immediately boot into bootloader mode. (The BootSignature.jar would also emit a NOTE about the image being truncated, I’d assume that’s the reason, I don’t know enough about Android development, though).
This still leaves me with the question how to get the kernel log. The needed kernel config options seem to be set.
Wasn’t aware of this project, thanks, I’ll try it out.
I assume it’ll need root access for the system logs, though? (Just updated to LO 17.1 and haven’t configured it yet)
edit: actually it doesn’t, one can grant permissions via adb. Still not quite was I was looking for. The app seems to stop recording after some time or when you return to it?
edit2: Also, with LO 17, I can’t enable the RAMOOPS config anymore, I’ll get a “…incompatible pointer assignment…” warning which is promoted to an error. (Since it’s not the default config anyway, I doubt I’ll get any support with that)
# on PC
$ adb root
$ adb shell
# on fairphone
# what's "panic-y" on the system?
0|FP2:/ # find -iname "*panic*" 2>/dev/null
./sys/kernel/debug/mdp/xlog/panic
./sys/module/kernel/parameters/panic
./system/product/media/audio/notifications/DontPanic.ogg
./proc/sys/kernel/panic
./proc/sys/kernel/panic_on_oops
./proc/sys/vm/panic_on_oom
1|FP2:/ # cat ./proc/sys/vm/panic_on_oom
0
FP2:/ # echo 1 > ./proc/sys/vm/panic_on_oom
With the next crash, I indeed had a /proc/last_kmesg. Which strangely, according to ls -l, always has the current timestamp. I’d attach it, but I can’t attach txt files, so a pastebin will have to do: PrivateBin
These two lines seem to be the cause, though?
[ 1767.501844] Unable to handle kernel NULL pointer dereference at virtual address 00000100
[ 1767.501871] Unable to handle kernel paging request at virtual address c1113434
Does the LineageOS maintainer participate here, or should I rather seek help in IRC?