Skip to content

Instantly share code, notes, and snippets.

Created April 3, 2011 03:22
What would you like to do?
trying to chroot into a gentoo system on my computer...
source /root/.bashrc
echo "doing cool gentoo-ish things..."
source /etc/profile
if [[ `whoami` != root ]]; then
echo "this script must be run as root, so sudo, yo!"
echo "getting path to chroot..."
rootchange=`find /usr/*bin -name chroot`
echo $rootchange
echo "getting host info to keep internets working..."
cp -L /etc/resolv.conf /gentoo/etc/
echo "mounting wonky filesystems to keep everything sane..."
mount -t proc none /gentoo/proc
mount --rbind /dev /gentoo/dev
echo "getting into system..."
env -i HOME=$HOME TERM=$TERM $rootchange /gentoo /bin/bash --rcfile /root/.bash_chroot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment