#!/bin/bash env-update && source /etc/profile echo "Downloading kernel sources ..." emerge -fq gentoo-sources > /tmp/compile echo "Installing the kernel ..." emerge -q gentoo-sources >> /tmp/compile gunzip /tmp/config.gz mv /tmp/config /usr/src/linux/.config echo "Configuring the kernel ..." sleep 1 cd /usr/src/linux/ && make -s menuconfig echo "Compiling the kernel, this may take a while ..." make >> /tmp/compile && make install modules_install >> /tmp/compile echo "Removing LiveCD-only ebuilds ..." emerge -Cq mkxf86config livecd-tools hwsetup localepurge >> /tmp/compile echo "Cleaning the dep tree ..." emerge --depclean -q >> /tmp/compile echo "Configuring USE flags ..." sleep 1 echo "ufed has been failing to work, so skipping this step ..." sleep 1 #ufed echo "Downloading required ebuilds ..." emerge -uDNfq world >> /tmp/compile echo "Recompiling, this may take a while so get comfortable ..." emerge -uDNq world >> /tmp/compile if [ "$?" = "0" ]; then echo "Recompile OK!"; else echo "Recompile FAIL!"; fi sleep 1 echo "Running revdep-rebuild ..." revdep-rebuild -- -q >> /tmp/compile echo "Installing Grub to drive MBR ..." p1_hdd=`mount | grep /tmp/installer/boot | awk '{print $1}'` p2_hdd=`echo ${p1_hdd:0:8} grub-install --recheck $p2_hdd >> /tmp/compile echo "Fixing /dev ..." # TAKEN FROM GENTOO /etc/issue.devfix mkdir /mnt/fixit mount --bind / /mnt/fixit cp -a /dev/* /mnt/fixit/dev/ umount /mnt/fixit rmdir /mnt/fixit echo "Removing autoconfig from startup ..." rc-update del autoconfig echo "Finished. Press any key to clean up ..." read -n1 rm /tmp/compile rm /portage* rm -r /newroot rm /boot/initramfs.igz exit