aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2019-09-25 04:50:06 +0800
committerGitHub <noreply@github.com>2019-09-25 04:50:06 +0800
commitda9e40fcc299adbaeb0f2b0198dafaaf70e54b0d (patch)
tree8736549b61a9ba46854f0f09912730dec07edf2d
parent4b34dd3120699014f866c584186fc4e74a377f74 (diff)
parenta5872e8bde58efe529357260a083933fcac6ac39 (diff)
Merge pull request #69299 from peterhoeg/f/hv_master
hyperv-daemons: fix binary location to stop error log spam
-rw-r--r--pkgs/os-specific/linux/hyperv-daemons/default.nix37
1 files changed, 21 insertions, 16 deletions
diff --git a/pkgs/os-specific/linux/hyperv-daemons/default.nix b/pkgs/os-specific/linux/hyperv-daemons/default.nix
index a209f1ab4bb..1a111a295a4 100644
--- a/pkgs/os-specific/linux/hyperv-daemons/default.nix
+++ b/pkgs/os-specific/linux/hyperv-daemons/default.nix
@@ -1,7 +1,10 @@
-{ stdenv, lib, python, kernel, makeWrapper, writeText }:
+{ stdenv, lib, python, kernel, makeWrapper, writeText
+, gawk, iproute }:
let
- daemons = stdenv.mkDerivation {
+ libexec = "libexec/hypervkvpd";
+
+ daemons = stdenv.mkDerivation rec {
pname = "hyperv-daemons-bin";
inherit (kernel) src version;
@@ -10,10 +13,15 @@ let
# as of 4.9 compilation will fail due to -Werror=format-security
hardeningDisable = [ "format" ];
- preConfigure = ''
+ postPatch = ''
cd tools/hv
+ substituteInPlace hv_kvp_daemon.c \
+ --replace /usr/libexec/hypervkvpd/ $out/${libexec}/
'';
+ # We don't actually need the hv_get_{dhcp,dns}_info scripts on NixOS in
+ # their current incarnation but with them in place, we stop the spam of
+ # errors in the log.
installPhase = ''
runHook preInstall
@@ -21,7 +29,9 @@ let
install -Dm755 hv_''${f}_daemon -t $out/bin
done
- install -Dm755 hv_get_dns_info.sh lsvmbus -t $out/bin
+ install -Dm755 lsvmbus $out/bin/lsvmbus
+ install -Dm755 hv_get_dhcp_info.sh $out/${libexec}/hv_get_dhcp_info
+ install -Dm755 hv_get_dns_info.sh $out/${libexec}/hv_get_dns_info
# I don't know why this isn't being handled automatically by fixupPhase
substituteInPlace $out/bin/lsvmbus \
@@ -31,8 +41,8 @@ let
'';
postFixup = ''
- # kvp needs to be able to find the script(s)
- wrapProgram $out/bin/hv_kvp_daemon --prefix PATH : $out/bin
+ wrapProgram $out/bin/hv_kvp_daemon \
+ --prefix PATH : $out/bin:${lib.makeBinPath [ gawk iproute ]}
'';
};
@@ -56,24 +66,19 @@ let
in stdenv.mkDerivation {
pname = "hyperv-daemons";
-
inherit (kernel) version;
# we just stick the bins into out as well as it requires "out"
outputs = [ "bin" "lib" "out" ];
- phases = [ "installPhase" ];
-
buildInputs = [ daemons ];
- installPhase = ''
+ buildCommand = ''
system=$lib/lib/systemd/system
- mkdir -p $system
-
- cp ${service "fcopy" "file copy (FCOPY)" "hv_fcopy" } $system/hv-fcopy.service
- cp ${service "kvp" "key-value pair (KVP)" "" } $system/hv-kvp.service
- cp ${service "vss" "volume shadow copy (VSS)" "" } $system/hv-vss.service
+ install -Dm444 ${service "fcopy" "file copy (FCOPY)" "hv_fcopy" } $system/hv-fcopy.service
+ install -Dm444 ${service "kvp" "key-value pair (KVP)" "" } $system/hv-kvp.service
+ install -Dm444 ${service "vss" "volume shadow copy (VSS)" "" } $system/hv-vss.service
cat > $system/hyperv-daemons.target <<EOF
[Unit]
@@ -102,7 +107,7 @@ in stdenv.mkDerivation {
Microsoft calls their guest agents "Integration Services" which is why
we use that name here.
'';
- homepage = https://kernel.org;
+ homepage = "https://kernel.org";
maintainers = with maintainers; [ peterhoeg ];
platforms = kernel.meta.platforms;
};