Skip to content

raspberry-pi: fix empty LOCALVERSION breaking modDirVersion - #1860

Merged
doronbehar merged 1 commit into
NixOS:masterfrom
JamieMagee:raspberry-pi/fix-localversion-modDirVersion
May 7, 2026
Merged

doronbehar merged 1 commit into
NixOS:masterfrom
JamieMagee:raspberry-pi/fix-localversion-modDirVersion

Conversation

@JamieMagee

Copy link
Copy Markdown
Member
Description of changes

#1841 dropped the postConfigure sed in favour of LOCALVERSION = freeform "";, but freeform "" can't emit a real empty string through nixpkgs mkValue. It renders as the literal two-char string "", so CONFIG_LOCALVERSION="\"\"", modDirVersion becomes 6.12.75"", and the build fails the sanity check.

This restores the original two-line sed in postConfigure (matching nixpkgs' own linux-rpi.nix) and drops the broken LOCALVERSION entry. All other vendor-defconfig overrides from #1841 (NR_CPUS, CMA_SIZE_MBYTES, NFS_*, PREEMPT, etc.) are kept.

Fixes #1859.

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

Comment thread raspberry-pi/common/kernel.nix Resolved

@doronbehar doronbehar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How exactly do you test this?

Comment thread raspberry-pi/common/kernel.nix Resolved
Comment thread raspberry-pi/common/kernel.nix Resolved
freeform "" can't emit an empty string through nixpkgs mkValue; it renders as the literal "", so CONFIG_LOCALVERSION ends up two chars and modDirVersion becomes 6.12.75"". Bring back the sed from before NixOS#1841.

Fixes NixOS#1859.
@JamieMagee
JamieMagee force-pushed the raspberry-pi/fix-localversion-modDirVersion branch from 1dab862 to ae24312 Compare May 5, 2026 20:35
@JamieMagee

Copy link
Copy Markdown
Member Author

@doronbehar I didn't test this thoroughly, as its just a revert commit.

@hatch01

hatch01 commented May 7, 2026

Copy link
Copy Markdown
Contributor

I finally built it successfully after '18h52m7s'.

@doronbehar
doronbehar added this pull request to the merge queue May 7, 2026
Merged via the queue into NixOS:master with commit 3bcaa36 May 7, 2026
2 checks passed
@JamieMagee
JamieMagee deleted the raspberry-pi/fix-localversion-modDirVersion branch May 7, 2026 13:31
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.

Error in modDirVersion check for Raspberry Pi kernel

3 participants