mirror of
https://github.com/bartvdbraak/dotfiles.git
synced 2025-04-27 14:41:20 +00:00
Add fixes
This commit is contained in:
parent
f8ef5a9505
commit
a7b77a4555
3 changed files with 32 additions and 11 deletions
|
@ -4,7 +4,7 @@
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
yt6801 = import ./yt6801-driver.nix {
|
yt6801 = import ./yt6801/default.nix {
|
||||||
inherit (pkgs) lib stdenv fetchzip nukeReferences bc;
|
inherit (pkgs) lib stdenv fetchzip nukeReferences bc;
|
||||||
kernel = pkgs.linuxPackages.kernel;
|
kernel = pkgs.linuxPackages.kernel;
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,27 +6,23 @@ stdenv.mkDerivation rec {
|
||||||
name = "${pname}-${version}-${kernel.version}";
|
name = "${pname}-${version}-${kernel.version}";
|
||||||
|
|
||||||
src = fetchzip {
|
src = fetchzip {
|
||||||
url = "https://www.motor-comm.com/Public/Uploads/uploadfile/files/20240812/yt6801-linux-driver-1.0.29.zip";
|
url = "https://www.motor-comm.com/Public/Uploads/uploadfile/files/20240812/yt6801-linux-driver-${version}.zip";
|
||||||
sha256 = "sha256-oz6CeOUN6QWKXxe3WUZljhGDTFArsknjzBuQ4IchGeU=";
|
sha256 = "sha256-oz6CeOUN6QWKXxe3WUZljhGDTFArsknjzBuQ4IchGeU=";
|
||||||
stripRoot = false;
|
stripRoot = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
patches = [ "./src_makefile.patch" ];
|
||||||
|
|
||||||
hardeningDisable = [ "pic" "format" ];
|
hardeningDisable = [ "pic" "format" ];
|
||||||
KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}";
|
KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}";
|
||||||
nativeBuildInputs = [ bc ] ++ kernel.moduleBuildDependencies;
|
nativeBuildInputs = [ bc ] ++ kernel.moduleBuildDependencies;
|
||||||
|
|
||||||
preBuild = ''
|
preBuild = "cd src";
|
||||||
cd src
|
|
||||||
'';
|
|
||||||
buildFlags = [ "modules" ];
|
buildFlags = [ "modules" ];
|
||||||
|
|
||||||
patchPhase = ''
|
patchPhase = ''
|
||||||
substituteInPlace ./src/Makefile \
|
substituteInPlace ./src/Makefile \
|
||||||
--replace-fail 'KSRC_BASE = /lib/modules/$(shell uname -r)' "KSRC_BASE = ${KERNELDIR}" \
|
--replace-fail 'KSRC_BASE = /lib/modules/$(shell uname -r)' "KSRC_BASE = ${KERNELDIR}"
|
||||||
--replace-fail 'sudo ls -l $(ko_dir)' "" \
|
|
||||||
--replace-fail 'depmod $(shell uname -r)' "" \
|
|
||||||
--replace-fail 'modprobe $(KFILE)' "" \
|
|
||||||
--replace-fail '@modinfo $(ko_full)' ""
|
|
||||||
'';
|
'';
|
||||||
makeFlags = [
|
makeFlags = [
|
||||||
"ARCH=${stdenv.hostPlatform.linuxArch}"
|
"ARCH=${stdenv.hostPlatform.linuxArch}"
|
||||||
|
@ -39,7 +35,7 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Motorcomm yt6801 Network Interface Card (NIC) driver";
|
description = "Motorcomm yt6801 Network Interface Card (NIC) driver";
|
||||||
homepage = "https://www.motor-comm.com/";
|
homepage = "https://www.motor-comm.com/product/ethernet-control-chip";
|
||||||
license = licenses.gpl2Only;
|
license = licenses.gpl2Only;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
maintainers = with maintainers; [ bartvdbraak ];
|
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…
Reference in a new issue