Jump to content
  • Announcements

    • spinynorman

      Mandriva Official Documentation

      Official documentation for extant versions of Mandriva can be found at doc.mandriva.com.   Documentation for the latest release may take some time to appear there. You can install all the manuals from the main repository if you have Mandriva installed - files are prefixed mandriva-doc.
    • paul

      Forum software upgrade   10/29/17

      So you may have noticed the forum software has upgraded !!!
      A few things that have changed. We no longer have community blogs (was never really used) We no longer have a portal page.
      We can discuss this, and decide whether it is needed (It costs money) See this thread: Here
Sign in to follow this  

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

Share this post

Link to post
Share on other sites

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

Share this post

Link to post
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. ;)

Share this post

Link to post
Share on other sites

omg :P sorry , and I don't think I will continue working on it, working with Ubuntu now, so no time for gentoo :P

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this