Lines Matching refs:chroot
7 # This script installs Debian-derived distributions in a chroot environment.
24 echo "-g group,... groups that can use the chroot unauthenticated"
26 echo "-l List all installed chroot environments"
29 echo "-c always copy 64bit helper binaries to 32bit chroot"
98 for i in /var/lib/chroot/*; do
140 echo "Debian or Ubuntu distribution in a chroot environment. You will"
160 # Create directory for chroot
161 sudo mkdir -p /var/lib/chroot
163 # Find chroot environments that can be installed with debootstrap
168 echo "The following targets are available to be installed in a chroot:"
190 printf "32bit or a 64bit chroot environment. %s" \
202 [ -d /var/lib/chroot/"${target}" ] && {
204 echo "This chroot already exists on your machine."
209 echo "are currently using the chroot environment and then re-run this"
216 echo "I can abort installation, I can overwrite the existing chroot,"
222 o|O) sudo rm -rf "/var/lib/chroot/${target}"; break;;
223 d|D) sudo rm -rf "/var/lib/chroot/${target}" \
238 sudo mkdir -p /var/lib/chroot/"${target}"
245 printf "to the chroot's sources.list (y/n)? "
261 # they should be imported into the chroot environment
280 echo "might want to import into the chroot environment:"
289 state="mounted in chroot" || state="$(tput el)"
344 "${distname}" "/var/lib/chroot/${target}" "$mirror"
362 directory=/var/lib/chroot/${target}
373 # chroot environment.
386 # If this system has a "/media" mountpoint, import it into the chroot
399 if [ ! -d "/var/lib/chroot/${target}/run" ] &&
412 d="$(readlink -f "${HOME}/chroot" 2>/dev/null || echo "${HOME}/chroot")"
418 # Install a helper script to launch commands in the chroot
422 chroot="${0##*/}"
449 echo " list: list all known chroot environments" | wrap " "
450 echo " clean: remove all old chroot sessions for \"${chroot}\"" | wrap " "
451 echo " clean-all: remove all old chroot sessions for all environments" | wrap " "
461 [ "${t#${chroot}-}" == "${t}" ] && continue
476 e="${e#chroot:}"
494 -c|--clean) shift; clean "${chroot}";;
500 # Start a new chroot session and keep track of the session id. We inject this
501 # id into all processes that run inside the chroot. Unless they go out of their
504 session="$(schroot -c "${chroot}" -b)"
511 # Run a command inside of the chroot environment
517 # Compute the inode of the root directory inside of the chroot environment.
551 # End the chroot session. This should clean up all temporary files. But if we
564 -r "/var/lib/chroot/${target}/etc/apt/sources.list" ] &&
572 d' "/var/lib/chroot/${target}/etc/apt/sources.list"
574 # Add a few more repositories to the chroot
575 [ -r "/var/lib/chroot/${target}/etc/apt/sources.list" ] &&
577 "/var/lib/chroot/${target}/etc/apt/sources.list"
580 if [ -r "/var/lib/chroot/${target}/etc/apt/sources.list" ] &&
586 >>"/var/lib/chroot/'"${target}"'/etc/apt/sources.list"'
591 -r "/var/lib/chroot/${target}/etc/apt/sources.list" ] &&
594 "/var/lib/chroot/${target}/etc/apt/sources.list"
600 >>"/var/lib/chroot/'"${target}"'/etc/apt/apt.conf"'
609 [ -d "/var/lib/chroot/${target}/usr/share/doc/$i" ] ||
622 [ -r "/var/lib/chroot/${target}/etc/apt/sources.list" ] && {
624 "/var/lib/chroot/${target}/etc/apt/sources.list"
625 [ -d /var/lib/chroot/${target}/etc/dpkg/dpkg.cfg.d/ ] &&
631 "cat >'/var/lib/chroot/${target}/etc/dpkg/dpkg.cfg.d/multiarch'"
645 # as 64bit. This is only done automatically if the chroot distro is the same as
662 sudo mkdir -p "/var/lib/chroot/${target}/usr/local/lib/amd64"
667 sudo cp "$lib" "/var/lib/chroot/${target}/usr/local/lib/amd64"
673 "/var/lib/chroot/${target}/usr/local/lib/amd64/" >&/dev/null || :
677 sudo cp /usr/bin/$i "/var/lib/chroot/${target}/usr/local/lib/amd64/"
678 sudo sh -c "cat >'/var/lib/chroot/${target}/usr/local/bin/$i'" <<EOF
683 sudo chmod 755 "/var/lib/chroot/${target}/usr/local/bin/$i"
693 echo "If you plan on building Chrome inside of the new chroot environment,"
711 # installing the Chrome build depencies. This prevents the chroot
733 # Check whether ~/chroot is on a (slow) network file system and offer to
736 # We only offer this option, if it doesn't look as if a chroot environment
739 # the ~/chroot directory.
743 mkdir -p "${HOME}/chroot/"
744 if [ ! -h "${HOME}/chroot" ] &&
745 ! egrep -qs '^[^[:space:]]*/chroot' /etc/fstab &&
747 is_network_drive "${HOME}/chroot"; } &&
748 ! egrep -qs '/var/lib/[^/]*chroot/.*/chroot' /proc/mounts; then
749 echo "${HOME}/chroot is currently located on the same device as your"
756 # then offer a good location for where to put the ~/chroot directory.
759 if [ -d "$i" -a -w "$i" -a \( ! -a "$i/chroot" -o -w "$i/chroot/." \) ] &&
765 \( ! -a "$j/chroot" -o -w "$j/chroot/." \) ] &&
771 \( ! -a "$k/chroot" -o -w "$k/chroot/." \) ] &&
800 [ -a "${dir}/chroot" -a ! -w "${dir}/chroot/." ]; then
801 echo "Cannot write to ${dir}/chroot. Please try again"
803 mv "${HOME}/chroot" "${dir}/chroot"
804 ln -s "${dir}/chroot" "${HOME}/chroot"
806 sudo "$i" mkdir -p "${dir}/chroot"
808 sudo sed -i "s,${HOME}/chroot,${dir}/chroot,g" /etc/schroot/mount-*
827 You can run programs inside of the chroot by invoking the
831 program inside of the chroot environment (e.g. "${target%bit} make chrome")
833 of the chroot environment.
838 Your home directory is shared between the host and the chroot. But I
839 configured "${HOME}/chroot" to be private to the chroot environment.
845 symbolic link that points somewhere inside of "${HOME}/chroot".
848 outside of the chroot to inside of the chroot. But you will find that you