trying to chroot into a gentoo system on my computer...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source /root/.bashrc | |
echo "doing cool gentoo-ish things..." | |
/usr/sbin/env-update | |
source /etc/profile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ `whoami` != root ]]; then | |
echo "this script must be run as root, so sudo, yo!" | |
exit | |
fi | |
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