File tree Expand file tree Collapse file tree 2 files changed +58
-0
lines changed
Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ lib ,
3+ stdenv ,
4+ fetchzip ,
5+ kmod ,
6+ kernel ,
7+ } :
8+
9+ let
10+ modDestDir = "$(out)/lib/modules/${ kernel . modDirVersion } /kernel/drivers/net/ethernet/motorcomm" ;
11+
12+ in
13+ stdenv . mkDerivation ( finalAttrs : {
14+ pname = "yt6801" ;
15+ version = "1.0.29-20240812" ;
16+
17+ src =
18+ let
19+ version-split = lib . strings . splitString "-" finalAttrs . version ;
20+ versionName = builtins . elemAt version-split 0 ;
21+ uploadDate = builtins . elemAt version-split 1 ;
22+ in
23+ fetchzip {
24+ stripRoot = false ;
25+ url = "https://www.motor-comm.com/Public/Uploads/uploadfile/files/${ uploadDate } /yt6801-linux-driver-${ versionName } .zip" ;
26+ sha256 = "sha256-oz6CeOUN6QWKXxe3WUZljhGDTFArsknjzBuQ4IchGeU=" ;
27+ } ;
28+
29+ nativeBuildInputs = kernel . moduleBuildDependencies ++ [ kmod ] ;
30+
31+ postPatch = ''
32+ substituteInPlace src/Makefile \
33+ --replace-fail "sudo ls -l" "ls -l" \
34+ --replace-fail 'depmod $(shell uname -r)' "" \
35+ --replace-fail 'modprobe $(KFILE)' ""
36+ '' ;
37+
38+ makeFlags = [
39+ "KERNELRELEASE=${ kernel . modDirVersion } "
40+ "KSRC_BASE="
41+ "KSRC=${ kernel . dev } /lib/modules/${ kernel . modDirVersion } /build"
42+ "KDST=kernel/drivers/net/ethernet/motorcomm"
43+ "INSTALL_MOD_PATH=${ placeholder "out" } "
44+ "ko_dir=${ modDestDir } "
45+ "ko_full=${ modDestDir } /yt6801.ko.xz"
46+ ] ;
47+
48+ meta = {
49+ homepage = "https://www.motor-comm.com/product/ethernet-control-chip" ;
50+ description = "YT6801 Gigabit PCIe Ethernet controller chip" ;
51+ license = lib . licenses . gpl2Plus ;
52+ maintainers = with lib . maintainers ; [ indexyz ] ;
53+ platforms = lib . platforms . linux ;
54+ sourceProvenance = with lib . sourceTypes ; [ fromSource ] ;
55+ } ;
56+ } )
Original file line number Diff line number Diff line change 573573
574574 xpadneo = callPackage ../os-specific/linux/xpadneo { } ;
575575
576+ yt6801 = callPackage ../os-specific/linux/yt6801 { } ;
577+
576578 ithc = callPackage ../os-specific/linux/ithc { } ;
577579
578580 ryzen-smu = callPackage ../os-specific/linux/ryzen-smu { } ;
You can’t perform that action at this time.
0 commit comments