2023-05-24 13:37:59 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, autoconf
|
|
|
|
, automake
|
2023-11-16 04:20:00 +00:00
|
|
|
, makeBinaryWrapper
|
2023-05-24 13:37:59 +00:00
|
|
|
, pkg-config
|
|
|
|
, pciutils
|
|
|
|
, libusb1
|
|
|
|
, fuse
|
2023-11-16 04:20:00 +00:00
|
|
|
, busybox
|
|
|
|
, pv
|
|
|
|
, withBfbInstall ? true
|
2023-05-24 13:37:59 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "rshim-user-space";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2.0.20";
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Mellanox";
|
|
|
|
repo = pname;
|
|
|
|
rev = "rshim-${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-zm1cMTna9o8edl0M7tjUhbnElbUkQZSkh3KOI6tbE6I=";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoconf
|
|
|
|
automake
|
|
|
|
pkg-config
|
2023-11-16 04:20:00 +00:00
|
|
|
] ++ lib.optionals withBfbInstall [ makeBinaryWrapper ];
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
pciutils
|
|
|
|
libusb1
|
|
|
|
fuse
|
|
|
|
];
|
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
preConfigure = "./bootstrap.sh";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out"/bin
|
|
|
|
cp -a src/rshim "$out"/bin/
|
2023-11-16 04:20:00 +00:00
|
|
|
'' + lib.optionalString withBfbInstall ''
|
|
|
|
cp -a scripts/bfb-install "$out"/bin/
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = lib.optionalString withBfbInstall ''
|
|
|
|
wrapProgram $out/bin/bfb-install \
|
|
|
|
--set PATH ${lib.makeBinPath [ busybox pv ]}
|
2023-05-24 13:37:59 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "user-space rshim driver for the BlueField SoC";
|
|
|
|
longDescription = ''
|
|
|
|
The rshim driver provides a way to access the rshim resources on the
|
|
|
|
BlueField target from external host machine. The current version
|
|
|
|
implements device files for boot image push and virtual console access.
|
|
|
|
It also creates virtual network interface to connect to the BlueField
|
|
|
|
target and provides a way to access the internal rshim registers.
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/Mellanox/rshim-user-space";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ nikstur ];
|
|
|
|
};
|
|
|
|
}
|