#!/system/bin/sh
if [ ! -e /system/gentoo/bin ]; then
echo Setting up gentoo...
busybox mount /dev/block/mmcblk1p3 /system/gentoo
busybox swapon /dev/block/mmcblk1p2
mkdir /dev/shm
busybox mount -t tmpfs shm /dev/shm
busybox ln -sf /proc/self/fd/ /dev/fd
busybox mount --rbind /dev /system/gentoo/dev
busybox mount --rbind /proc /system/gentoo/proc
busybox mount --rbind /sys /system/gentoo/sys
busybox mount --rbind /data /system/gentoo/mnt/data
busybox mount --bind /system /system/gentoo/mnt/system
busybox mount --rbind /storage/emulated/0 /system/gentoo/mnt/intsd
busybox mount --rbind /storage/external_SD /system/gentoo/mnt/sd
echo Gentoo is ready... Type gen to start shell
else
echo Gentoo environment already set up.
fi