mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2026-12-04 15:03:29 +01:00
raspberry-pi: replace lib.overrideDerivation with .overrideAttrs
lib.overrideDerivation is deprecated and strips passthru attributes (.configfile, .moduleBuildDependencies, etc.) from the kernel derivation, which breaks downstream users expecting a standard buildLinux output. .overrideAttrs preserves passthru and matches every other custom kernel in this repo.
This commit is contained in:
1 parent
2096f3f411
commit
d7514338e2
1 file changed
+47
-48
@@ -14,58 +14,57 @@ let
|
|||||||
tag = "stable_20250916";
|
tag = "stable_20250916";
|
||||||
hash = "sha256-HG8Oc04V2t54l0SOn4gKmNJWQUrZfjWusgKcWvx74H0==";
|
hash = "sha256-HG8Oc04V2t54l0SOn4gKmNJWQUrZfjWusgKcWvx74H0==";
|
||||||
in
|
in
|
||||||
lib.overrideDerivation
|
(buildLinux (
|
||||||
(buildLinux (
|
args
|
||||||
args
|
// {
|
||||||
// {
|
version = "${modDirVersion}-${tag}";
|
||||||
version = "${modDirVersion}-${tag}";
|
inherit modDirVersion;
|
||||||
inherit modDirVersion;
|
pname = "linux-rpi";
|
||||||
pname = "linux-rpi";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "raspberrypi";
|
owner = "raspberrypi";
|
||||||
repo = "linux";
|
repo = "linux";
|
||||||
inherit tag hash;
|
inherit tag hash;
|
||||||
};
|
};
|
||||||
|
|
||||||
defconfig =
|
defconfig =
|
||||||
{
|
{
|
||||||
"1" = "bcmrpi_defconfig";
|
"1" = "bcmrpi_defconfig";
|
||||||
"2" = "bcm2709_defconfig";
|
"2" = "bcm2709_defconfig";
|
||||||
"3" = if stdenv.hostPlatform.isAarch64 then "bcm2711_defconfig" else "bcm2709_defconfig";
|
"3" = if stdenv.hostPlatform.isAarch64 then "bcm2711_defconfig" else "bcm2709_defconfig";
|
||||||
"4" = "bcm2711_defconfig";
|
"4" = "bcm2711_defconfig";
|
||||||
"5" = "bcm2712_defconfig";
|
"5" = "bcm2712_defconfig";
|
||||||
}
|
|
||||||
.${toString rpiVersion};
|
|
||||||
|
|
||||||
features = {
|
|
||||||
efiBootStub = false;
|
|
||||||
}
|
}
|
||||||
// (args.features or { });
|
.${toString rpiVersion};
|
||||||
|
|
||||||
isLTS = true;
|
features = {
|
||||||
|
efiBootStub = false;
|
||||||
kernelPatches = with pkgs.kernelPatches; [
|
|
||||||
bridge_stp_helper
|
|
||||||
request_key_helper
|
|
||||||
];
|
|
||||||
|
|
||||||
extraMeta =
|
|
||||||
if (rpiVersion < 3) then
|
|
||||||
{
|
|
||||||
platforms = with lib.platforms; lib.intersectLists arm linux;
|
|
||||||
hydraPlatforms = [ ];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
platforms = with lib.platforms; lib.intersectLists (arm ++ aarch64) linux;
|
|
||||||
hydraPlatforms = [ "aarch64-linux" ];
|
|
||||||
};
|
|
||||||
ignoreConfigErrors = true;
|
|
||||||
}
|
}
|
||||||
// (args.argsOverride or { })
|
// (args.features or { });
|
||||||
))
|
|
||||||
(_oldAttrs: {
|
isLTS = true;
|
||||||
|
|
||||||
|
kernelPatches = with pkgs.kernelPatches; [
|
||||||
|
bridge_stp_helper
|
||||||
|
request_key_helper
|
||||||
|
];
|
||||||
|
|
||||||
|
extraMeta =
|
||||||
|
if (rpiVersion < 3) then
|
||||||
|
{
|
||||||
|
platforms = with lib.platforms; lib.intersectLists arm linux;
|
||||||
|
hydraPlatforms = [ ];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
platforms = with lib.platforms; lib.intersectLists (arm ++ aarch64) linux;
|
||||||
|
hydraPlatforms = [ "aarch64-linux" ];
|
||||||
|
};
|
||||||
|
ignoreConfigErrors = true;
|
||||||
|
}
|
||||||
|
// (args.argsOverride or { })
|
||||||
|
)).overrideAttrs
|
||||||
|
{
|
||||||
postConfigure = ''
|
postConfigure = ''
|
||||||
# The v7 defconfig has this set to '-v7' which screws up our modDirVersion.
|
# 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/.config -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/'
|
||||||
@@ -110,4 +109,4 @@ lib.overrideDerivation
|
|||||||
copyDTB bcm2710-rpi-cm3.dtb bcm2837-rpi-cm3.dtb
|
copyDTB bcm2710-rpi-cm3.dtb bcm2837-rpi-cm3.dtb
|
||||||
copyDTB bcm2711-rpi-4-b.dtb bcm2838-rpi-4-b.dtb
|
copyDTB bcm2711-rpi-4-b.dtb bcm2838-rpi-4-b.dtb
|
||||||
'';
|
'';
|
||||||
})
|
}
|
||||||
Reference in new issue
Block a user