Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Unsupported Software
  • Search

Gentoo Auto automatic Installation Script

This forum covers all Gentoo-related software not officially supported by Gentoo. Ebuilds/software posted here might harm the health and stability of your system(s), and are not supported by Gentoo developers. Bugs/errors caused by ebuilds from overlays.gentoo.org are covered by this forum, too.
Post Reply
Advanced search
14 posts • Page 1 of 1
Author
Message
gentoo-freak
n00b
n00b
Posts: 16
Joined: Fri Sep 11, 2009 4:03 pm

Gentoo Auto automatic Installation Script

  • Quote

Post by gentoo-freak » Fri Sep 11, 2009 4:20 pm

I searched a lot about things like that but everywhere just code snippets. then i think i made myself just by thinking
DO IT YOURSELF :-P

Here is what i did..

Code: Select all


#!/bin/bash
# GENTOO INSTALL SCRIPT FROM BASE INSTALL AND DEFAULT CONFIGS
# Created by: Gentoo-Freak ©
#

# Display Introduction
echo "Welcome to the GENTOO install script, please note you must be at your system for instructions"
echo "this script will perform a majority of the configurations for you however certain interaction"
echo "may be required on your part."
echo
echo
echo "NOTE: THIS WILL RESULT IN DATA LOSS OF THE CURRENT DRIVE"
echo "Please press enter when your ready to continue."
read

# Configure hard disk
echo "The following is a list of found Hard Disk devices (sda/hda):"
ls /dev/ | grep -E [s:h]da$
echo
echo "Please enter the device you would like to install to:"
read HD_DEVICE
HDD="/dev/${HD_DEVICE}"

# warn user last time
echo
echo "THIS IS YOUR LAST CHANCE TO CANCEL, Press CTRL+C to cancel this install or ENTER to continue"
read
echo "p" | fdisk $HDD
echo "Please specifiy the total number of partitions:"
read PARTS

#TODO: add integer checking
echo -n "Generating fdisk operation file"
# Create fdisc auto file
((i = 1))
while (( i < PARTS ))
do
echo "d" >> fdisc.in
echo "$i" >> fdisc.in
((i += 1))
done
echo "d" 	>> fdisc.in	# Delete last sector
echo "n" 	>> fdisc.in	# New Partiton
echo "p" 	>> fdisc.in	# Primary
echo "1" 	>> fdisc.in	# Partion 1
echo "" 	>> fdisc.in	# default
echo "+32M" 	>> fdisc.in	# 32 MB size
echo "a" 	>> fdisc.in	# Set flag
echo "1" 	>> fdisc.in	# bootable
echo -n "."
echo "n" 	>> fdisc.in	# New Partion
echo "p" 	>> fdisc.in	# Primary
echo "2" 	>> fdisc.in	# Partion 2
echo "" 	>> fdisc.in	# default
echo "+512M" 	>> fdisc.in	# 512 MB size
echo "t" 	>> fdisc.in	# Set partition type
echo "2" 	>> fdisc.in	# Partition 2
echo "82" 	>> fdisc.in	# 82 = SWAP
echo -n "."
echo "n" 	>> fdisc.in	# New Partition
echo "p" 	>> fdisc.in	# Primary
echo "3" 	>> fdisc.in	# Partition 2
echo "" 	>> fdisc.in	# default
echo "" 	>> fdisc.in	# new Line
echo -n "."
echo "w" 	>> fdisc.in	# Write partion table
echo "q" 	>> fdisc.in	# Quit
echo ". Done"
# Execute file
echo "Executing fdisk script ..."
echo
fdisk $HDD < fdisc.in
#clean up
rm -f fdisc.in
echo ""
echo "Partions created"
echo "Applying filesystem to partitions"
mke2fs /dev/${HD_DEVICE}1
mke2fs -j /dev/${HD_DEVICE}3
mkswap /dev/${HD_DEVICE}2
echo "Activating swap partition"
swapon /dev/${HD_DEVICE}2
echo ""
echo "Mounting partitions"
mount /dev/${HD_DEVICE}3 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/${HD_DEVICE}1 /mnt/gentoo/boot
echo "Starting STAGE 3 Install"
echo ""
cd /mnt/gentoo
wget ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo/releases/x86/2008.0/stages/stage3-x86-2008.0.tar.bz2
tar xvjpf stage3-*.tar.bz2
echo ""
echo "Installing portage..."
cd /mnt/gentoo
wget ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo/snapshots/portage-20090514.tar.bz2
tar xvjf /mnt/gentoo/portage-latest.tar.bz2 -C /mnt/gentoo/usr
echo "Cleaning up..."
rm -f portage-latest.tar.bz2
rm -f stage3-x86-2006.1.tar.bz2
echo ""
echo "Getting ready to CHROOT"
cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev
echo "Chrooted"
echo "Updating portage..."
sleep 2
chroot /mnt/gentoo emerge --sync
echo "Patching portage..."
chroot /mnt/gentoo emerge portage
echo "Portage updated, downloading kernel source..."
sleep 2

echo "#!/bin/bash" > /mnt/gentoo/portage
echo 'USE="-doc symlink" emerge gentoo-sources' >> /mnt/gentoo/portage
chmod 700 /mnt/gentoo/portage
chroot /mnt/gentoo ./portage
rm -f /mnt/gentoo/portage

echo "#!/bin/bash" > /mnt/gentoo/portage
echo 'cd /usr/src/linux' >> /mnt/gentoo/portage
echo 'echo ""' >> /mnt/gentoo/portage
echo 'echo "***************************************************"' >> /mnt/gentoo/portage
echo 'echo "**            KERNEL CONFIGURATION               **"' >> /mnt/gentoo/portage
echo 'echo "***************************************************"' >> /mnt/gentoo/portage
echo 'echo "* You will now be prompted with the linux kernel  *"' >> /mnt/gentoo/portage
echo 'echo "*menu configurator, please ensure that you specify*"' >> /mnt/gentoo/portage
echo 'echo "*the right settings, as once you exit this script *"' >> /mnt/gentoo/portage
echo 'echo "*will compile and install the new kernel          *"' >> /mnt/gentoo/portage
echo 'echo "***************************************************"' >> /mnt/gentoo/portage
echo 'echo ""' >> /mnt/gentoo/portage
echo 'echo "Please press enter to continue"' >> /mnt/gentoo/portage
echo 'read' >> /mnt/gentoo/portage
echo 'make menuconfig' >> /mnt/gentoo/portage
echo 'make && make modules_install' >> /mnt/gentoo/portage
echo 'cp arch/i386/boot/bzImage /boot/originalKernel' >> /mnt/gentoo/portage
echo 'echo ""' >> /mnt/gentoo/portage
chmod 700 /mnt/gentoo/portage
chroot /mnt/gentoo ./portage
rm -f /mnt/gentoo/portage

echo "Generating FSTAB"
#GENERATE FSTAB
echo "# /etc/fstab: static file system information." > /mnt/gentoo/etc/fstab
echo "#" >> /mnt/gentoo/etc/fstab
echo "# noatime turns off atimes for increased performance (atimes normally aren't" >> /mnt/gentoo/etc/fstab
echo "# needed; notail increases performance of ReiserFS (at the expense of storage" >> /mnt/gentoo/etc/fstab
echo "# efficiency).  It's safe to drop the noatime options if you want and to" >> /mnt/gentoo/etc/fstab
echo "# switch between notail / tail freely." >> /mnt/gentoo/etc/fstab
echo "#" >> /mnt/gentoo/etc/fstab
echo "# The root filesystem should have a pass number of either 0 or 1." >> /mnt/gentoo/etc/fstab
echo "# All other filesystems should have a pass number of 0 or greater than 1." >> /mnt/gentoo/etc/fstab
echo "#" >> /mnt/gentoo/etc/fstab
echo "# See the manpage fstab(5) for more information." >> /mnt/gentoo/etc/fstab
echo "#" >> /mnt/gentoo/etc/fstab
echo "" >> /mnt/gentoo/etc/fstab
echo "# <fs>                  <mountpoint>    <type>          <opts>          <dump/pass>" >> /mnt/gentoo/etc/fstab
echo "" >> /mnt/gentoo/etc/fstab
echo "# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts." >> /mnt/gentoo/etc/fstab
echo "/dev/${HD_DEVICE}1               /boot           ext2            noauto,noatime  1 2" >> /mnt/gentoo/etc/fstab
echo "/dev/${HD_DEVICE}3               /               ext3            noatime         0 1" >> /mnt/gentoo/etc/fstab
echo "/dev/${HD_DEVICE}2               none            swap            sw              0 0" >> /mnt/gentoo/etc/fstab
echo "#/dev/cdroms/cdrom0      /mnt/cdrom      iso9660         noauto,ro       0 0" >> /mnt/gentoo/etc/fstab
echo "#/dev/fd0               /mnt/floppy     auto            noauto          0 0" >> /mnt/gentoo/etc/fstab
echo "" >> /mnt/gentoo/etc/fstab
echo "# NOTE: The next line is critical for boot!" >> /mnt/gentoo/etc/fstab
echo "proc                    /proc           proc            defaults        0 0" >> /mnt/gentoo/etc/fstab
echo "" >> /mnt/gentoo/etc/fstab
echo "# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for" >> /mnt/gentoo/etc/fstab
echo "# POSIX shared memory (shm_open, shm_unlink)." >> /mnt/gentoo/etc/fstab
echo "# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will" >> /mnt/gentoo/etc/fstab
echo "#  use almost no memory if not populated with files)" >> /mnt/gentoo/etc/fstab
echo "shm                     /dev/shm        tmpfs           nodev,nosuid,noexec     0 0" >> /mnt/gentoo/etc/fstab
cat /mnt/gentoo/etc/fstab
echo ""
echo "Configuring rc scripts"
chroot /mnt/gentoo rc-update add net.eth0 default
chroot /mnt/gentoo rc-update add sshd default
echo "*************** ROOT PASSWORD ********************"
echo "YOU ARE NOW REQUIRED TO ENTER A NEW ROOT PASSWORD "
echo "**************************************************"
chroot /mnt/gentoo passwd
echo "Installing tools..."
chroot /mnt/gentoo emerge syslog-ng vixie-cron slocate dhcpcd
chroot /mnt/gentoo rc-update add syslog-ng default
chroot /mnt/gentoo rc-update add vixie-cron
echo ""
echo ""
echo "Installing LILO"
chroot /mnt/gentoo emerge lilo
echo "boot=/dev/${HD_DEVICE}       # Install LILO in the MBR" >> /mnt/gentoo/etc/lilo.conf
echo "prompt                    # Give the user the chance to select another section" >> /mnt/gentoo/etc/lilo.conf
echo "timeout=50                # Wait 5 (five) seconds before booting the default section" >> /mnt/gentoo/etc/lilo.conf
echo "default=gentoo            # When the timeout has passed, boot the "gentoo" section" >> /mnt/gentoo/etc/lilo.conf
echo "" >> /mnt/gentoo/etc/lilo.conf
echo "# For non-genkernel users" >> /mnt/gentoo/etc/lilo.conf
echo "image=/boot/originalKernel" >> /mnt/gentoo/etc/lilo.conf
echo "        label=gentoo            # Name we give to this section" >> /mnt/gentoo/etc/lilo.conf
echo "        read-only               # Start with a read-only root. Do not alter!" >> /mnt/gentoo/etc/lilo.conf
echo "        root=/dev/${HD_DEVICE}3          # Location of the root filesystem" >> /mnt/gentoo/etc/lilo.conf
chroot /mnt/gentoo lilo
cd /
umount /mnt/gentoo/boot /mnt/gentoo/dev /mnt/gentoo/proc /mnt/gentoo
echo "Done"
echo "****************************"
echo "****************************"
echo "** SYSTEM WILL NOW REBOOT **"
echo "****************************"
echo "****************************"
sleep 5

i need people they know what they do and can modify the script for all people with maybe autodedect raid support for sofware raids or those things.

i wrote it especially for people they want to be just in time if they need a fresh minimal gentoo installation...

one possibility is to add first of all mirrorselect in the script, but keep going, try out and report any bugs.
and it musst me possible to choose:

Optional but nice to have..
  • arch
    raid or not
    maybee and individuall kernel config

http://dev.gentoo.org/~agaffney/quickstart.php

this is one way we can start at all..

have phun try out ;) your gentoo-freak
Top
dreadlorde
Apprentice
Apprentice
User avatar
Posts: 243
Joined: Tue Dec 16, 2008 8:29 pm
Location: /adm/timezone/US_Michigan
Contact:
Contact dreadlorde
Website

  • Quote

Post by dreadlorde » Sun Sep 13, 2009 9:52 pm

I started something like this for chroot's a while back. I never finished it, but I hope to this week if I don't have too much school work.

Code: Select all

#!/bin/sh
#
# This script is in the public domain.
clear

if [ `id -u` != '0' ]; then
	echo "Welcome to Dread's Funtoo installer v0.0!"
	echo "You need to be root to run this script"
	exit 1
else
	echo "Welcome to Dread's Funtoo installer v0.0!"
	echo
	echo "This script helps you with an install of Funtoo, a Gentoo GNU/Linux\
 variant."
	echo
	echo "You need a internet connection, and at least the Gentoo minimal\
 install cd."
	echo
	echo "This guide follows the Gentoo Handbook up to the point of installing\
 grub, then you're on your own. I assume you already have set up partitions,\
 and have mounted them accordingly."
	echo
	echo "If you're sure you want to continue with the installation,"
	echo "Press any key to continue"
	read key
fi

if [ -z /usr/bin/vim ]; then
	EDIT=vim
else
	EDIT=nano
fi

echo "Where do you want your chroot to be? No trailing /'s"
read CHRT
echo "Your chroot will be installed in" $CHRT"."

echo
echo "Now you need to choose an architecture"
echo "	1: Core 2"
echo "	2: AMD64"
echo "	3: Pentium 4"
echo "	4: Athlon XP"
echo "	5: i686"
echo "	6: x86"
echo "	7: Opteron"
echo
read ARCH

if [ $ARCH = '1' ]; then
	ARCH=core2
elif [ $ARCH = '2' ]; then
	ARCH=amd64
elif [ $ARCH = '3' ]; then
	ARCH=pentium4
elif [ $ARCH = '4' ]; then
	ARCH=anthlon-xp
elif [ $ARCH = '5' ]; then
	ARCH=i686
elif [ $ARCH = '6' ]; then
	ARCH=x86
elif [ $ARCH = '7' ]; then
	ARCH=opteron
fi
echo
echo "You've choosen" $ARCH "as your architecture."
echo

echo "I'm going to fetch your tarball, and put it in" $CHRT"."
wget http://funtoo.org/linux/~funtoo/$ARCH/stage3-$ARCH-current.tar.bz2 -o $CHRT/stage3-$ARCH-current.tar.bz2
echo "And now for the portage tree"
wget http://funtoo.org/linux/~funtoo/snapshots/portage-current.tar.bz2 -o $CHRT/portage-current.tar.bz2

echo "Extracting" $ARCH "stage 3 tar ball"
echo "Press a key to begin"
read BEGIN
tar xjpf $CHRT/stage3-$ARCH-current.tar.bz2 -C $CHRT

echo "Extracting portage tree"
echo "Press a key to begin"
read BEGIN
tar xjf $CHRT/portage-current.tar.bz2 -C $CHRT/usr/

echo "Now you're going to edit /etc/make.conf. It's suggested that you don't\
 set any USE flags yet, and only set CFLAGS, CXXFLAGS, LDFLAGS, and MAKEFLAGS,\
 but you can set them if you want."
echo
echo "Press any key to edit /etc/make.conf"
read CONF
$EDIT /etc/make.conf

echo "Time to set the SYNC and GENTOO_MIRRORS variables in /etc/make.conf.\
 We're going to use mirrorselect to pick the fastest mirrors."
echo "Press any key to continue."
read MIRRORS
mirrorselect -i -o >> $CHRT/etc/make.conf
mirrorselect -i -r -o >> $CHRT/etc/make.conf

echo "I'm going to copy over /etc/resolve.conf to the chroot so that you can\
 connect to the interbutts from the chroot."
echo "Press any key to continue"
read COPY
cp -L /etc/resolve.conf $CHROOT/etc/
Ludwig von Mises Institute
I am not to be a shepherd, I am not to be a grave-digger. No longer will I speak to the people; for the last time I have spoken to the dead.
Top
krinn
Watchman
Watchman
User avatar
Posts: 7476
Joined: Fri May 02, 2003 6:14 am

  • Quote

Post by krinn » Thu Sep 17, 2009 9:25 am

not so bad, i don't get it, why the partitions number loop ?

also
cat /proc/partitions |grep $(HD_DEVICE) (less 1) should return it without need to ask user

also, on installation, drives letters aren't always the same when linux boot.
I suggest so :
mke2fs /dev/${HD_DEVICE}1 -L autoboot
mke2fs -j /dev/${HD_DEVICE}3 -L autoroot
mkswap /dev/${HD_DEVICE}2 -L autoswap

echo "/dev/disk/by-label/autoboot /boot ext2 noauto,noatime 1 2" >> /mnt/gentoo/etc/fstab
echo "/dev/disk/by-label/autoroot / ext3 noatime 0 1" >> /mnt/gentoo/etc/fstab
echo "/dev/disk/by-label/autoswap none swap sw 0 0" >> /mnt/gentoo/etc/fstab
Top
Kaddy
n00b
n00b
Posts: 29
Joined: Thu Jan 27, 2005 2:43 pm
Contact:
Contact Kaddy
Website

  • Quote

Post by Kaddy » Fri Sep 18, 2009 5:03 am

a couple of additions that would be nice:

Adding an option for local mirrors:

Code: Select all

echo -e "Do you have have a local gentoo rsync? (Default is No) [Yes/No] \c"
read local_rsync

if [ "$local_rsync" == "yes" ]
then
	echo -e "What is the IP of the rsync server? \c"
	read rsync_ip
elif [ "$local_rsync" == "Yes" ]
then
	echo -e "What is the IP of the rsync server? \c"
	read rsync_ip
elif [ "$local_rsync" == "no" ]
then
	rsync_ip="rsync.namerica.gentoo.org"
elif [ "$local_rsync" == "No" ]
then
	rsync_ip="rsync.namerica.gentoo.org"
elif [ "$local_rsync" == "" ]
then
	rsync_ip="rsync.namerica.gentoo.org"
else
	echo "DAMNIT"
fi

echo "SYNC=\"rsync://$rsync_ip/gentoo-portage\"" >> make.conf
The other one is adding info to make.conf

Code: Select all

# Remove the make.conf in etc
cd etc
rm -f make.conf

# Write in the config values
make_conf_cflag="-O2 -march=$selected_arch -pipe -fomit-frame-pointer"
make_conf_cxxflag="\${CFLAGS)"
make_conf_keyword="$ARCH"
make_conf_features="sandbox ccache nostrip fixpackages"
make_conf_overlay="/usr/local/portage"
make_conf_use="apache2 php ssl pam gd mysql png samba wireshark xml zip -ipv6 -nls"

# Get CHOST value
if [ "$ARCH" == "x86" ]
then
	make_conf_chost="i486-pc-linux-gnu"
elif [ "$ARCH" == "i686" ]
then
	make_conf_chost="i686-pc-linux-gnu"
fi
# etc 

echo "CFLAG=\"$make_conf_cflag\"" > make.conf
echo "CXXFLAG=\"$make_conf_cxxflag\"" >> make.conf
echo "ACCEPT_KEYWORDS=\"$make_conf_keyword\"" >> make.conf
echo "FEATURES=\"$make_conf_features\"" >> make.conf
echo "PORTDIR_OVERLAY=\"$make_conf_overlay\"" >> make.conf
echo "CHOST=\"$make_conf_chost\"" >> make.conf
echo "USE=\"$make_conf_use\"" >> make.conf
Both of those remove some possibility of user error.

Lastly, you can shorten the installation of the partition tables, not to mention removing old ones by doing this:

Code: Select all

num_partitions=$(fdisk -l | grep ^/dev | grep -ic $selected_drive)

echo "There are" $num_partitions "partitions on" $selected_drive

partitions=1

# Clear existing partition file
rm -rf partition_table
touch partition_table

while [ "$partitions" -le "$num_partitions" ]
do
	# Find partition numbers
	edit_partitions=$(fdisk -l | grep ^/dev/$selected_drive | cut -c9)
	
	# Parse out extra partitons
	if [ "$partitions" == "1" ]
	then
		work_partition=$(echo -e $edit_partitions | cut -c$partitions)
		# Write to partition_table file
		echo -e "d\n$work_partition" >> partition_table
	else
		if [ "$partitions_cut" == "" ]
		then
			# If First Partition after partition 1, cut off $partitions + 1
			partitions_cut=$(($partitions+1))
		else
			partitions_cut=$(($partitions_cut+1))
		fi
		work_partition=$(echo -e $edit_partitions | cut -c$partitions_cut)
		# Write to partition_table file
		echo -e "d\n$work_partition" >> partition_table
		((partitions_cut += 1))
	fi
	((partitions += 1))
	
done

# build the rest of the table
# Get Total System Memory
total_mem=$(cat /proc/meminfo | grep -i memtotal | cut -c16- | sed s/\ // | sed s/kB//)
swap_space=$(expr $(expr $total_mem + $total_mem) / 1024)

# Write first partition to file
echo -e "n\np\n1\n\n+100M\n" >> partition_table

# Write Swap Space (double system memory)
echo -e "n\np\n2\n\n+"$swap_space"M\n">> partition_table

# Write / partition to file
echo -e "n\np\n3\n\n\n" >> partition_table

# Write partition setting to file and drive write
echo -e "a\n1\nt\n2\n82\nw\n" >> partition_table

# Set drive number variables
boot_drive=$(echo $selected_drive"1")
swap_drive=$(echo $selected_drive"2")
root_drive=$(echo $selected_drive"3")

# KEEP THIS COMMENTED OUT BELLOW HERE
fdisk /dev/$selected_drive < partition_table
This not only deletes previous partitions, but also calculates swap size based on system memory. Granted, there should be a limit to that number.
Top
andretti
Tux's lil' helper
Tux's lil' helper
Posts: 94
Joined: Sun Feb 25, 2007 1:54 am

  • Quote

Post by andretti » Fri Sep 18, 2009 11:24 pm

That's exactly what I always have been doing. I started with my first script. After that every time I setup a new Gentoo, I make some improvements... and after 10 or so installations, I find my script changed from very automated to very manual...
Top
dreadlorde
Apprentice
Apprentice
User avatar
Posts: 243
Joined: Tue Dec 16, 2008 8:29 pm
Location: /adm/timezone/US_Michigan
Contact:
Contact dreadlorde
Website

  • Quote

Post by dreadlorde » Sun Sep 27, 2009 10:40 pm

I've updated my script. The first half is done. Note that atm it's only for chroot's.

Code: Select all

#!/bin/sh
#
# This script is in the public domain everywhere thanks to CC0.
clear

if [ `id -u` != '0' ]; then
	echo "Welcome to Dread's Funtoo installer v0.0!"
	echo "You need to be root to run this script"
	exit 1
else
	echo "Welcome to Dread's Funtoo installer v0.0!"
	echo
	echo "This script helps you with an install of Funtoo, a Gentoo GNU/Linux\
 variant."
	echo
	echo "You need a internet connection, and at least the Gentoo minimal\
 install cd."
	echo
	echo "This guide follows the Gentoo Handbook up to the point of installing\
 grub, then you're on your own. I assume you already have set up partitions,\
 and have mounted them accordingly."
	echo
	echo "This and all scripts that are associated with it are in the public\
 domain thanks to CC0. Do what you want with it."
 	echo
	echo "If you're sure you want to continue with the installation,"
	echo "Press Enter to continue"
	read key
fi

echo "Where do you want your chroot to be? No trailing /'s"
read CHRT
echo "Your chroot will be installed in" $CHRT"."

echo
echo "Now you need to choose an architecture"
echo "	1: Core 2"
echo "	2: AMD64"
echo "	3: Pentium 4"
echo "	4: Athlon XP"
echo "	5: i686"
echo "	6: x86"
echo "	7: Opteron"
echo
read ARCH

if [ $ARCH = '1' ]; then
	ARCH=core2
elif [ $ARCH = '2' ]; then
	ARCH=amd64
elif [ $ARCH = '3' ]; then
	ARCH=pentium4
elif [ $ARCH = '4' ]; then
	ARCH=athlon-xp
elif [ $ARCH = '5' ]; then
	ARCH=i686
elif [ $ARCH = '6' ]; then
	ARCH=x86
elif [ $ARCH = '7' ]; then
	ARCH=opteron
fi
echo
echo "You've choosen" $ARCH "as your architecture."
echo

echo "I'm going to fetch your tarball, and put it in" $CHRT"."
wget http://funtoo.org/linux/~funtoo/$ARCH/stage3-$ARCH-current.tar.bz2 -O $CHRT/stage3-$ARCH-current.tar.bz2
echo "And now for the portage tree"
wget http://funtoo.org/linux/~funtoo/snapshots/portage-current.tar.bz2 -O $CHRT/portage-current.tar.bz2

echo "Extracting" $ARCH "stage 3 tar ball"
echo "Press Enter to begin"
read BEGIN
tar -xjpf $CHRT/stage3-$ARCH-current.tar.bz2 -C $CHRT

echo "Extracting portage tree"
echo "Press Enter to begin"
read BEGIN
tar -xjf $CHRT/portage-current.tar.bz2 -C $CHRT/usr/

echo "Now you're going to edit /etc/make.conf. It's suggested that you don't\
 set any USE flags yet, and only set CFLAGS, CXXFLAGS, LDFLAGS, and MAKEFLAGS,\
 but you can set them if you want."
echo
echo "Press Enter to edit /etc/make.conf"
read CONF
$EDITOR $CHRT/etc/make.conf

echo "Time to set the SYNC and GENTOO_MIRRORS variables in /etc/make.conf.\
 We're going to use mirrorselect to pick the fastest mirrors."
echo "Press Enter to continue."
read MIRRORS
mirrorselect -i -o >> $CHRT/etc/make.conf
mirrorselect -i -r -o >> $CHRT/etc/make.conf

echo "I'm going to copy over /etc/resolv.conf to" $CHRT"/etc so that you can\
 connect to the interbutts from the chroot."
echo "Press Enter to continue"
read COPY
cp -L /etc/resolv.conf $CHRT/etc/

echo "Mounting" $CHRT"/dev and" $CHRT"/proc with the options"
echo "mount -t proc none" $CHRT"/proc"
echo "mount -o bind /dev" $CHRT"/dev"
echo "Press Enter to mount proc and dev"
read MOUNT
mount -t proc none $CHRT/proc
mount -o bind /dev $CHRT/dev

echo "The last part for this script is chrooting and copying funtoo-install-2.sh\
 , and make it executable so you can run it from inside the chroot."
echo "Press Enter to do so"
cp $HOME/funtoo-install-pt2.sh $CHRT/root/pt2.sh
if [ -x $CHRT/root/pt2.sh ]; then
	chmod +x $CHRT/root/pt2.sh
else
	echo "funtoo-install-pt2.sh wasn't copied. Make sure all shell scripts are\
 in $HOME"
	exit 1
fi
Last edited by dreadlorde on Tue Sep 29, 2009 1:43 am, edited 2 times in total.
Ludwig von Mises Institute
I am not to be a shepherd, I am not to be a grave-digger. No longer will I speak to the people; for the last time I have spoken to the dead.
Top
Mike Hunt
Watchman
Watchman
User avatar
Posts: 5287
Joined: Sun Jul 19, 2009 11:01 pm

  • Quote

Post by Mike Hunt » Sun Sep 27, 2009 11:08 pm

Nice :)

dreadlorde, is that a typo?
cp -L /etc/resolv.conf $CHROOT/etc/
Top
dreadlorde
Apprentice
Apprentice
User avatar
Posts: 243
Joined: Tue Dec 16, 2008 8:29 pm
Location: /adm/timezone/US_Michigan
Contact:
Contact dreadlorde
Website

  • Quote

Post by dreadlorde » Sun Sep 27, 2009 11:40 pm

Mike Hunt wrote:Nice :)

dreadlorde, is that a typo?
cp -L /etc/resolv.conf $CHROOT/etc/
Yes, it should be $CHRT. I'll fix it.
Ludwig von Mises Institute
I am not to be a shepherd, I am not to be a grave-digger. No longer will I speak to the people; for the last time I have spoken to the dead.
Top
Mike Hunt
Watchman
Watchman
User avatar
Posts: 5287
Joined: Sun Jul 19, 2009 11:01 pm

  • Quote

Post by Mike Hunt » Mon Sep 28, 2009 12:22 am

It might be a good idea to add checkout and sync

Code: Select all

echo "Extracting portage tree"
echo "Press Enter to begin"
read BEGIN
tar -xjf $CHRT/portage-current.tar.bz2 -C $CHRT/usr/

cd $CHRT/usr/portage
git checkout funtoo.org
emerge --sync
cd -
Top
dreadlorde
Apprentice
Apprentice
User avatar
Posts: 243
Joined: Tue Dec 16, 2008 8:29 pm
Location: /adm/timezone/US_Michigan
Contact:
Contact dreadlorde
Website

  • Quote

Post by dreadlorde » Mon Sep 28, 2009 6:03 pm

Mike Hunt wrote:It might be a good idea to add checkout and sync

Code: Select all

echo "Extracting portage tree"
echo "Press Enter to begin"
read BEGIN
tar -xjf $CHRT/portage-current.tar.bz2 -C $CHRT/usr/

cd $CHRT/usr/portage
git checkout funtoo.org
emerge --sync
cd -
That's for part 2, when you're in the chroot.
Ludwig von Mises Institute
I am not to be a shepherd, I am not to be a grave-digger. No longer will I speak to the people; for the last time I have spoken to the dead.
Top
Earthwings
Bodhisattva
Bodhisattva
User avatar
Posts: 7753
Joined: Mon Apr 14, 2003 8:13 pm
Location: Germany

  • Quote

Post by Earthwings » Mon Sep 28, 2009 7:10 pm

Moved from Installing Gentoo to Unsupported Software.
KDE
Top
Ant P.
Watchman
Watchman
Posts: 6920
Joined: Sat Apr 18, 2009 7:18 pm
Contact:
Contact Ant P.
Website

  • Quote

Post by Ant P. » Tue Sep 29, 2009 1:09 am

There's a typo in there, "anthlon-xp" should be athlon-xp
Top
dreadlorde
Apprentice
Apprentice
User avatar
Posts: 243
Joined: Tue Dec 16, 2008 8:29 pm
Location: /adm/timezone/US_Michigan
Contact:
Contact dreadlorde
Website

  • Quote

Post by dreadlorde » Tue Sep 29, 2009 1:43 am

Ant_P wrote:There's a typo in there, "anthlon-xp" should be athlon-xp
Fixed.
Ludwig von Mises Institute
I am not to be a shepherd, I am not to be a grave-digger. No longer will I speak to the people; for the last time I have spoken to the dead.
Top
gentoo-freak
n00b
n00b
Posts: 16
Joined: Fri Sep 11, 2009 4:03 pm

Thank you all for reply

  • Quote

Post by gentoo-freak » Thu Nov 12, 2009 11:09 pm

hi guys,

i have to say thank you for all reply to this thread...

i'll be very happy that i could start a discussion like above 8)

i use gentoo about 2 years now and i need often a new system because gentoo-linux is the best way to configure fast and also secure servers!
the (my) requirements of the first thread refer mainly to the different archs out there...
customers have not only AMD or INTEL !! the have also SPARC (old goddies :wink: )

with these posts you all helped me and other people to work better with gentoo linux!
That's exactly what I always have been doing. I started with my first script. After that every time I setup a new Gentoo, I make some improvements... and after 10 or so installations, I find my script changed from very automated to very manual...
if you ALWAYS do gentoo install scripts in your life ;) its not good maan 8) go out there drink a beer and enjoy real life ;)
i started this discussion with the incentive to reduce the time that you sit in front of your screen and wait for the compile on old machines!

you'll be in the right that manual systems are better then automatic but i think i speak for many administrators out there, that we have no time :lol:


extract stage3-installer
---> emerge base system
--> get some beer / coffee
--> going to eat something
---> get back, base system finished after 8h!!!

i hope you understand what waiting means if you have no quad-cores just single core AMD Duron by your Customer :lol:

to all other out there, thread has been moved to "UNSUPPORTED" :lol: :

is it possible to crosscompile with distcc maybe for an ARM Processor ? (is it also "unsupported" ?! )

ive also tested the "gentoo mobile way" on my
HTC Pro Diamond Touch 2 with an ARM Processor but it needs a lot of time to get an really functionality kernel and 2x250Mhz on your mobile phone isn't really much 8)

i'm looking forward to finish this discussion on the user way to get an functional and usable ( non GUI!!!! ) install script for the basic gentoo features

have a nice day
gentoo-freak
Top
Post Reply

14 posts • Page 1 of 1

Return to “Unsupported Software”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic