From 554e00a5923d0183ef89aa1ebdffbb7564bfa034 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Sun, 3 May 2026 14:06:51 -0700 Subject: [PATCH] raspberry-pi: replace postConfigure sed hack with structuredExtraConfig Set CONFIG_LOCALVERSION via structuredExtraConfig instead of patching .config and auto.conf with sed after configure. The vendor defconfigs set -v7, -v8, -v8-16k which breaks modDirVersion. --- raspberry-pi/common/kernel.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/raspberry-pi/common/kernel.nix b/raspberry-pi/common/kernel.nix index 614bdba4..3fc3e519 100644 --- a/raspberry-pi/common/kernel.nix +++ b/raspberry-pi/common/kernel.nix @@ -12,6 +12,7 @@ let # NOTE: raspberryPiWirelessFirmware should be updated with this modDirVersion = "6.12.75"; hash = "sha256-qrljd20n4tj/7C7gzNnxw7JIyEF2Ppf1PWm2a7vxh1w="; + inherit (lib.kernel) freeform; in (buildLinux ( args @@ -50,6 +51,12 @@ in request_key_helper ]; + structuredExtraConfig = { + # Vendor defconfigs set CONFIG_LOCALVERSION to -v7, -v8, -v8-16k, which + # breaks modDirVersion. Clear it. + LOCALVERSION = freeform ""; + }; + extraMeta = if (rpiVersion < 3) then { @@ -66,12 +73,6 @@ in // (args.argsOverride or { }) )).overrideAttrs { - postConfigure = '' - # The v7 defconfig has this set to '-v7' which screws up our modDirVersion. - 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