raspberry-pi: restore postConfigure sed for LOCALVERSION

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 #1841.

Fixes #1859.
This commit is contained in:
Jamie Magee 2026-05-05 09:04:02 -07:00
parent df7783100b
commit ae243122dd

View file

@ -54,10 +54,6 @@ in
# Override nixpkgs common-config.nix defaults that conflict with the RPi vendor defconfigs.
# See: https://github.com/raspberrypi/linux/tree/rpi-6.12.y/arch/arm64/configs
structuredExtraConfig = {
# Vendor defconfigs set CONFIG_LOCALVERSION to -v7, -v8, -v8-16k, which
# breaks modDirVersion. Clear it.
LOCALVERSION = freeform "";
# RPi has 4 cores; nixpkgs common-config sets 384
NR_CPUS = lib.mkForce (freeform "4");
# nixpkgs sets 32MB; RPi vendor defconfig uses 5MB
@ -99,6 +95,13 @@ in
// (args.argsOverride or { })
)).overrideAttrs
{
# TODO: Put CONFIG_LOCALVERSION in `structuredExtraConfig` above once this is resolved:
# https://github.com/NixOS/nixpkgs/issues/516936
postConfigure = ''
sed -i $buildRoot/.config -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/'
sed -i $buildRoot/include/config/auto.conf -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/'
'';
# The vendor kernel uses different DTB names (bcm2708/bcm2709/bcm2710) than what
# U-Boot expects (bcm2835/bcm2836/bcm2837). Starting with Pi 4, names match.
# See: https://github.com/u-boot/u-boot/blob/master/board/raspberrypi/rpi/rpi.c