Add MDIO tools and netlink out-of-tree kernel module (#456896)

This commit is contained in:
Jared Baur
2025-11-01 01:38:47 +00:00
committed by GitHub
3 changed files with 72 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
{
autoreconfHook,
fetchFromGitHub,
lib,
libmnl,
pkg-config,
stdenv,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mdio-tools";
version = "1.3.1";
src = fetchFromGitHub {
owner = "wkz";
repo = "mdio-tools";
tag = finalAttrs.version;
hash = "sha256-NomChJrYwMDPXNw5r2p11kGfYUvJBHCdLXy1SA8kOaM=";
};
nativeBuildInputs = [
autoreconfHook
pkg-config
];
buildInputs = [ libmnl ];
postPatch = ''
substituteInPlace configure.ac \
--replace-fail "git describe --always --dirty --tags" "echo ${finalAttrs.version}"
'';
meta = {
description = "Low-level debug tools for MDIO devices";
homepage = "https://github.com/wkz/mdio-tools";
changelog = "https://github.com/wkz/mdio-tools/blob/${finalAttrs.src.rev}/ChangeLog.md";
license = lib.licenses.gpl2Only;
maintainers = [ lib.maintainers.jmbaur ];
mainProgram = "mdio";
platforms = lib.platforms.linux;
};
})

View File

@@ -0,0 +1,29 @@
{
lib,
stdenv,
kernel,
mdio-tools,
}:
stdenv.mkDerivation {
pname = "mdio-netlink";
version = "${mdio-tools.version}-${kernel.version}";
inherit (mdio-tools) src;
sourceRoot = "source/kernel";
nativeBuildInputs = kernel.moduleBuildDependencies;
makeFlags = kernel.commonMakeFlags ++ [
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
"INSTALL_MOD_PATH=${placeholder "out"}"
];
meta = {
description = "Netlink support for MDIO devices";
homepage = "https://github.com/wkz/mdio-tools";
license = lib.licenses.gpl2Only;
maintainers = [ lib.maintainers.jmbaur ];
platforms = lib.platforms.linux;
};
}

View File

@@ -566,6 +566,8 @@ in
mba6x_bl = callPackage ../os-specific/linux/mba6x_bl { };
mdio-netlink = callPackage ../os-specific/linux/mdio-netlink { };
mwprocapture = callPackage ../os-specific/linux/mwprocapture { };
mxu11x0 = callPackage ../os-specific/linux/mxu11x0 { };