Skip to content

Commit

Permalink
msi-ec: 0-unstable-2024-09-19 -> 0-unstable-2024-11-04
Browse files Browse the repository at this point in the history
  • Loading branch information
m1dugh committed Nov 4, 2024
1 parent 7c7453a commit 835bbbd
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 40 deletions.
17 changes: 4 additions & 13 deletions pkgs/os-specific/linux/msi-ec/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,18 @@
}:
stdenv.mkDerivation {
pname = "msi-ec-kmods";
version = "0-unstable-2024-09-19";
version = "0-unstable-2024-11-04";

src = fetchFromGitHub {
owner = "BeardOverflow";
repo = "msi-ec";
rev = "94c2a45c04a07096e10d7cb1240e1a201a025dc0";
hash = "sha256-amJUoIf5Sl62BLyHLeam2fzN1s+APoWh2dH5QVfJhCs=";
rev = "be6f7156cd15f6ecf9d48dfcc30cbd1f693916b8";
hash = "sha256-gImiP4OaBt80n+qgVnbhd0aS/zW+05o3DzGCw0jq+0g=";
};

dontMakeSourcesWritable = false;

postPatch =
let
targets = builtins.filter (v: v != "") [
(lib.strings.optionalString (kernel.kernelOlder "6.2") "older-kernel-patch")
(lib.strings.optionalString (kernel.kernelAtLeast "6.11") "6.11-kernel-patch")
];
commands = builtins.map (target: "make ${target}") targets;
in
lib.concatStringsSep "\n" ([ "cp ${./patches/Makefile} ./Makefile" ] ++ commands);
patches = [ ./patches/makefile.patch ];

hardeningDisable = [ "pic" ];

Expand All @@ -48,6 +40,5 @@ stdenv.mkDerivation {
license = lib.licenses.gpl2Plus;
maintainers = [ lib.maintainers.m1dugh ];
platforms = lib.platforms.linux;
broken = kernel.kernelOlder "6.2";
};
}
27 changes: 0 additions & 27 deletions pkgs/os-specific/linux/msi-ec/patches/Makefile

This file was deleted.

28 changes: 28 additions & 0 deletions pkgs/os-specific/linux/msi-ec/patches/makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/Makefile b/Makefile
index bffcbd4..fd1d8a3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
VERSION := 0.08
DKMS_ROOT_PATH := /usr/src/msi_ec-$(VERSION)
TARGET ?= $(shell uname -r)
+KERNELDIR ?= /lib/modules/$(TARGET)/build/

ccflags-y := -std=gnu11 -Wno-declaration-after-statement

@@ -10,11 +11,14 @@ obj-m += msi-ec.o
all: modules

modules:
- @$(MAKE) -C /lib/modules/$(TARGET)/build M=$(CURDIR) modules
+ @$(MAKE) -C $(KERNELDIR) M=$(CURDIR) modules

clean:
@$(MAKE) -C /lib/modules/$(TARGET)/build M=$(CURDIR) clean

+modules_install:
+ @$(MAKE) -C $(KERNELDIR) M=$(CURDIR) modules_install
+
load:
insmod msi-ec.ko

0 comments on commit 835bbbd

Please sign in to comment.