#!/bin/sh
#created by TMG
fdisk -l
echo "please input the drive that the gentoo tarball is extracted to. (leave blank if already mounted)"
echo "(/dev/XXXX)"
read $sdx

if [ $sdx -eq 0 ] ; then
	echo "mounting /dev/$sdx to /mnt/gentoo.."
	mount /dev/$sdx /mnt/gentoo
	echo "binding.."
	mount --types proc /proc /mnt/gentoo/proc
	mount --rbind /sys /mnt/gentoo/sys
	mount --make-rslave /mnt/gentoo/sys
	mount --rbind /dev /mnt/gentoo/dev
	mount --make-rslave /mnt/gentoo/dev
	mount --bind /run /mnt/gentoo/run
	mount --make-slave /mnt/gentoo/run 
	sleep 1
	echo "bound"
else
	echo "no input, skipping..."
fi

echo "chrooting into /mnt/gentoo.."
chroot /mnt/gentoo /bin/bash
echo "would you like to add a custom reminder tag on the PS1? (leave blank for the basic "(chroot)")(parentheses already added)"
read $prof

if [ $prof -eq 0 ] ; then
	source /etc/profile
	export PS1="($prof) {$PS1}"
	echo "prompt set to ($prof) {PS1}"
else
	source /etc/profile
	export PS1="(chroot) {$PS1}"
	echo "prompt set to (chroot) {$PS1}"
fi
echo "done!"
