lxcfs: Wrap lxc.mount.hook, so that it detects the mount command

This commit is contained in:
Patryk Wychowaniec 2020-06-05 14:37:14 +02:00
parent 72e80cdc54
commit 4dee97c43e
No known key found for this signature in database
GPG key ID: F62547D075E09767

View file

@ -1,4 +1,5 @@
{ config, stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, help2man, fuse
, utillinux, makeWrapper
, enableDebugBuild ? config.lxcfs.enableDebugBuild or false }:
with stdenv.lib;
@ -13,7 +14,7 @@ stdenv.mkDerivation rec {
};
nativeBuildInputs = [ pkgconfig help2man autoreconfHook ];
buildInputs = [ fuse ];
buildInputs = [ fuse makeWrapper ];
preConfigure = stdenv.lib.optionalString enableDebugBuild ''
sed -i 's,#AM_CFLAGS += -DDEBUG,AM_CFLAGS += -DDEBUG,' Makefile.am
@ -27,6 +28,12 @@ stdenv.mkDerivation rec {
installFlags = [ "SYSTEMD_UNIT_DIR=\${out}/lib/systemd" ];
postInstall = ''
# `mount` hook requires access to the `mount` command from `utillinux`:
wrapProgram "$out/share/lxcfs/lxc.mount.hook" \
--prefix PATH : "${utillinux}/bin"
'';
postFixup = ''
# liblxcfs.so is reloaded with dlopen()
patchelf --set-rpath "$(patchelf --print-rpath "$out/bin/lxcfs"):$out/lib" "$out/bin/lxcfs"