Merge pull request #64532 from plumelo/feature/lxd-criu

lxd: add criu to path and bash completions, lxc: fix bash completions
This commit is contained in:
worldofpeace 2019-07-13 12:15:51 -04:00 committed by GitHub
commit 9a846892a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View File

@ -67,6 +67,17 @@ stdenv.mkDerivation rec {
postInstall = ''
wrapPythonPrograms
completions=(
lxc-attach lxc-cgroup lxc-console lxc-destroy lxc-device lxc-execute
lxc-freeze lxc-info lxc-monitor lxc-snapshot lxc-stop lxc-unfreeze
)
pushd $out/share/bash-completion/completions/
mv lxc lxc-start
for completion in ''${completions[@]}; do
ln -sfn lxc-start $completion
done
popd
'';
meta = {

View File

@ -3,6 +3,7 @@
, squashfsTools, iproute, iptables, ebtables, libcap, dqlite
, sqlite-replication
, writeShellScriptBin, apparmor-profiles, apparmor-parser
, criu
, bash
}:
@ -33,11 +34,14 @@ buildGoPackage rec {
rm $bin/bin/{deps,macaroon-identity,generate}
wrapProgram $bin/bin/lxd --prefix PATH : ${stdenv.lib.makeBinPath [
acl rsync gnutar xz btrfs-progs gzip dnsmasq squashfsTools iproute iptables ebtables bash
acl rsync gnutar xz btrfs-progs gzip dnsmasq squashfsTools iproute iptables ebtables bash criu
(writeShellScriptBin "apparmor_parser" ''
exec '${apparmor-parser}/bin/apparmor_parser' -I '${apparmor-profiles}/etc/apparmor.d' "$@"
'')
]}
mkdir -p "$bin/share/bash-completion/completions/"
cp -av go/src/github.com/lxc/lxd/scripts/bash/lxd-client "$bin/share/bash-completion/completions/lxc"
'';
nativeBuildInputs = [ pkgconfig makeWrapper ];