Skip to content

aurora-platform: opt-in kdump to save Linux crashes - #208

Merged
RyanTheTide merged 9 commits into
mainfrom
kdump/crash-dumps
Nov 12, 2026
Merged

RyanTheTide merged 9 commits into
mainfrom
kdump/crash-dumps

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

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, and aurora-panic-log (aurora-diag) lists them.

Changes (aurora-platform 44-38)

  • New subpackage aurora-platform-kdump, which requires kdump-utils, makedumpfile and grubby. Installing it runs aurora-kdump-setup enable, which enables kdump.service and, unless a crashkernel= is already set, adds crashkernel=512M to 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 runs disable, which turns the service off and removes only the crashkernel= that enable added. aurora-platform-core is unchanged, and nothing installs the subpackage by default.
  • /usr/lib/kdump/dracut.conf.d/99-zz-aurora.conf is read only when the crash kernel's initramfs is built, and sorts after kdump-utils' 99-kdump.conf. It:
    • adds nvme_apple. 99-kdump.conf sets add_dracutmodules= (not +=), which drops dracut-asahi's module list, so the crash kernel had no disk.
    • leaves out (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. With udev.children-max=2, probes stuck on live hardware blocked nvme_apple.
    • leaves out the squash dracut modules. kdump-utils packs the initramfs into a squashfs image behind a busybox /init. With Fedora 44's dracut 108, that /init never 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.
    • adds the dracut module aurora-kdump-clock. The crash kernel cannot restart the SMC, so rtc0 is missing; a pre-mount hook then sets the clock from CRASHTIME in 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: an ExecCondition skips the service on a boot without crash kernel memory instead of failing it.
  • No dracut >= 111-5 requirement. Fedora 44 ships dracut 108, and the M1 Pro saved dumps with dracut 111-4.
  • docs/kdump.md covers 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:

  • MacBook Air (M2), Fedora 44, dracut 108, 320 MiB: 222 MiB vmcore, vmcore-dmesg and kexec-dmesg saved, back on the default kernel 17 s after the panic. Without the squash omit there was no dump in 6 runs, and the watchdog restarted the Mac at 194 s each time. In a debug crash kernel with progress marks in the watchdog deadline, the last kernel step was run_init, no module load ever started, and a kernel heartbeat ran until it stopped itself at 100 s.
  • MacBook Pro (M1 Pro), Fedora 45, dracut 111-4, 512 MiB: 269 MiB vmcore and both logs saved in 4 s, dump directory dated to the panic second by the CRASHTIME hook, back on the default kernel 42 s after the panic. At 320 MiB the same initramfs (85 MB unpacked) saved nothing and the watchdog restarted the Mac after 208 s; with the squashfs layer it had worked at 320 MiB (200 MiB vmcore, back after 42 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

RyanTheTide and others added 5 commits November 8, 2026 21:05
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>
RyanTheTide and others added 3 commits November 12, 2026 19:47
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
@RyanTheTide RyanTheTide changed the title aurora-platform: save Linux crashes with kdump aurora-platform: opt-in kdump to save Linux crashes Nov 12, 2026
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
@RyanTheTide
RyanTheTide marked this pull request as ready for review November 12, 2026 10:11
@RyanTheTide
RyanTheTide merged commit 686d068 into main Nov 12, 2026
20 checks passed
@RyanTheTide
RyanTheTide deleted the kdump/crash-dumps branch November 12, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant