Merge pull request #115960 from grahamc/multipath-fixup

multipath-tools: fix the service path to multipathd
This commit is contained in:
Sandro 2021-04-06 10:28:15 +02:00 committed by GitHub
commit ef9c0cb113
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, pkg-config, perl, lvm2, libaio, gzip, readline, systemd, liburcu, json_c }:
{ lib, stdenv, fetchurl, pkg-config, perl, lvm2, libaio, gzip, readline, systemd, liburcu, json_c, kmod }:
stdenv.mkDerivation rec {
pname = "multipath-tools";
@ -16,7 +16,13 @@ stdenv.mkDerivation rec {
];
postPatch = ''
substituteInPlace libmultipath/Makefile --replace /usr/include/libdevmapper.h ${lib.getDev lvm2}/include/libdevmapper.h
substituteInPlace libmultipath/Makefile \
--replace /usr/include/libdevmapper.h ${lib.getDev lvm2}/include/libdevmapper.h
substituteInPlace multipathd/multipathd.service \
--replace /sbin/modprobe ${lib.getBin kmod}/sbin/modprobe \
--replace /sbin/multipathd "$out/bin/multipathd"
sed -i -re '
s,^( *#define +DEFAULT_MULTIPATHDIR\>).*,\1 "'"$out/lib/multipath"'",
' libmultipath/defaults.h