Repository navigation
aurora-platform: opt-in kdump to save Linux crashes - #208
Merged
Merged
Conversation
iBoot never keeps a record of a Linux panic, so a Linux crash is lost at the restart. Save it with kdump: a crash kernel writes the vmcore and the crashed kernel's log to /var/crash, where aurora-panic-log lists them. - Require kdump-utils and makedumpfile, and dracut >= 111-5 for kdump-utils 1.0.61's dracut_no_switch_root. - Add nvme_apple to the crash kernel's initramfs. kdump-utils' 99-kdump.conf replaces dracut-asahi's module list, so the crash kernel had no disk. - Set the crash kernel's clock from the PMU RTC (dracut module aurora-kdump-clock, kdump initramfs only): the crash kernel cannot restart the SMC, so rtc0 is missing and dumps were dated 2026-09-29. - Skip kdump.service instead of failing it on a boot without crash kernel memory. - Enable kdump.service and set kdump-utils' default crashkernel= once per system; an owner who turns it off keeps that choice. Needs the crash kernel support in aurora-silicon/linux#1200. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM
On the M1 Pro and M2 the crash kernel stalled before nvme_apple ever probed. The kdump initramfs carried about 40 drivers of coprocessors and buses that the crashed kernel left running (aurora, appledrm, dcp, thunderbolt, aop, apple-pmp, ane, sound, dwc3, tps6598x, spi-hid, macsmc-*). With udev.children-max=2, two probes stuck on live hardware block every later module load. Omit them: the crash kernel only needs the disk. With this, an M1 Pro crash kernel saved its vmcore and was back on the default kernel 42 s after the panic. The crash kernel's clock: M1/M2-class Macs have no PMU RTC in Linux, so the hook now takes the panic time from CRASHTIME in the crashed kernel's vmcoreinfo note at the start of /proc/vmcore, and reads the PMU RTC only when that fails. Checked against an M1 Pro vmcore (CRASHTIME matched the panic to the second); not yet run inside a crash kernel. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM
…rash kernel The M2 crash kernel still stalled with the first omit list (restarted by its watchdog after 190 s, no dump), while the M1 Pro saved one. Leave out the rest of the drivers the dump does not need, starting with the I2C bus of the USB-C port controllers (the M2's cd321x interrupt storm). Not yet tested on hardware. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM
aurora-platform 44-29 on top of main's 44-27. The kdump sources move to Source117-122 after main's ANE and wake-for-network files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
kdump reserves crash kernel memory on every boot, and the crash kernel only works on some Macs so far: it saves a dump on a MacBook Pro (M1 Pro) and stalls on a MacBook Air (M2). Move the kdump pieces from aurora-platform-core into aurora-platform-kdump. Installing that package runs aurora-kdump-setup enable (kdump.service on, kdump-utils' default crashkernel= unless one is set); removing it runs disable, which takes out only the crashkernel= that enable added. Drop the preset and the once-per-system enable from core's %posttrans. Drop the dracut >= 111-5 requirement: Fedora 44 ships dracut 108, and kdump-utils 1.0.61 with dracut 111-4 saved a dump on the M1 Pro. docs/kdump.md says how to turn it on and off and which Macs are tested. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM
kdump-utils adds dracut's squash module, which packs the initramfs into a squashfs image behind a small busybox /init that mounts it. With Fedora 44's dracut 108 that /init never loaded its first module (loop) in the crash kernel on a MacBook Air (M2): the kernel stayed up, no module was ever loaded, nothing reached systemd, and the watchdog restarted the Mac after about 3 minutes without a dump. Omit the squash modules in the kdump dracut conf, so the crash kernel boots straight into systemd. Tested with sysrq-c on 7.3.0-aurora-fleet67 on the M2: 222 MiB vmcore and both logs saved, back on the default kernel 17 s after the panic. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM
Without the squashfs layer the crash kernel unpacks its whole initramfs (about 85 MB on Fedora 45). At kdump-utils' default of 320 MiB the MacBook Pro (M1 Pro) crash kernel then saved nothing and its watchdog restarted the Mac after about 3 minutes; at 512 MiB it saved a 269 MiB vmcore and both logs and was back on the default kernel 42 s after the panic. aurora-kdump-setup now adds crashkernel=512M with grubby and to /etc/kernel/cmdline instead of running kdumpctl reset-crashkernel. kdump-utils' automatic reset leaves a size other than its default alone. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
iBoot keeps no record of a Linux panic, so a Linux crash leaves nothing behind after the restart. This adds kdump as an opt-in subpackage. A crash kernel writes the vmcore and the crashed kernel's log to
/var/crash, andaurora-panic-log(aurora-diag) lists them.Changes (aurora-platform 44-38)
aurora-platform-kdump, which requires kdump-utils, makedumpfile and grubby. Installing it runsaurora-kdump-setup enable, which enables kdump.service and, unless acrashkernel=is already set, addscrashkernel=512Mto every boot entry (grubby) and to/etc/kernel/cmdline. kdump-utils' own 320 MiB default is too small once the initramfs is unpacked whole (see the squash item): the M1 Pro's crash kernel ran out of memory and saved nothing. Removing it runsdisable, which turns the service off and removes only thecrashkernel=thatenableadded. aurora-platform-core is unchanged, and nothing installs the subpackage by default./usr/lib/kdump/dracut.conf.d/99-zz-aurora.confis read only when the crash kernel's initramfs is built, and sorts after kdump-utils'99-kdump.conf. It:nvme_apple.99-kdump.confsetsadd_dracutmodules=(not+=), which drops dracut-asahi's module list, so the crash kernel had no disk.omit_drivers) the drivers of coprocessors and buses the crashed kernel left running: GPU, display, Thunderbolt, AOP, PMP, ANE, audio, USB, keyboard, I2C and SPI. Withudev.children-max=2, probes stuck on live hardware blocked nvme_apple./init. With Fedora 44's dracut 108, that/initnever loaded its first module in the crash kernel on the M2. The kernel stayed up, no module load started and systemd never ran, so the watchdog restarted the Mac after about 3 minutes with no dump.aurora-kdump-clock. The crash kernel cannot restart the SMC, sortc0is missing; a pre-mount hook then sets the clock fromCRASHTIMEin the crashed kernel's vmcoreinfo, or else from the PMU RTC, and dump directories carry the panic time.kdump.service.d/50-aurora-kdump.conf: anExecConditionskips the service on a boot without crash kernel memory instead of failing it.dracut >= 111-5requirement. Fedora 44 ships dracut 108, and the M1 Pro saved dumps with dracut 111-4.docs/kdump.mdcovers turning it on, testing it and turning it off, what the package changes, and the tested Macs.Tested
Kernel 7.3.0-aurora-fleet67 (integration c6c15acf, which has aurora-silicon/linux#1200), one-shot boot with
crashkernel=, these files as packaged, sysrq-c on CPU 2:run_init, no module load ever started, and a kernel heartbeat ran until it stopped itself at 100 s.tests/test_specs.py: 57 OK. The tests cover the dracut conf, the clock hook, the subpackage layout and scriptlets, and enable/disable against fake kdumpctl, grubby and systemctl.Not tested yet: the M4 Pro, and the A18 Pro (MacBook Neo) on a current kernel; earlier test kernels saved dumps on the A18 Pro. ALARM and NixOS follow.
🤖 Generated with Claude Code