schroot build environment setup how to avoid bind-mount home

Posted by minghua on Super User See other posts from Super User or by minghua
Published on 2013-10-24T18:52:36Z Indexed on 2013/10/24 21:58 UTC
Read the original article Hit count: 132

Filed under:
|

The recent linux distributions such as Fedora and Ubuntu all use chroot environment to make the build. Because when making the build often it needs to install some special tools, and to install to the existing system. Using chroot avoids making any changes to the host system.

To set up such a build environment, the first step is to make a chroot. I'm following the setup guide at https://wiki.debian.org/Schroot

[wheezy-test]
description=Contains the SPICE program
aliases=test
type=directory
directory=/srv/chroot/test
users=jsmith
root-groups=root
script-config=desktop/config
personality=linux
preserve-environment=true

In the host on my setup the /home is on /dev/mapper. When schroot is entered, the same home is bind-mounted. Is there a way to avoid this? I prefer to use a different /home inside chroot.

When changing the type from directory to plain, the binding is not performed. However that also loses /proc, /sys, etc. You'd have to manually bind-mount them. That does not seem to be a good solution.

If a simple configuration change is unavailable, any idea where the script is for type=directory? Probably I'll manually modify the script.

Thanks in advance for any answers or hints!

© Super User or respective owner

Related posts about linux

Related posts about chroot