Jump to content

Gentoo Installation Script


Recommended Posts

Well I was bored(gentoo is installing ;) ). So I was wondering if there was already a semi-Auto installation script for Gentoo, so I started to make one, as it is my first script, and probarly far from finished, there wil be some bugs in it :) .

Just wondering what you all think of it



#Gentoo Installation Script(x86)(2004.2)

#Installs from Mandrake on Partitions

#Made by Echylo

#Contact: driesdesmet@linux.be or dries.de.smet@skynet.be



#Checks if user is root

if [ `id -u` != "0" ]; then

echo "Gentoo Installation Script 2004.2"

echo "Sorry, you are not root."

echo "Please restart script as root."



#When user is , it gives information about the script


echo "This script installs Gentoo from Mandrake"

echo "So no Live cd required"

echo "Created by Echylo"

echo "This is for x86 machines only."

echo "Working internet connection required"

echo "To continue press a key..."

read key


#Gives user opportunity to check its partitions

echo "The script will launch DiskDrake, for you to set partitions..."

echo "If set, just close Diskdrake"

echo "Press any key to continue"

read key

echo "Launching DiskDrake..."



echo "I suppose that you have set partitions, and you are ready to continue"

echo "Press a key to continue"

read key


#Asks for boot, swap and home partition


echo "What is the boot partition of your gentoo installation?"

echo "Example : /dev/hdb1"


echo "What is the Swap partition?"

read SWAP

echo "What is your Gentoo(home) partition?"



#Activates Swap partition, mounts boot & home partition

mkswap $SWAP

swapon $SWAP


mkdir /mnt/gentoo

mount $BOOTPART /mnt/gentoo

mkdir /mnt/gentoo/boot

mount $GENTOOHOME /mnt/gentoo/boot


#Downloading stage file

cd /mnt/gentoo


echo "Downloading Stage file..."

echo "Choose your location...(1-4)"

echo "1-  America"

echo "2 - Europe"

echo "3 - Australia"

echo "4 - Asia"


echo "Pick number:"

read LOC


if [ $LOC -eq 1 ]


echo "Downloading Stage 1 file..."

wget ftp://gentoo.chem.wisc.edu/gentoo/release...-2004.2.tar.bz2


elif [ $LOC -eq 2 ]


echo "Downloading Stage 1 file..."

wget ftp://ftp.snt.utwente.nl/pub/os/linux/gen...-2004.2.tar.bz2


elif [ $LOC -eq 3 ]


echo "Downloading Stage 1 file..."

wget ftp://planetmirror.com/pub/gentoo/release...-2004.2.tar.bz2


elif [ $LOC -eq 4 ]


echo "Downloading Stage 1 file..."

wget ftp://ftp.ecc.u-tokyo.ac.jp/GENTOO/releas...-2004.2.tar.bz2


echo "You have to pick a number between (1-4)!"

echo "Downloading Stage 1 file from default..."

wget ftp://gentoo.chem.wisc.edu/gentoo/release...-2004.2.tar.bz2




#Unpacks Stage1 tar file



echo "Stage 1 file Downloaded"

echo "Unpacking Stage 1 file..."


tar -xjpf stage1-x86-2004.2.tar.bz2


echo "Unpacked"



#Copies DNS information

echo "Copying DNS information"

cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf


#Mounts Proc filesystem

echo "Mounting proc filesystem"

mount -t proc none /mnt/gentoo/proc


#Chroots into new Enviroment"

echo "Chrooting into Enviroment"


chroot /mnt/gentoo /bin/bash


source /etc/profile


#Updates Portage Tree"

echo "Updating Portage tree"

emerge sync

cd /usr/portage


#Stage 1 -> Stage 2


echo "Stage 1 => Stage 2 "

echo "Press key to continue"

read key

echo "BootStraping..."



echo "Arrived in Stage 2"


#Emerging system


echo "Emerging system"


emerge system


#script finished until here :)

Edited by Echylo
Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

i wish i would have had such a script some weeks ago. installing gentoo was a pain in the a... continue your work. it is a great idea.


p.s.: now that i have gentoo running, i must say that i do not find it better or worse than e.g. slackware (and configuration an installation of slack was easy compared to gentoo). it is just another ordinary linux-distro. too much hype imho :P

Edited by arctic
Link to comment
Share on other sites

Just to give you a laugh --


I tried your script, and accidentally gave it the wrong partition for 'swap'. I ended up destroying my Mandrake '/' partition. :wall:


:lol: It could have been worse - it forced me to reinstall 10.1, and this time it is cleaner and better. ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...