mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
ethercat: add kernel module
This commit is contained in:
parent
7c69005b70
commit
af49b2a0b0
3 changed files with 76 additions and 1 deletions
70
pkgs/by-name/et/ethercat/kernel-module.nix
Normal file
70
pkgs/by-name/et/ethercat/kernel-module.nix
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
ethercat:
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
kernelModuleMakeFlags,
|
||||
kernel,
|
||||
}:
|
||||
let
|
||||
# Aside from a generic drivers there are special drivers for specific NICs
|
||||
# (for example r8139, r8169, e100, e1000, e1000e) which are only available
|
||||
# for these kernel versions
|
||||
extraSupportedKernel = lib.elem (lib.versions.majorMinor kernel.version) [
|
||||
"5.10"
|
||||
"5.14"
|
||||
"5.15"
|
||||
"6.1"
|
||||
"6.4"
|
||||
"6.12"
|
||||
];
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
pname = "ethercat";
|
||||
version = "${kernel.version}-${ethercat.version}";
|
||||
|
||||
__structuredAttrs = true;
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
inherit (ethercat) src;
|
||||
|
||||
nativeBuildInputs = kernel.moduleBuildDependencies ++ ethercat.nativeBuildInputs;
|
||||
|
||||
configureFlags = [
|
||||
"--with-linux-dir=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
||||
"--enable-userlib=no"
|
||||
"--enable-tool=no"
|
||||
"--enable-kernel=yes"
|
||||
"--enable-ccat=yes"
|
||||
]
|
||||
++ lib.optionals extraSupportedKernel [
|
||||
"--enable-e100=yes"
|
||||
"--enable-e1000=yes"
|
||||
"--enable-e1000e=yes"
|
||||
"--enable-r8169=yes"
|
||||
"--enable-igb=yes"
|
||||
]
|
||||
++ lib.optionals (extraSupportedKernel && lib.versionAtLeast kernel.version "5.14") [
|
||||
"--enable-igc=yes"
|
||||
];
|
||||
|
||||
makeFlags = kernelModuleMakeFlags ++ [
|
||||
"INSTALL_MOD_PATH=${placeholder "out"}"
|
||||
];
|
||||
|
||||
buildFlags = [ "modules" ];
|
||||
|
||||
installTargets = [ "modules_install" ];
|
||||
|
||||
meta = {
|
||||
description = ethercat.meta.description + " - kernel modules";
|
||||
|
||||
inherit (ethercat.meta)
|
||||
homepage
|
||||
changelog
|
||||
license
|
||||
maintainers
|
||||
platforms
|
||||
;
|
||||
};
|
||||
}
|
||||
|
|
@ -29,7 +29,10 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
"--enable-kernel=no"
|
||||
];
|
||||
|
||||
passthru.updateScript = gitUpdater { };
|
||||
passthru = {
|
||||
kernelModule = import ./kernel-module.nix finalAttrs.finalPackage;
|
||||
updateScript = gitUpdater { };
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "IgH EtherCAT Master for Linux";
|
||||
|
|
|
|||
|
|
@ -332,6 +332,8 @@ in
|
|||
inherit kernel;
|
||||
};
|
||||
|
||||
ethercat = callPackage pkgs.ethercat.kernelModule { };
|
||||
|
||||
evdi = callPackage ../os-specific/linux/evdi { };
|
||||
|
||||
fanout = callPackage ../os-specific/linux/fanout { };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue