From ae243122dd698069960df976ff282b5e01eb2062 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Tue, 5 May 2026 09:04:02 -0700 Subject: [PATCH] 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. --- raspberry-pi/common/kernel.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/raspberry-pi/common/kernel.nix b/raspberry-pi/common/kernel.nix index 6bf1d9d2..154bf93e 100644 --- a/raspberry-pi/common/kernel.nix +++ b/raspberry-pi/common/kernel.nix @@ -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