Unverified Commit c00aef99 authored by Jared Baur's avatar Jared Baur Committed by GitHub
Browse files

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

parents 76acb199 9bdf1311
Loading
Loading
Loading
Loading
+41 −0
Original line number Diff line number Diff line
{
  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;
  };
})
+29 −0
Original line number Diff line number Diff line
{
  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;
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -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 { };