vendor-reset: fix build on Linux 6.12

`asm/unaligned.h` has been moved to `linux/unaligned.h` since
Linux v. 6.12 [^1]. This has broken the build for `vendor-reset`
on newer versions.

I've opened a PR with the upstream project [^2], but that has been
sitting unmerged on GitHub for a while now, so I decided to add the
fix temporarily using `fetchpatch` in the NixOS module for now.
When it will (hopefully) eventually be merged, we should be able to
remove the patch and just switch to an up-to-date upstream version.

[^1]: https://github.com/torvalds/linux/commit/5f60d5f6bbc12e782fac78110b0ee62698f3b576
[^2]: https://github.com/gnif/vendor-reset/pull/86

authored by Manuel Frischknecht and committed by Alyssa Ross ef788d47 38bbe73f

+64
+8
pkgs/os-specific/linux/vendor-reset/default.nix
··· 17 17 hash = "sha256-Klu2uysbF5tH7SqVl815DwR7W+Vx6PyVDDLwoMZiqBI="; 18 18 }; 19 19 20 + patches = [ 21 + # This is a temporary, vendored version of this upstream PR: 22 + # https://github.com/gnif/vendor-reset/pull/86 23 + # As soon as it is merged, we should be able to update this 24 + # module and remove the patch. 25 + ./fix-linux-6.12-build.patch 26 + ]; 27 + 20 28 nativeBuildInputs = kernel.moduleBuildDependencies; 21 29 22 30 hardeningDisable = [ "pic" ];
+56
pkgs/os-specific/linux/vendor-reset/fix-linux-6.12-build.patch
··· 1 + From ab1b34848097587aca1f248958358ddb1dc90917 Mon Sep 17 00:00:00 2001 2 + From: mfrischknecht <manuel.frischknecht@gmail.com> 3 + Date: Sat, 23 Nov 2024 23:43:53 +0100 4 + Subject: [PATCH 1/2] Import `unaligned.h` from `linux` 5 + 6 + `asm/unaligned.h` has been moved to `linux/unaligned.h` since Linux v. 6.12. 7 + C.f. e.g. https://github.com/torvalds/linux/commit/5f60d5f6bbc12e782fac78110b0ee62698f3b576 8 + --- 9 + src/amd/amdgpu/atom.c | 2 +- 10 + 1 file changed, 1 insertion(+), 1 deletion(-) 11 + 12 + diff --git a/src/amd/amdgpu/atom.c b/src/amd/amdgpu/atom.c 13 + index 333961f..d14c849 100644 14 + --- a/src/amd/amdgpu/atom.c 15 + +++ b/src/amd/amdgpu/atom.c 16 + @@ -29,7 +29,7 @@ 17 + #include <linux/slab.h> 18 + #include <linux/delay.h> 19 + #include <linux/version.h> 20 + -#include <asm/unaligned.h> 21 + +#include <linux/unaligned.h> 22 + 23 + //#include <drm/drm_util.h> 24 + //#include <drm/drm_print.h> 25 + 26 + From 54ffd6a012e7567b0288bc5fcc3678b545bd5aec Mon Sep 17 00:00:00 2001 27 + From: mfrischknecht <manuel.frischknecht@gmail.com> 28 + Date: Wed, 27 Nov 2024 07:09:37 +0100 29 + Subject: [PATCH 2/2] Make new include path conditional 30 + MIME-Version: 1.0 31 + Content-Type: text/plain; charset=UTF-8 32 + Content-Transfer-Encoding: 8bit 33 + 34 + …so the module builds for both kernels below 6.12 and above. Thanks, @VoodaGod! 35 + 36 + Co-authored-by: Jason Rensburger <l33tjas.0n@gmail.com> 37 + --- 38 + src/amd/amdgpu/atom.c | 4 ++++ 39 + 1 file changed, 4 insertions(+) 40 + 41 + diff --git a/src/amd/amdgpu/atom.c b/src/amd/amdgpu/atom.c 42 + index d14c849..36d45ff 100644 43 + --- a/src/amd/amdgpu/atom.c 44 + +++ b/src/amd/amdgpu/atom.c 45 + @@ -29,7 +29,11 @@ 46 + #include <linux/slab.h> 47 + #include <linux/delay.h> 48 + #include <linux/version.h> 49 + +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0) 50 + +#include <asm/unaligned.h> 51 + +#else 52 + #include <linux/unaligned.h> 53 + +#endif 54 + 55 + //#include <drm/drm_util.h> 56 + //#include <drm/drm_print.h>