The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/distrobuilder/pull/287

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
This rbinds /dev in order for it to work in containers as well.

Signed-off-by: Thomas Hipp <thomas.h...@canonical.com>
From fc6320546dd78aa021a5bd97ff12b5b95f3bf85b Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.h...@canonical.com>
Date: Thu, 20 Feb 2020 20:39:09 +0100
Subject: [PATCH] shared/chroot: Recursively bind /dev

This rbinds /dev in order for it to work in containers as well.

Signed-off-by: Thomas Hipp <thomas.h...@canonical.com>
---
 shared/chroot.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/shared/chroot.go b/shared/chroot.go
index c176f51..e44703e 100644
--- a/shared/chroot.go
+++ b/shared/chroot.go
@@ -164,7 +164,7 @@ func SetupChroot(rootfs string, envs DefinitionEnv, m 
[]ChrootMount) (func() err
        mounts := []ChrootMount{
                {"none", "/proc", "proc", 0, "", true},
                {"none", "/sys", "sysfs", 0, "", true},
-               {"/dev", "/dev", "", unix.MS_BIND, "", true},
+               {"/dev", "/dev", "", unix.MS_BIND | unix.MS_REC, "", true},
                {"none", "/run", "tmpfs", 0, "", true},
                {"none", "/tmp", "tmpfs", 0, "", true},
                {"/etc/resolv.conf", "/etc/resolv.conf", "", unix.MS_BIND, "", 
false},
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to