[kvmtool] setup: Add /etc/alternatives to host mirrors dirs
diff mbox series

Message ID 20190212104315.24334-1-dmonakhov@openvz.org
State New
Headers show
  • [kvmtool] setup: Add /etc/alternatives to host mirrors dirs
Related show

Commit Message

Dmitry Monakhov Feb. 12, 2019, 10:43 a.m. UTC
From: Dmitry Monakhov <dmtrmonakhov@yandex-team.ru>

Many general purpose binaries in Ubuntu depens on /etc/alternatives directory
$ ls -lh /usr/bin/awk
lrwxrwxrwx 1 root root 21 апр 14  2017 /usr/bin/awk -> /etc/alternatives/awk
So such binaries will not works inside guest
$ echo 'awk -v' >  t.sh ; lkvm run -c 2 --sandbox t.sh
 /virt/sandbox.sh: 1: /virt/sandbox.sh: awk: not found

Let's forward this dir to guest-fs and make life easier for ubuntu users.
This will not break anything even if this directory not exits.
 builtin-setup.c | 1 +
 1 file changed, 1 insertion(+)

diff mbox series

diff --git a/builtin-setup.c b/builtin-setup.c
index b24d2a1..f710671 100644
--- a/builtin-setup.c
+++ b/builtin-setup.c
@@ -100,6 +100,7 @@  error_close_in:
 static const char *guestfs_dirs[] = {
+	"/etc/alternatives",