#!/bin/bash

# This requires schroot to run (simple way of using a chroot with a 
# normal user)
#
# apt-get install schroot
# 
# Then configure /etc/schroot/schroot.conf with the following configuration
# (swapping snorri/users for your username/user group combination):
#
# [ycp]
# description=Yujin Control Platform
# location=/mnt/ycp
# users=snorri
# groups=users
# root-users=root,snorri
# root-groups=root,snorri

# Change this to point to your root!
DIR=/mnt/zaphod/chroots/lucid

echo "Mounting filesystems"
sudo chrootprep ${DIR}

echo "Entering the root"
schroot -c ycp -u root -d / -- /bin/bash --login

echo "Unmounting filesystems"
sudo chrootuprep ${DIR}

