1{ lib, fetchpatch, fetchurl }:
2
3{
4 ath_regd_optional = rec {
5 name = "ath_regd_optional";
6 patch = fetchpatch {
7 name = name + ".patch";
8 url = "https://github.com/openwrt/openwrt/raw/ed2015c38617ed6624471e77f27fbb0c58c8c660/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch";
9 sha256 = "1ssDXSweHhF+pMZyd6kSrzeW60eb6MO6tlf0il17RC0=";
10 postFetch = ''
11 sed -i 's/CPTCFG_/CONFIG_/g' $out
12 sed -i '/--- a\/local-symbols/,$d' $out
13 '';
14 };
15 };
16
17 bridge_stp_helper =
18 { name = "bridge-stp-helper";
19 patch = ./bridge-stp-helper.patch;
20 };
21
22 # Reverts the buggy commit causing https://bugzilla.kernel.org/show_bug.cgi?id=217802
23 dell_xps_regression = {
24 name = "dell_xps_regression";
25 patch = fetchpatch {
26 name = "Revert-101bd907b424-misc-rtsx-judge-ASPM-Mode-to-set.patch";
27 url = "https://raw.githubusercontent.com/openSUSE/kernel-source/1b02b1528a26f4e9b577e215c114d8c5e773ee10/patches.suse/Revert-101bd907b424-misc-rtsx-judge-ASPM-Mode-to-set.patch";
28 sha256 = "sha256-RHJdQ4p0msTOVPR+/dYiKuwwEoG9IpIBqT4dc5cJjf8=";
29 };
30 };
31
32 request_key_helper =
33 { name = "request-key-helper";
34 patch = ./request-key-helper.patch;
35 };
36
37 request_key_helper_updated =
38 { name = "request-key-helper-updated";
39 patch = ./request-key-helper-updated.patch;
40 };
41
42 modinst_arg_list_too_long =
43 { name = "modinst-arglist-too-long";
44 patch = ./modinst-arg-list-too-long.patch;
45 };
46
47 hardened = let
48 mkPatch = kernelVersion: { version, sha256, patch }: let src = patch; in {
49 name = lib.removeSuffix ".patch" src.name;
50 patch = fetchurl (lib.filterAttrs (k: v: k != "extra") src);
51 extra = src.extra;
52 inherit version sha256;
53 };
54 patches = lib.importJSON ./hardened/patches.json;
55 in lib.mapAttrs mkPatch patches;
56
57 # Adapted for Linux 5.4 from:
58 # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=04896832c94aae4842100cafb8d3a73e1bed3a45
59 rtl8761b_support =
60 { name = "rtl8761b-support";
61 patch = ./rtl8761b-support.patch;
62 };
63
64 export-rt-sched-migrate = {
65 name = "export-rt-sched-migrate";
66 patch = ./export-rt-sched-migrate.patch;
67 };
68
69 rust_1_75 = {
70 name = "rust-1.75.patch";
71 patch = ./rust-1.75.patch;
72 };
73
74 rust_1_76 = {
75 name = "rust-1.76.patch";
76 patch = fetchurl {
77 name = "rust-1.76.patch";
78 url = "https://lore.kernel.org/rust-for-linux/20240217002638.57373-2-ojeda@kernel.org/raw";
79 hash = "sha256-q3iNBo8t4b1Rn5k5lau2myqOAqdA/9V9A+ok2jGkLdY=";
80 };
81 };
82
83 rust_1_77-6_8 = {
84 name = "rust-1.77.patch";
85 patch = ./rust-1.77-6.8.patch;
86 };
87
88 rust_1_77-6_9 = {
89 name = "rust-1.77.patch";
90 patch = ./rust-1.77.patch;
91 };
92
93 rust_1_78 = {
94 name = "rust-1.78.patch";
95 patch = fetchpatch {
96 name = "rust-1.78.patch";
97 url = "https://lore.kernel.org/rust-for-linux/20240401212303.537355-4-ojeda@kernel.org/raw";
98 excludes = [ "Documentation/process/changes.rst" ]; # Conflicts on 6.8.
99 hash = "sha256-EZ+Qa9z1AtAv08e72M7BEsCZi9UK572gmW+AR62a8EM=";
100 };
101 };
102}