From 89f4126ef6c65defa45ddf345731c2e5cbf3169a Mon Sep 17 00:00:00 2001 From: Indexyz <7685264+5aaee9@users.noreply.github.com> Date: Fri, 18 Oct 2024 17:59:07 +0800 Subject: [PATCH] linuxPackages.yt6801: init at 1.0.29 --- pkgs/os-specific/linux/yt6801/default.nix | 56 +++++++++++++++++++++++ pkgs/top-level/linux-kernels.nix | 2 + 2 files changed, 58 insertions(+) create mode 100644 pkgs/os-specific/linux/yt6801/default.nix diff --git a/pkgs/os-specific/linux/yt6801/default.nix b/pkgs/os-specific/linux/yt6801/default.nix new file mode 100644 index 000000000000..781c81a7d2ce --- /dev/null +++ b/pkgs/os-specific/linux/yt6801/default.nix @@ -0,0 +1,56 @@ +{ + lib, + stdenv, + fetchzip, + kmod, + kernel, +}: + +let + modDestDir = "$(out)/lib/modules/${kernel.modDirVersion}/kernel/drivers/net/ethernet/motorcomm"; + +in +stdenv.mkDerivation (finalAttrs: { + pname = "yt6801"; + version = "1.0.29-20240812"; + + src = + let + version-split = lib.strings.splitString "-" finalAttrs.version; + versionName = builtins.elemAt version-split 0; + uploadDate = builtins.elemAt version-split 1; + in + fetchzip { + stripRoot = false; + url = "https://www.motor-comm.com/Public/Uploads/uploadfile/files/${uploadDate}/yt6801-linux-driver-${versionName}.zip"; + sha256 = "sha256-oz6CeOUN6QWKXxe3WUZljhGDTFArsknjzBuQ4IchGeU="; + }; + + nativeBuildInputs = kernel.moduleBuildDependencies ++ [ kmod ]; + + postPatch = '' + substituteInPlace src/Makefile \ + --replace-fail "sudo ls -l" "ls -l" \ + --replace-fail 'depmod $(shell uname -r)' "" \ + --replace-fail 'modprobe $(KFILE)' "" + ''; + + makeFlags = [ + "KERNELRELEASE=${kernel.modDirVersion}" + "KSRC_BASE=" + "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + "KDST=kernel/drivers/net/ethernet/motorcomm" + "INSTALL_MOD_PATH=${placeholder "out"}" + "ko_dir=${modDestDir}" + "ko_full=${modDestDir}/yt6801.ko.xz" + ]; + + meta = { + homepage = "https://www.motor-comm.com/product/ethernet-control-chip"; + description = "YT6801 Gigabit PCIe Ethernet controller chip"; + license = lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [ indexyz ]; + platforms = lib.platforms.linux; + sourceProvenance = with lib.sourceTypes; [ fromSource ]; + }; +}) diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix index ce3d2b893cd3..9a2b5f052548 100644 --- a/pkgs/top-level/linux-kernels.nix +++ b/pkgs/top-level/linux-kernels.nix @@ -572,6 +572,8 @@ in { xpadneo = callPackage ../os-specific/linux/xpadneo { }; + yt6801 = callPackage ../os-specific/linux/yt6801 { }; + ithc = callPackage ../os-specific/linux/ithc { }; ryzen-smu = callPackage ../os-specific/linux/ryzen-smu { };