Skip to content

Commit

Permalink
mdadm: use shared system-sendmail
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekleog committed Dec 1, 2018
1 parent 50bb0af commit b074a40
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions pkgs/os-specific/linux/mdadm/default.nix
@@ -1,18 +1,5 @@
{ stdenv, writeScript
, fetchurl, groff
}:

let
sendmail-script = writeScript "sendmail-script" ''
#!/bin/sh
if [ -x /run/wrappers/bin/sendmail ]; then
/run/wrappers/bin/sendmail "$@"
else
/run/current-system/sw/bin/sendmail "$@"
fi
'';
in
{ stdenv, writeScript, fetchurl, groff, system-sendmail }:

stdenv.mkDerivation rec {
name = "mdadm-4.1";

Expand All @@ -23,7 +10,7 @@ stdenv.mkDerivation rec {

# This is to avoid self-references, which causes the initrd to explode
# in size and in turn prevents mdraid systems from booting.
allowedReferences = [ stdenv.cc.libc.out sendmail-script ];
allowedReferences = [ stdenv.cc.libc.out system-sendmail ];

patches = [ ./no-self-references.patch ];

Expand All @@ -40,7 +27,7 @@ stdenv.mkDerivation rec {
preConfigure = ''
sed -e 's@/lib/udev@''${out}/lib/udev@' \
-e 's@ -Werror @ @' \
-e 's@/usr/sbin/sendmail@${sendmail-script}@' -i Makefile
-e 's@/usr/sbin/sendmail@${system-sendmail}@' -i Makefile
'';

meta = with stdenv.lib; {
Expand Down

0 comments on commit b074a40

Please sign in to comment.