From 09851b8460010a60168e1803388cca3bc218216c Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Tue, 15 Dec 2015 16:30:27 -0800 Subject: [PATCH] enter_chroot: ensure the chroot's root directory is a mount point --- sdk_lib/enter_chroot.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk_lib/enter_chroot.sh b/sdk_lib/enter_chroot.sh index 2434960e05..b344ee7bd5 100755 --- a/sdk_lib/enter_chroot.sh +++ b/sdk_lib/enter_chroot.sh @@ -216,6 +216,10 @@ setup_env() { # Using 'slave' means we see global changes but cannot change global state. mount --make-rslave / + # Make sure the new root directory itself is a mount point. Tools like + # unshare assume that things like `mount --make-rprivate /` work. + setup_mount "${MOUNTED_PATH}" "--bind" / + setup_mount none "-t proc" /proc setup_mount none "-t sysfs" /sys setup_mount /dev "--bind" /dev