Skip to content

kernel: configure with the kernel's aurora_defconfig - #332

Draft
RyanTheTide wants to merge 2 commits into
mainfrom
sweep-kcmd/config
Draft

RyanTheTide wants to merge 2 commits into
mainfrom
sweep-kcmd/config

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

The NixOS kernel now comes from the kernel source's own make aurora_defconfig (aurora-silicon/linux#2292), like the Fedora and Arch packages and the fleet build.

Before this, kernel/config was alarm-aurora's resolved config from an older pin, and asahi.config was never merged. Resolved over 0abc2f385e54, it lacks APPLE_CENTAURI*/BT_CENTAURI/BT_HCICENTAURI (T6050 Wi-Fi/BT), DRM_ASAHI_M5, DRM_ASAHI_G18, BACKLIGHT_APPLE_DWI, PCIE_APPLE_MSI and PHY_APPLE_T6050_DP.

  • pkgs/kernel.nix configurePhase: make aurora_defconfig, then fail if the result differs from kernel/config. That file stays as the evaluation-time snapshot, because NixOS reads kernel options before the build. Only an owner's boot.kernelPatches settings are merged on top. Validation now covers aurora-base.config + asahi.config + nixos.config.
  • kernel/nixos.config is a requirement list that is checked, not merged. Every entry already holds in the shared configuration: BTRFS_FS and VIRTIO_PCI changed from m to y, which is what the shared config builds, and LOCALVERSION is empty there.
  • kernel/config = make ARCH=arm64 LLVM=1 aurora_defconfig at the linux#2292 head (buildbox clang 22.1.6; refresh it with the toolchain the NixOS build uses, since the check compares the toolchain-detected values too), with provenance.json pointing there. The requirement and policy checks pass on it.

Expected failure until the pin moves: test_vendored_files_match_their_recorded_source, and the evaluation assert that ties provenance to the pin, fail because the snapshot is from linux#2292 and not from the current pin. That is on purpose: when the first pin bump that includes #2292 lands, regenerate kernel/config from the pinned commit (make ARCH=arm64 LLVM=1 aurora_defconfig), update provenance.json, and merge the two together. test_track_sources test_kernel_update_refreshes_provenance_without_editing_recipes fails for the same reason: the updater replaces the pinned commit in provenance.json, which now records the #2292 head. This PR does not change the pin. Nix was not available on the build host, so nix build and nix flake check have not been run; the other tests in tests/test_kernel_config.py pass.

Pin floor: the snapshot now records linux#2292 at 36faebf3, which merges integration/aurora and so contains 26294e82 (the GPU stop fix for the Neo deep-sleep regression introduced by f5b80629ce). The earlier 078e73cc had the regression without the fix. Whatever pin this lands with must contain 26294e82; aurora_defconfig resolves to the same values at 36faebf3 as at 078e73cc.

kernel/config was alarm-aurora's resolved configuration from an older
pin, and asahi.config was never merged, so over a newer source the
NixOS kernel missed recent drivers (T6050 Wi-Fi and Bluetooth, the M5
GPU, the DWI backlight). The kernel source now carries the one
configuration every Aurora build uses (aurora-silicon/linux#2292).

The build now runs make aurora_defconfig and fails if the result differs
from kernel/config, which stays as the evaluation-time snapshot
(refreshed with each pin). nixos.config becomes a list of what NixOS
needs, checked but not merged; it already holds in the shared
configuration (btrfs and virtio-pci are built in). Only an owner's
boot.kernelPatches settings are still merged on top.

The snapshot and provenance point at the linux#2292 head; evaluation
fails until the kernel pin includes it, so land this with that pin bump
and refresh the snapshot from the pinned commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Heads-up before this leaves draft: the new kernel pin 078e73cc contains f5b80629ce ("drm/asahi: g17: Raise the GPU's domain before stopping it at the commit") but not its fix. On the MacBook Neo (J700), that commit makes every deep suspend lose the PMP idle echo, take the forced deep path and lose the GPU after wake. Bisected and confirmed on two Neos today. The fix is aurora-silicon/linux#2469, merged as 26294e82 on integration/aurora. Please pin at or after 26294e82 (or cherry-pick it) so NixOS on the Neo doesn't ship a broken sleep. fedora-aurora#426 and alarm-aurora#350 don't move the kernel pin, so they're unaffected.

…op fix

The snapshot pointed at 078e73cc, which carries f5b80629ce but not its
fix 26294e82, so the pin bump this lands with would have shipped the
Neo deep-sleep GPU loss. linux#2292 now merges integration/aurora
(36faebf3, contains 26294e82). aurora_defconfig resolves to the same
values there, so only the recorded commit changes.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Blockers: 3.

Building from the kernel's own aurora_defconfig and checking (not merging) nixos.config is the right shape, and the pin-floor note from the earlier comment is handled by c3b428f (snapshot now from 36faebf3, which contains 26294e82). Remaining:

  1. Commit 560abc3 has no Signed-off-by and ends in an agent Co-Authored-By trailer. Re-commit with the human sign-off only (fresh branch, no force push).
  2. The configure-time check (pkgs/kernel.nix:68-76) compares every CONFIG_ line, including the toolchain-detected ones, and the snapshot carries the buildbox toolchain: kernel/config:5 CONFIG_CC_VERSION_TEXT="clang version 22.1.6", :8 CONFIG_CLANG_VERSION=220106, :13 CONFIG_LLD_VERSION=220106, :335 CONFIG_RUSTC_VERSION_TEXT="rustc 1.97.1 (8bab26f4f 2026-07-14)". The build uses nixpkgs' llvmPackages and rustc (:159-171), so it fails unless those match to the patch level, and every nixpkgs bump that moves clang or rustc breaks the kernel build with "kernel/config is not this source's aurora_defconfig". Drop the toolchain-derived symbols from both sides before comparing (CC_VERSION_TEXT, *_VERSION, *_VERSION_TEXT, CC_IS_*, LD_IS_*, CC_HAS_*, AS_HAS_*, RUSTC_*, BINDGEN_*, TOOLS_SUPPORT_*), or generate the snapshot inside the Nix build environment and say so in provenance.json.
  3. It cannot land yet and has never been built: linux#2292 is still an open draft, provenance.json records its PR head 36faebf3 rather than a commit on the pinned branch, evaluate fails on this head, and the body says nix build / nix flake check were not run. Keep it in draft until #2292 merges, then regenerate the snapshot from the pinned commit and build it.

(steam-packaging fails on the same provenance assert, so it clears with the pin.)

HW row: with the pin bump that includes #2292: nix flake check and nix build .#linux-aurora green, the configure-phase comparison passing on the Nix toolchain; boot the resulting NixOS image on a T8103/T600x Mac and the J700 (Neo): uname -r equals the pin version, Wi-Fi/BT, GPU and 3x deep s2idle on the Neo with the GPU alive after wake, 0 failed units / no new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

aurora-silicon/linux#2292 was closed without merging and replaced by aurora-silicon/linux#2803 (still a draft), so provenance.json's 36faebf3 is no longer a commit that will land: keep this in draft until #2803 merges, then regenerate kernel/config from the pinned commit and build it. Blockers 1 and 2 from the earlier review are still open at c3b428f: commit 560abc3 needs re-committing with a human Signed-off-by only (no Co-Authored-By trailer), and the configure-time check in pkgs/kernel.nix still compares the toolchain-detected symbols (CONFIG_CC_VERSION_TEXT, CONFIG_CLANG_VERSION, CONFIG_RUSTC_VERSION_TEXT and the rest).

This branch has not been deployed

No deployments
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.

2 participants