Version 4 (modified by 7 years ago) (diff) | ,
---|
pstore
do debug the boot process the pstore driver is used to create a persitant storage area that survives boot.
The principle idea is:
- boot the boot image that you want to debug and write the boot log to pstore
- generate a kernel panic
- boot a recovery boot image that also has pstore enabled to analyze the log
In the TWRP recovery image for the chiron pstore is enabled and pstore is automatically mounted to /sys/fs/pstore/
Kernel
The following options have to be enabled in the kernel config (in both boot images)
CONFIG_PSTORE=y CONFIG_PSTORE_CONSOLE=y CONFIG_PSTORE_PMSG=y CONFIG_PSTORE_RAM=y
Mounting pstore
To read the info in pstore it has to be mounted (in the boot image that is used to analyze the pstore) with something like
mount -t pstore pstore /sys/fs/pstore
Writing to pstore
When CONFIG_PSTORE_PMSG is enabled it defines a device /dev/pmsg0 to which one can write messages
echo "Hello Guhl" > /dev/pmsg0
After the kernel panic and reboot the result should be in /sys/fs/pstore/pmsg-ramoops-X
Kernel panic
For what ever reason the standard way to generate a kernel panic
echo c > /proc/sysrq-trigger
did not work for me so I created a kernel module that I can modprobe to generate a panic.
I am using the attached kernel module to create a kernel panic (modprobe the module) The files are placed in a directory "panic" in the kernel directory and enabled in kernel config with
CONFIG_GUHL_PANIC=m
Attachments (3)
- panic.c (345 bytes) - added by 7 years ago.
- Makefile (36 bytes) - added by 7 years ago.
- Kconfig (140 bytes) - added by 7 years ago.
Download all attachments as: .zip