mirror of
https://github.com/bartvdbraak/dotfiles.git
synced 2025-04-27 14:41:20 +00:00
Consolidate changes
This commit is contained in:
parent
a7b77a4555
commit
d619c52e04
3 changed files with 12 additions and 37 deletions
|
@ -5,7 +5,7 @@
|
|||
|
||||
let
|
||||
yt6801 = import ./yt6801/default.nix {
|
||||
inherit (pkgs) lib stdenv fetchzip nukeReferences bc;
|
||||
inherit (pkgs) lib stdenv fetchFromGitHub nukeReferences bc;
|
||||
kernel = pkgs.linuxPackages.kernel;
|
||||
};
|
||||
in
|
||||
|
|
|
@ -1,17 +1,21 @@
|
|||
{ lib, stdenv, fetchzip, nukeReferences, bc, kernel }:
|
||||
{ lib, stdenv, fetchFromGitHub, nukeReferences, bc, kernel }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "yt6801";
|
||||
version = "1.0.29";
|
||||
name = "${pname}-${version}-${kernel.version}";
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://www.motor-comm.com/Public/Uploads/uploadfile/files/20240812/yt6801-linux-driver-${version}.zip";
|
||||
sha256 = "sha256-oz6CeOUN6QWKXxe3WUZljhGDTFArsknjzBuQ4IchGeU=";
|
||||
stripRoot = false;
|
||||
src = fetchFromGitHub {
|
||||
owner = "bartvdbraak";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-VEBwcbJcLffIIAP+NIhjiuMkfR+PKybBDnIbxY6zBMA=";
|
||||
};
|
||||
|
||||
patches = [ "./src_makefile.patch" ];
|
||||
patchPhase = ''
|
||||
substituteInPlace ./src/Makefile \
|
||||
--replace-fail 'KSRC_BASE = /lib/modules/$(shell uname -r)' "KSRC_BASE = ${KERNELDIR}"
|
||||
'';
|
||||
|
||||
hardeningDisable = [ "pic" "format" ];
|
||||
KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}";
|
||||
|
@ -20,17 +24,13 @@ stdenv.mkDerivation rec {
|
|||
preBuild = "cd src";
|
||||
buildFlags = [ "modules" ];
|
||||
|
||||
patchPhase = ''
|
||||
substituteInPlace ./src/Makefile \
|
||||
--replace-fail 'KSRC_BASE = /lib/modules/$(shell uname -r)' "KSRC_BASE = ${KERNELDIR}"
|
||||
'';
|
||||
makeFlags = [
|
||||
"ARCH=${stdenv.hostPlatform.linuxArch}"
|
||||
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
||||
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
||||
];
|
||||
|
||||
INSTALL_MOD_PATH = placeholder "out";
|
||||
installFlags = [ "INSTALL_MOD_PATH=${placeholder "out"}" ];
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = with lib; {
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
diff --git a/src/Makefile b/src/Makefile
|
||||
index 9b29b47..552558e 100755
|
||||
--- a/src/Makefile
|
||||
+++ b/src/Makefile
|
||||
@@ -32,20 +32,10 @@ modules:
|
||||
make -C $(KSRC) M=$(PWD) modules
|
||||
|
||||
install:
|
||||
- @echo "KFILE: " $(KFILE)
|
||||
- @echo "KDST: " $(KDST)
|
||||
make -C $(KSRC) M=$(PWD) INSTALL_MOD_DIR=$(KDST) modules_install
|
||||
- sudo ls -l $(ko_dir)
|
||||
- depmod $(shell uname -r)
|
||||
- modprobe $(KFILE)
|
||||
- @file $(ko_full)
|
||||
- @echo install done.
|
||||
- @modinfo $(ko_full)
|
||||
|
||||
uninstall:
|
||||
- sudo ls -l $(ko_dir)
|
||||
sudo rm $(ko_full)
|
||||
- sudo ls -l $(ko_dir)
|
||||
|
||||
clean:
|
||||
make -C $(KSRC) M=$(PWD) clean
|
Loading…
Reference in a new issue