Merge pull request #490 from marineam/bind-root

enter_chroot: ensure the chroot's root directory is a mount point
This commit is contained in:
Michael Marineau 2015-12-15 16:34:01 -08:00
commit 2b43e553e3

View File

@ -220,6 +220,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