[LEDE-DEV] Supporting crashdumps w/ kexec
Philip Prindeville
philipp_subx at redfish-solutions.com
Tue Mar 7 16:40:43 PST 2017
Hi.
I’m trying to add scripting to support crashdumps. I’m on an x86_64 and haven’t been able to get crashlog to work, so this seems like the next best thing.
I’ve a few related questions I was hoping I could get answered.
First, obviously, is that kexec needs access to the boot partition to reuse the kernel (since most of our architectures support relocatable images, there’s no reason that the system kernel and the crash dump kernel can’t be one in the same). Is where does /boot get unmounted, and is there an easy way to keep it around a bit longer, at least until the init.d scripts have finished running?
2nd, how to pass in extra GRUB arguments to the kernel build when a package has been selected? For instance, if I wanted to do "CONFIG_GRUB_BOOTOPTS += crashkernel=64M” Or what if I want to configure an extra menuentry in /boot/grub/grub.cfg?
Or would I do:
Image/cmdline/squashfs += crashkernel=64m
(which seems to only be relevant for x86 hardware…)
3rd question, when I build kexec-tools, I need to make sure that the corresponding kernel has been built with:
# CONFIG_SMP is not set
CONFIG_KEXEC=y
CONFIG_CRASH_DUMP=y
CONFIG_PHYSICAL_START=0x1000000
CONFIG_RELOCATABLE=y
# CONFIG_RANDOMIZE_BASE is not set
CONFIG_PROC_KCORE=y
CONFIG_PROC_VMCORE=y
CONFIG_SYSFS=y
CONFIG_DEBUG_INFO=y
I know that kmod packages can have KCONFIG's for specific .config symbols, but how does a regular package force these kernel options?
4th question, and this is more general: I need a place where I can copy /proc/vmcore to persistent storage, but I don’t want to risk filling up the root partition, etc. Is there an easy way to have the image include a 3rd partition for collecting crash dumps? Or should I just count on /etc/fstab containing a magic entry? Or look for a partition with a predefined label (like “CRASHDUMP”)?
Thanks,
-Philip
More information about the Lede-dev
mailing list