mirror of
https://github.com/bartvdbraak/dotfiles.git
synced 2025-04-27 14:41:20 +00:00
Refactor parts of yt6801 module
This commit is contained in:
parent
4ad953cc96
commit
4235bd7518
2 changed files with 25 additions and 18 deletions
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
yt6801 = import ./yt6801/default.nix {
|
yt6801 = import ./yt6801/default.nix {
|
||||||
inherit (pkgs) stdenv lib fetchzip bc;
|
inherit (pkgs) stdenv lib fetchzip;
|
||||||
kernel = pkgs.linuxPackages.kernel;
|
kernel = pkgs.linuxPackages.kernel;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
|
@ -1,35 +1,40 @@
|
||||||
{ kernel, stdenv, lib, fetchzip, bc }:
|
{
|
||||||
|
kernel,
|
||||||
|
stdenv,
|
||||||
|
lib,
|
||||||
|
fetchzip,
|
||||||
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation {
|
||||||
pname = "yt6801";
|
pname = "yt6801";
|
||||||
version = "1.0.29";
|
version = "1.0.29";
|
||||||
|
|
||||||
src = fetchzip {
|
src = fetchzip {
|
||||||
url = "https://www.motor-comm.com/Public/Uploads/uploadfile/files/20240812/yt6801-linux-driver-1.0.29.zip";
|
url = "https://www.motor-comm.com/Public/Uploads/uploadfile/files/20240812/yt6801-linux-driver-1.0.29.zip";
|
||||||
sha256 = "sha256-oz6CeOUN6QWKXxe3WUZljhGDTFArsknjzBuQ4IchGeU=";
|
sha256 = "sha256-oz6CeOUN6QWKXxe3WUZljhGDTFArsknjzBuQ4IchGeU=";
|
||||||
|
stripRoot = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
hardeningDisable = [ "pic" "format" ];
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
||||||
KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}";
|
|
||||||
nativeBuildInputs = [ bc ] ++ kernel.moduleBuildDependencies;
|
preConfigure = "cd src";
|
||||||
|
|
||||||
configurePhase = "true";
|
configurePhase = "true";
|
||||||
|
|
||||||
buildFlags = [ "modules" ];
|
buildFlags = [ "modules" ];
|
||||||
|
|
||||||
makeFlags = [
|
makeFlags =
|
||||||
"ARCH=${stdenv.hostPlatform.linuxArch}"
|
[
|
||||||
"KSRC_BASE=${KERNELDIR}"
|
"ARCH=${stdenv.hostPlatform.linuxArch}"
|
||||||
"KSRC=${KERNELDIR}/build"
|
"KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
||||||
"KDST=kernel/drivers/net/ethernet/motorcomm"
|
]
|
||||||
"INSTALL_MOD_PATH=${placeholder "out"}"
|
++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
||||||
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
||||||
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
];
|
||||||
];
|
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/net/ethernet/motorcomm
|
mkdir -p $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/net/ethernet/motorcomm
|
||||||
find . -name "*.ko" -exec cp {} $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/net/ethernet/motorcomm/ \;
|
cp src/yt6801.ko $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/net/ethernet/motorcomm/
|
||||||
'';
|
'';
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
@ -37,8 +42,10 @@ stdenv.mkDerivation rec {
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Motorcomm yt6801 Network Interface Card driver";
|
description = "Motorcomm yt6801 Network Interface Card driver";
|
||||||
homepage = "https://www.motor-comm.com/product/ethernet-control-chip";
|
homepage = "https://www.motor-comm.com/product/ethernet-control-chip";
|
||||||
license = with licenses; [ gpl2Plus gpl2Only ];
|
license = with licenses; [
|
||||||
|
gpl2Plus
|
||||||
|
gpl2Only
|
||||||
|
];
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
maintainers = with maintainers; [ bartvdbraak ];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue