summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel/manual-config.nix
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2022-09-23 14:23:31 -0700
committerRick van Schijndel <Mindavi@users.noreply.github.com>2023-01-06 15:59:38 +0100
commit88e32095e196a3baee6189bb87024a60b03072e5 (patch)
tree89d418c0356905f0d27adbe627a13267b4db9637 /pkgs/os-specific/linux/kernel/manual-config.nix
parent61ca853b1ebd83022155dbfba2f33ce3d41f22d7 (diff)
downloadnixpkgs-88e32095e196a3baee6189bb87024a60b03072e5.tar
nixpkgs-88e32095e196a3baee6189bb87024a60b03072e5.tar.gz
nixpkgs-88e32095e196a3baee6189bb87024a60b03072e5.tar.bz2
nixpkgs-88e32095e196a3baee6189bb87024a60b03072e5.tar.lz
nixpkgs-88e32095e196a3baee6189bb87024a60b03072e5.tar.xz
nixpkgs-88e32095e196a3baee6189bb87024a60b03072e5.tar.zst
nixpkgs-88e32095e196a3baee6189bb87024a60b03072e5.zip
linux/kernel: backport symbol GPLification fix from 5.19
Linux has a few PowerPC-specific symbols which are marked as GPL exports; these
symbols wound up being exposed in Linux 5.12 and are needed by OpenZFS.  The
symbol licensing was fixed in mainline 5.19; this commit backports the fix to
all previous affected kernels.

This commit is required in order to build the NixOS ISO for PowerPC64.
Diffstat (limited to 'pkgs/os-specific/linux/kernel/manual-config.nix')
-rw-r--r--pkgs/os-specific/linux/kernel/manual-config.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix
index 45281d5d3bd..310178b9a1f 100644
--- a/pkgs/os-specific/linux/kernel/manual-config.nix
+++ b/pkgs/os-specific/linux/kernel/manual-config.nix
@@ -1,5 +1,6 @@
 { lib, stdenv, buildPackages, runCommand, nettools, bc, bison, flex, perl, rsync, gmp, libmpc, mpfr, openssl
 , libelf, cpio, elfutils, zstd, python3Minimal, zlib, pahole
+, fetchpatch
 }:
 
 let
@@ -103,7 +104,17 @@ let
         ++ optional (lib.versionOlder version "5.19") ./randstruct-provide-seed.patch
         ++ optional (lib.versionAtLeast version "5.19") ./randstruct-provide-seed-5.19.patch
         # Fixes determinism by normalizing metadata for the archive of kheaders
-        ++ optional (lib.versionAtLeast version "5.2" && lib.versionOlder version "5.4") ./gen-kheaders-metadata.patch;
+        ++ optional (lib.versionAtLeast version "5.2" && lib.versionOlder version "5.4") ./gen-kheaders-metadata.patch
+        # Linux 5.12 marked certain PowerPC-only symbols as GPL, which breaks
+        # OpenZFS; this was fixed in Linux 5.19 so we backport the fix
+        # https://github.com/openzfs/zfs/pull/13367
+        ++ optional (lib.versionAtLeast version "5.12" &&
+                     lib.versionOlder version "5.19" &&
+                     stdenv.hostPlatform.isPower)
+          (fetchpatch {
+            url = "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/patch/?id=d9e5c3e9e75162f845880535957b7fd0b4637d23";
+            hash = "sha256-bBOyJcP6jUvozFJU0SPTOf3cmnTQ6ZZ4PlHjiniHXLU=";
+          });
 
       postPatch = ''
         sed -i Makefile -e 's|= depmod|= ${buildPackages.kmod}/bin/depmod|'