1{
2 lib,
3 fetchpatch,
4 fetchurl,
5}:
6
7{
8 ath_regd_optional = rec {
9 name = "ath_regd_optional";
10 patch = fetchpatch {
11 name = name + ".patch";
12 url = "https://github.com/openwrt/openwrt/raw/ed2015c38617ed6624471e77f27fbb0c58c8c660/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch";
13 sha256 = "1ssDXSweHhF+pMZyd6kSrzeW60eb6MO6tlf0il17RC0=";
14 postFetch = ''
15 sed -i 's/CPTCFG_/CONFIG_/g' $out
16 sed -i '/--- a\/local-symbols/,$d' $out
17 '';
18 };
19 };
20
21 bridge_stp_helper = {
22 name = "bridge-stp-helper";
23 patch = ./bridge-stp-helper.patch;
24 };
25
26 # Reverts the buggy commit causing https://bugzilla.kernel.org/show_bug.cgi?id=217802
27 dell_xps_regression = {
28 name = "dell_xps_regression";
29 patch = fetchpatch {
30 name = "Revert-101bd907b424-misc-rtsx-judge-ASPM-Mode-to-set.patch";
31 url = "https://raw.githubusercontent.com/openSUSE/kernel-source/1b02b1528a26f4e9b577e215c114d8c5e773ee10/patches.suse/Revert-101bd907b424-misc-rtsx-judge-ASPM-Mode-to-set.patch";
32 sha256 = "sha256-RHJdQ4p0msTOVPR+/dYiKuwwEoG9IpIBqT4dc5cJjf8=";
33 };
34 };
35
36 request_key_helper = {
37 name = "request-key-helper";
38 patch = ./request-key-helper.patch;
39 };
40
41 request_key_helper_updated = {
42 name = "request-key-helper-updated";
43 patch = ./request-key-helper-updated.patch;
44 };
45
46 hardened =
47 let
48 mkPatch =
49 kernelVersion:
50 {
51 version,
52 sha256,
53 patch,
54 }:
55 let
56 src = patch;
57 in
58 {
59 name = lib.removeSuffix ".patch" src.name;
60 patch = fetchurl (lib.filterAttrs (k: v: k != "extra") src);
61 extra = src.extra;
62 inherit version sha256;
63 };
64 patches = lib.importJSON ./hardened/patches.json;
65 in
66 lib.mapAttrs mkPatch patches;
67
68 # Adapted for Linux 5.4 from:
69 # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=04896832c94aae4842100cafb8d3a73e1bed3a45
70 rtl8761b_support = {
71 name = "rtl8761b-support";
72 patch = ./rtl8761b-support.patch;
73 };
74
75 export-rt-sched-migrate = {
76 name = "export-rt-sched-migrate";
77 patch = ./export-rt-sched-migrate.patch;
78 };
79}