Skip to content

raspberry-pi: add structuredExtraConfig for vendor kernel#1841

Open
JamieMagee wants to merge 1 commit intoNixOS:masterfrom
JamieMagee:raspberry-pi/structuredExtraConfig-only
Open

raspberry-pi: add structuredExtraConfig for vendor kernel#1841
JamieMagee wants to merge 1 commit intoNixOS:masterfrom
JamieMagee:raspberry-pi/structuredExtraConfig-only

Conversation

@JamieMagee
Copy link
Copy Markdown
Member

@JamieMagee JamieMagee commented Apr 24, 2026

Override nixpkgs common-config.nix defaults that conflict with RPi vendor defconfigs. Without these, the kernel config silently diverges from what the vendor defconfig intends.

Config Value Why
LOCALVERSION "" vendor sets -v7/-v8/-v8-16k, which breaks modDirVersion
NR_CPUS 4 nixpkgs sets 384; RPi has 4 cores
CMA_SIZE_MBYTES 5 nixpkgs sets 32; vendor default is 5
PREEMPT yes (Pi 3+ only) arm64 vendor defconfigs use full preempt
PREEMPT_VOLUNTARY no (Pi 3+ only) arm32 defconfigs use voluntary, which matches nixpkgs
NFS_FS, NFS_V4, ROOT_NFS yes NFS root boot support
IP_PNP, IP_PNP_DHCP, IP_PNP_RARP yes needed for NFS root
NET_CLS_BPF, NLS_CODEPAGE_437 yes vendor builds these in, not as modules
FB_SIMPLE yes simple framebuffer

The LOCALVERSION override replaces the old postConfigure sed hack that cleared CONFIG_LOCALVERSION from .config and auto.conf after configure.

Ref: https://github.com/raspberrypi/linux/tree/rpi-6.12.y/arch/arm64/configs

Things done
  • Tested the changes in your own NixOS Configuration
  • Tested the changes end-to-end by using your fork of nixos-hardware and
    importing it via <nixos-hardware> or Flake input

@JamieMagee JamieMagee force-pushed the raspberry-pi/structuredExtraConfig-only branch 2 times, most recently from b388d7f to 69bc87c Compare April 24, 2026 22:55
Override nixpkgs common-config.nix defaults that conflict with RPi
vendor defconfigs (bcmrpi/bcm2709/bcm2711/bcm2712):

- NR_CPUS: 4 (nixpkgs sets 384; RPi has 4 cores)
- CMA_SIZE_MBYTES: 5 (nixpkgs sets 32; vendor default is 5)
- LOCALVERSION: cleared (vendor sets -v7/-v8/-v8-16k which breaks
  modDirVersion; replaces the postConfigure sed hack)
- PREEMPT/PREEMPT_VOLUNTARY: full preempt per vendor defconfig (Pi 3+ only;
  arm32 defconfigs use voluntary preempt which matches nixpkgs default)
- NFS root boot: NFS_FS, NFS_V4, ROOT_NFS, IP_PNP, IP_PNP_DHCP, IP_PNP_RARP
- NET_CLS_BPF, NLS_CODEPAGE_437: built-in instead of module
- FB_SIMPLE: simple framebuffer

Ref: https://github.com/raspberrypi/linux/tree/rpi-6.12.y/arch/arm64/configs
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