git.iko.soy/typeable/nixpkgs
on master help sign in
hyperv-daemons: fix binary location to stop error log spam
commita5872e8bde58efe529357260a083933fcac6ac39 authorPeter Hoeg <peter@hoeg.com> dateMon 28 May 2018, 13:50 (9 years ago) parent67202a9
1 file changed+21−16
pkgs/os-specific/linux/hyperv-daemons/default.nix+21−16
pkgs/os-specific/linux/hyperv-daemons/default.nix+21−16
@@ -1,7 +1,10 @@
1−{ stdenv, lib, python, kernel, makeWrapper, writeText }:
1+{ stdenv, lib, python, kernel, makeWrapper, writeText
2+, gawk, iproute }:
23
34let
4− daemons = stdenv.mkDerivation {
5+ libexec = "libexec/hypervkvpd";
6+
7+ daemons = stdenv.mkDerivation rec {
58 pname = "hyperv-daemons-bin";
69 inherit (kernel) src version;
710
@@ -10,10 +13,15 @@ let
1013 # as of 4.9 compilation will fail due to -Werror=format-security
1114 hardeningDisable = [ "format" ];
1215
13− preConfigure = ''
16+ postPatch = ''
1417 cd tools/hv
18+ substituteInPlace hv_kvp_daemon.c \
19+ --replace /usr/libexec/hypervkvpd/ $out/${libexec}/
1520 '';
1621
22+ # We don't actually need the hv_get_{dhcp,dns}_info scripts on NixOS in
23+ # their current incarnation but with them in place, we stop the spam of
24+ # errors in the log.
1725 installPhase = ''
1826 runHook preInstall
1927
@@ -21,7 +29,9 @@ let
2129 install -Dm755 hv_''${f}_daemon -t $out/bin
2230 done
2331
24− install -Dm755 hv_get_dns_info.sh lsvmbus -t $out/bin
32+ install -Dm755 lsvmbus $out/bin/lsvmbus
33+ install -Dm755 hv_get_dhcp_info.sh $out/${libexec}/hv_get_dhcp_info
34+ install -Dm755 hv_get_dns_info.sh $out/${libexec}/hv_get_dns_info
2535
2636 # I don't know why this isn't being handled automatically by fixupPhase
2737 substituteInPlace $out/bin/lsvmbus \
@@ -31,8 +41,8 @@ let
3141 '';
3242
3343 postFixup = ''
34− # kvp needs to be able to find the script(s)
35− wrapProgram $out/bin/hv_kvp_daemon --prefix PATH : $out/bin
44+ wrapProgram $out/bin/hv_kvp_daemon \
45+ --prefix PATH : $out/bin:${lib.makeBinPath [ gawk iproute ]}
3646 '';
3747 };
3848
@@ -56,24 +66,19 @@ let
5666
5767in stdenv.mkDerivation {
5868 pname = "hyperv-daemons";
59−
6069 inherit (kernel) version;
6170
6271 # we just stick the bins into out as well as it requires "out"
6372 outputs = [ "bin" "lib" "out" ];
6473
65− phases = [ "installPhase" ];
66−
6774 buildInputs = [ daemons ];
6875
69− installPhase = ''
76+ buildCommand = ''
7077 system=$lib/lib/systemd/system
7178
72− mkdir -p $system
73−
74− cp ${service "fcopy" "file copy (FCOPY)" "hv_fcopy" } $system/hv-fcopy.service
75− cp ${service "kvp" "key-value pair (KVP)" "" } $system/hv-kvp.service
76− cp ${service "vss" "volume shadow copy (VSS)" "" } $system/hv-vss.service
79+ install -Dm444 ${service "fcopy" "file copy (FCOPY)" "hv_fcopy" } $system/hv-fcopy.service
80+ install -Dm444 ${service "kvp" "key-value pair (KVP)" "" } $system/hv-kvp.service
81+ install -Dm444 ${service "vss" "volume shadow copy (VSS)" "" } $system/hv-vss.service
7782
7883 cat > $system/hyperv-daemons.target <<EOF
7984 [Unit]
@@ -102,7 +107,7 @@ in stdenv.mkDerivation {
102107 Microsoft calls their guest agents "Integration Services" which is why
103108 we use that name here.
104109 '';
105− homepage = https://kernel.org;
110+ homepage = "https://kernel.org";
106111 maintainers = with maintainers; [ peterhoeg ];
107112 platforms = kernel.meta.platforms;
108113 };