http://www.extremebg.co.cc/images/work.pngТака се получи... Ето и целия код (има малки въпросителни още но мисля че и за тях има решение)
#!/bin/bash
# Инсталатор за Gentoo Linux
# Автор: Росен Александров -
sandikata@yandex.ru# Лиценз: Свободен (По желание на потребителя може да почерпи с кашонче бира
# Проверка за администраторски права
if [ `id -u` != "0" ]; then
echo "Добре дошли в инсталатора на Gentoo Linux"
echo "За да изпълните този скрипт ви трябва root."
echo "Моля стартирайте скрипта като root."
fi
echo
echo
echo
printf "\e[1;37mТози скрипт е предназначен за инсталиране на Gentoo Linux от вече съществуващ Линукс (Например Mandriva Sabayon Calculate Toorox Ubuntu). Необходимо е да имате някоя от тези или друга дистрибуция както и интернет връзка.\n"
printf "\e[1;37mЕдинствено трябва да сте търпеливи (Поне тези които сте с по стар хардуер)\n"
printf "\e[1;37mАвтор ROKO__ (Росен Александров -
sandikata@yandex.ru)\n"
printf "\e[1;37mВажно! Тази инсталация е за 64 бита. Трябва да имате съответния хардуер.\n"
echo
echo
#if [[ $(uname -m) == "x86_64" ]]; then printf "\e[0;32mПроцесорът ви поддържа x64"; else printf "\e[0;31mПроцесорът ви не поддържа x64"; fi
[[ $(uname -m) != "x86_64" ]] && printf "\e[0;31mПроцесорът ви не поддържа x64\n" && exit 1
printf "\e[0;32mПроцесорът ви поддържа x64\n"
echo "За да продължите с инсталацита натиснете произволен бутон"
read key
echo "Изберете дял за root (/)"
echo "Например : /dev/sda1"
read BOOTPART
echo "Изберете дял за SWAP (Допълнителна виртуална памет)"
read SWAP
mkswap $SWAP
swapon $SWAP
echo
echo "Изберете файлова система .. Например reiserfs, ext4"
read fs
if [ "$fs" == reiserfs ]
then
mkfs.reiserfs $BOOTPART
else
mkfs.ext4 $BOOTPART
fi
mkdir /mnt/gentoo
mount $BOOTPART /mnt/gentoo
cd /mnt/gentoo
echo "Изтегляне на Stage3 файл..."
echo "Изберете сървър...(1-4)"
echo "1- САЩ"
echo "2 - България"
echo "3 - Германия"
echo "4 - Холандия"
echo
echo "Pick number:"
read LOC
if [ $LOC -eq 1 ]
then
echo "Изтегляне на Stage 3..."
wget
http://distfiles.gentoo.org/releases/amd64/current-stage3/http://distfiles.gentoo.org/releases/amd64/current-stage3/stage3-amd64-20101021.tar.bz2elif [ $LOC -eq 2 ]
then
echo "Изтегляне на Stage 3..."
wget
ftp://ftp.gentoo.bg/releases/amd64/current-stage3/http://distfiles.gentoo.org/releases/amd64/current-stage3/stage3-amd64-20101021.tar.bz2elif [ $LOC -eq 3 ]
then
echo "Изтегляне на Stage 3..."
wget
http://mirror.netcologne.de/gentoo/releases/amd64/current-stage3/http://distfiles.gentoo.org/releases/amd64/current-stage3/stage3-amd64-20101021.tar.bz2elif [ $LOC -eq 4 ]
then
echo "Изтегляне на Stage 3..."
wget
http://gentoo.tiscali.nl/releases/amd64/current-stage3/http://distfiles.gentoo.org/releases/amd64/current-stage3/stage3-amd64-20101021.tar.bz2else
echo "Изберете бутон от (1-4)!"
echo "Downloading Stage 3 from default..."
wget
http://darkstar.ist.utl.pt/gentoo/releases/amd64/current-stage3/stage3-amd64-20100408.tar.bz2fi
echo "Изтегляне на Portage..."
echo "Изберете сървър...(1-4)"
echo "1- САЩ"
echo "2 - България"
echo "3 - Германия"
echo "4 - Холандия"
echo
echo "Изберете бутон (1-4)!"
read LOC
if [ $LOC -eq 1 ]
then
echo "Изтегляне на Portage..."
wget
http://distfiles.gentoo.org/snapshots/portage-latest.tar.bz2elif [ $LOC -eq 2 ]
then
echo "Изтегляне на Portage..."
wget
ftp://ftp.gentoo.bg/snapshots/portage-latest.tar.bz2elif [ $LOC -eq 3 ]
then
echo "Изтегляне на Portage..."
wget
http://mirror.netcologne.de/gentoo/releases/amd64/current-stage3/stage3-amd64-20100408.tar.bz2elif [ $LOC -eq 4 ]
then
echo "Изтегляне на Portage..."
wget
http://gentoo.tiscali.nl/snapshots/portage-latest.tar.bz2else
echo "You have to pick a number between (1-4)!"
echo "Downloading Portage from default..."
wget
http://darkstar.ist.utl.pt/gentoo/snapshots/portage-latest.tar.bz2fi
#Unpacks Stage3 tar file
clear
echo
echo "Stage3 е изтеглен"
echo "Portage е изтеглен"
echo "Разархивирам Stage3 и Portage..."
tar xjpf stage3*
tar xjf portage-latest.tar.bz2 -C /mnt/gentoo/usr
echo "Готово!"
echo
#Copies DNS information
echo "Копирам DNS"
cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
#Mounts Proc filesystem
echo "Монтирам proc и dev файлови системи"
mount -t proc proc /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev
echo "За да продължите инсталацията ви трябва Chroot скрипт. Можете да го изтеглите от тук ->
http://extremebg.co.cc/gentoo/Chroot"
#Chroots into new Enviroment"
echo "Вход в новата система"
chroot /mnt/gentoo /bin/bash
env-update
source /etc/profile