1{
2 lib,
3 stdenv,
4 fetchurl,
5 kmod,
6 coreutils,
7}:
8
9stdenv.mkDerivation rec {
10 pname = "lsiutil";
11 version = "1.72";
12
13 src = fetchurl {
14 url = "https://github.com/exactassembly/meta-xa-stm/raw/f96cf6e13f3c9c980f5651510dd96279b9b2af4f/recipes-support/lsiutil/files/lsiutil-${version}.tar.gz";
15 sha256 = "sha256-aTi+EogY1aDWYq3anjRkjz1mzINVfUPQbOPHthxrvS4=";
16 };
17
18 postPatch = ''
19 substituteInPlace lsiutil.c \
20 --replace /sbin/modprobe "${kmod}/bin/modprobe" \
21 --replace /bin/mknod "${coreutils}/bin/mknod"
22 '';
23
24 buildPhase = ''
25 runHook preBuild
26
27 gcc -Wall -O lsiutil.c -o lsiutil
28
29 runHook postBuild
30 '';
31
32 installPhase = ''
33 runHook preInstall
34
35 mkdir -p "$out/bin"
36 install -Dm755 lsiutil "$out/bin/lsiutil"
37
38 runHook postInstall
39 '';
40
41 meta = with lib; {
42 homepage = "https://github.com/exactassembly/meta-xa-stm/tree/master/recipes-support/lsiutil/files";
43 description = "Configuration utility for MPT adapters (FC, SCSI, and SAS/SATA)";
44 license = licenses.unfree;
45 platforms = platforms.linux;
46 maintainers = with maintainers; [ Luflosi ];
47 };
48}