Skip to content

Commit 6246ea0

Browse files
msi-ec-kmods: 0-unstable-2024-11-04 -> 0-unstable-2025-05-17 (#408046)
2 parents 11c910b + 9869108 commit 6246ea0

File tree

2 files changed

+44
-4
lines changed

2 files changed

+44
-4
lines changed

pkgs/os-specific/linux/msi-ec/default.nix

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,21 @@
99
}:
1010
stdenv.mkDerivation {
1111
pname = "msi-ec-kmods";
12-
version = "0-unstable-2024-11-04";
12+
version = "0-unstable-2025-05-17";
1313

1414
src = fetchFromGitHub {
1515
owner = "BeardOverflow";
1616
repo = "msi-ec";
17-
rev = "be6f7156cd15f6ecf9d48dfcc30cbd1f693916b8";
18-
hash = "sha256-gImiP4OaBt80n+qgVnbhd0aS/zW+05o3DzGCw0jq+0g=";
17+
rev = "796be9047b13c311ac4cdec33913775f4057f600";
18+
hash = "sha256-npJbnWFBVb8TK9ynVD/kXWq2iqO0ACKF4UYsu5mQuok=";
1919
};
2020

2121
dontMakeSourcesWritable = false;
2222

23-
patches = [ ./patches/makefile.patch ];
23+
patches = [
24+
./patches/makefile.patch
25+
./patches/kernel-string-choices.patch
26+
];
2427

2528
hardeningDisable = [ "pic" ];
2629

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
--- a/msi-ec.c
2+
+++ b/msi-ec.c
3+
@@ -38,7 +38,12 @@
4+
#include <linux/slab.h>
5+
#include <linux/version.h>
6+
#include <linux/rtc.h>
7+
-#include <linux/string_choices.h>
8+
+
9+
+#include <linux/version.h>
10+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,6,0)
11+
+#include <linux/string_choices.h>
12+
+#endif
13+
+
14+
15+
static DEFINE_MUTEX(ec_set_by_mask_mutex);
16+
static DEFINE_MUTEX(ec_unset_by_mask_mutex);
17+
@@ -1141,6 +1146,20 @@ static struct msi_ec_conf CONF52 __initdata = {
18+
},
19+
};
20+
21+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0)
22+
+/* Define our own string choice helpers for older kernels */
23+
+static inline const char *str_on_off(bool v)
24+
+{
25+
+ return v ? "on" : "off";
26+
+}
27+
+
28+
+static inline const char *str_yes_no(bool v)
29+
+{
30+
+ return v ? "yes" : "no";
31+
+}
32+
+#endif
33+
+
34+
+
35+
static struct msi_ec_conf *CONFIGURATIONS[] __initdata = {
36+
&CONF0,
37+
&CONF1,

0 commit comments

Comments
 (0)