Merge pull request #1860 from JamieMagee/raspberry-pi/fix-localversion-modDirVersion

raspberry-pi: fix empty LOCALVERSION breaking modDirVersion
This commit is contained in:
Doron Behar 2026-05-07 08:49:21 +00:00 committed by GitHub
commit 3bcaa367d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,10 +54,6 @@ in
# Override nixpkgs common-config.nix defaults that conflict with the RPi vendor defconfigs. # 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 # See: https://github.com/raspberrypi/linux/tree/rpi-6.12.y/arch/arm64/configs
structuredExtraConfig = { 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 # RPi has 4 cores; nixpkgs common-config sets 384
NR_CPUS = lib.mkForce (freeform "4"); NR_CPUS = lib.mkForce (freeform "4");
# nixpkgs sets 32MB; RPi vendor defconfig uses 5MB # nixpkgs sets 32MB; RPi vendor defconfig uses 5MB
@ -99,6 +95,13 @@ in
// (args.argsOverride or { }) // (args.argsOverride or { })
)).overrideAttrs )).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 # The vendor kernel uses different DTB names (bcm2708/bcm2709/bcm2710) than what
# U-Boot expects (bcm2835/bcm2836/bcm2837). Starting with Pi 4, names match. # 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 # See: https://github.com/u-boot/u-boot/blob/master/board/raspberrypi/rpi/rpi.c