mirror of
https://github.com/bartvdbraak/dotfiles.git
synced 2025-06-29 12:49:10 +00:00
Add fixes
This commit is contained in:
parent
f8ef5a9505
commit
a7b77a4555
3 changed files with 32 additions and 11 deletions
43
tongfang/nixos/yt6801/default.nix
Normal file
43
tongfang/nixos/yt6801/default.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{ lib, stdenv, fetchzip, 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;
|
||||
};
|
||||
|
||||
patches = [ "./src_makefile.patch" ];
|
||||
|
||||
hardeningDisable = [ "pic" "format" ];
|
||||
KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}";
|
||||
nativeBuildInputs = [ bc ] ++ kernel.moduleBuildDependencies;
|
||||
|
||||
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";
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Motorcomm yt6801 Network Interface Card (NIC) driver";
|
||||
homepage = "https://www.motor-comm.com/product/ethernet-control-chip";
|
||||
license = licenses.gpl2Only;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ bartvdbraak ];
|
||||
};
|
||||
}
|
25
tongfang/nixos/yt6801/src_makefiles.patch
Normal file
25
tongfang/nixos/yt6801/src_makefiles.patch
Normal file
|
@ -0,0 +1,25 @@
|
|||
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…
Add table
Add a link
Reference in a new issue