Léa-Linux & amis :   LinuxFR   GCU-Squad   GNU
Installer Gentoo sans se fatiguer
Envoyé par: Neuromancien

J'ai écrit le script suivant, qui reprend toutes les étapes de l'installation de Gentoo (installation GRP à partir d'une autre distribution installée). Dites moi ce que vous en pensez. Je suis en train de le tester.

echo "Gentoo-Installer version 0.1"
echo "02/2004"
echo "Installation de Gentoo (GRP)"
mount /mnt/cdrom
echo -n "Partition racine [hda1] : "
read root_partition
if [ -z "$root_partition" ]
then
root_partition=hda1
fi
echo -n "Voulez vous formater /dev/$root_partition (o/n) ?"
read choice
if [ $choice = o ]
then
mke2fs -j /dev/$root_partition
fi
mkdir /mnt/gentoo
mount /dev/$root_partition /mnt/gentoo

echo -n "Partition /boot [Aucune] : "
read boot_partition
if [ -n "$boot_partition" ]
then
mke2fs -j /dev/$boot_partition
mkdir /mnt/gentoo/boot
mount /dev/$root_partition /mnt/gentoo/boot
fi

echo -n "Partition /usr [Aucune] : "
read usr_partition
if [ -n "$usr_partition" ]
then
mkreiserfs /dev/$usr_partition
mkdir /mnt/gentoo/usr
mount /dev/$usr_partition /mnt/gentoo/usr
fi

echo -n "Partition /var [Aucune] : "
read var_partition
if [ -n "$var_partition" ]
then
mkreiserfs /dev/$var_partition
mkdir /mnt/gentoo/var
mount /dev/$var_partition /mnt/gentoo/var
fi

echo -n "Partition /home [Aucune] : "
read home_partition
if [ -n "$home_partition" ]
then

echo -n "Voulez vous formater /dev/$home_partition (o/n) ?"
read choice
if [ $choice = o ]
then
mkreiserfs /dev/$home_partition
fi
mkdir /mnt/gentoo/home
mount /dev/$home_partition /mnt/gentoo/home
fi

echo -n "Partition SWAP : "
read swap_partition

cd /mnt/gentoo
tar -xvjpf /mnt/cdrom/stages/stage3-*.tar.bz2
tar -xvjf /mnt/cdrom/snapshots/portage-*.tar.bz2 -C /mnt/gentoo/usr

cp -R /mnt/cdrom/distfiles /mnt/gentoo/usr/portage/distfiles
cp -a /mnt/cdrom/packages /mnt/gentoo/usr/portage/packages

mount -t proc proc /mnt/gentoo/proc
cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
chroot /mnt/gentoo /bin/bash
env-update
source /etc/profile

ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime

echo "# /etc/fstab: information des systèmes de fichiers." > /etc/fstab
echo "#" >> /etc/fstab
echo "# noatime désactive atimes afin d'améliorer les performances (atimes n'est généralement" >> /etc/fstab
echo "# pas nécessaire ; notail améliore les performances de ReiserFS (avec une légère perte" >> /etc/fstab
echo "# d'efficacité de stockage). Vous pouvez supprimer l'option noatime si vous voulez et" >> /etc/fstab
echo "# utiliser notail ou tail sans contraintes." >> /etc/fstab
echo "" >> /etc/fstab
echo "# <fs> <mount point> <type> <opts> <dump/pass>" >> /etc/fstab
echo "" >> /etc/fstab
echo "# NOTE: Si votre partition BOOT est en ReiserFS, ajoutez l'option notail à opts." >> /etc/fstab
echo "" >> /etc/fstab

if [ -n "$boot_partition" ]
then
echo "/dev/$boot_partition /boot ext3 noauto,noatime 1 2" >> /etc/fstab
fi

echo "/dev/$root_partition / ext3 noauto,noatime 0 1" >> /etc/fstab

echo "/dev/$swap_partition none swap sw 0 0" >> /etc/fstab

if [ -n "$usr_partition" ]
then
echo "/dev/$usr_partition /usr reiserfs noauto,noatime 0 0" >> /etc/fstab
fi

if [ -n "$var_partition" ]
then
echo "/dev/$var_partition /var reiserfs noauto,noatime 0 0" >> /etc/fstab
fi

if [ -n "$home_partition" ]
then
echo "/dev/$home_partition /home reiserfs noauto,noatime 0 0" >> /etc/fstab
fi

echo "/dev/scd0 /mnt/cdrom iso9660 noauto,ro,user 0 0" >> /etc/fstab

echo "/dev/scd1 /mnt/cdwriter iso9660 noauto,ro,user 0 0" >> /etc/fstab

echo "none /proc proc defaults 0 0" >> /etc/fstab

cd /usr/portage/packages/All
echo "Installation et configuration du kernel"
emerge -k gentoo-sources*
emerge -k genkernel*
genkernel

emerge -k hotplug
rc-update add hotplug default

echo -n "Voulez vous installer les drivers NVIDIA (o/n) ?"
read choice
if [ $choice = o ]
then
cd /usr/portage/distfiles
emerge -k NVIDIA_kernel*
cd /usr/portage/packages/All
fi

emerge -k sysklogd
rc-update add sysklogd default

emerge -k vcron
rc-update add vcron default

echo -n "Voulez vous installer rp-pppoe (o/n) ?"
read choice
if [ $choice = o ]
then
emerge -k rp-pppoe*
fi

echo -n "Voulez vous installer le support pour les systèmes de fichier XFS (o/n) ?"
read choice
if [ $choice = o ]
then
emerge -k xfsprogs*
fi

echo -n "Voulez vous installer le support pour les systèmes de fichier ReiserFS (o/n) ?"
read choice
if [ $choice = o ]
then
emerge -k reiserfsprogs*
fi

echo -n "Voulez vous installer le support pour les systèmes de fichier JFS (o/n) ?"
read choice
if [ $choice = o ]
then
emerge -k jfsutils*
fi

echo -n "Voulez vous installer le support pour les systèmes de fichier LVM (o/n) ?"
read choice
if [ $choice = o ]
then
emerge -k lvm-user*
fi

echo -n "Voulez vous installer le support PCMCIA (o/n) ?"
read choice
if [ $choice = o ]
then
emerge -k pcmcia-cs*gz
rc-update add pcmcia boot
fi

echo "Choix du mot de passe root"
passwd
echo -n "Voulez vous ajouter un utilisateur (o/n) ?"
read choice
if [ $choice = o ]
then
echo -n "Nom d'utilisateur : "
read username
useradd $username -m -G users,wheel,audio -s /bin/bash
passwd $username
fi

echo gentoo > /etc/hostname
echo "127.0.0.1 localhost" > /etc/hosts

nano etc/modules.autoload.d/kernel-2.4

echo -n "Voulez vous configurer une carte réseau Ethernet (o/n) ?"
read choice
if [ $choice = o ]
then
nano -w /etc/conf.d/net
rc-update add net.eth0 default
fi

nano -w /etc/rc.conf

emerge -k xfree*

etc-update
exit
cd /
umount /mnt/gentoo/boot
umount /mnt/gentoo/proc
umount /mnt/gentoo

echo -n "Voulez vous redémarrer le système (o/n) ?"
read choice
if [ $choice = o ]
then
reboot
fi



The software said "Requires Windows98, Win2000, or better."
So I installed Linux.

Poste le Wednesday 18 February 2004 15:10:40
Répondre     Citer    
Re: Installer Gentoo sans se fatiguer
Envoyé par: Neuromancien

Le script reste bloqué dans le "chroot" et ce qui est écrit après ne s'exécute qui si je quitte le "chroot". Comment faire ?



The software said "Requires Windows98, Win2000, or better."
So I installed Linux.

Poste le Wednesday 18 February 2004 15:34:28
Répondre     Citer    
Re: Installer Gentoo sans se fatiguer
Envoyé par: lebarjoe

Hello,

Je pense avoir la solution mais je n'es pas testé.

A la place de : chroot /mnt/gentoo /bin/bash

Tu mets : chroot /mnt/gentoo /bin/bash <<EOF
.....toutes les commandes......
echo -n "Voulez vous redémarrer le système (o/n) ?"
read choice
if [ $choice = o ]
then
reboot
fi
EOF

Voilà, essaye et tiens moi au courant, ça m'interresse aussi.
En tout cas je n'ai pas encore réussi à installer ma gentoo sur mon Shuttle SN41G2. Problème de compilation du noyau 2.6.3 en partant de stage 1.

Bon courage.

Poste le Monday 23 February 2004 14:40:21
Répondre     Citer    

Veuillez vous authentifier auparavant pour commenter.

 

Ce forum !
Installer Gentoo sans se fatiguer
Forum dédié aux questions sur les distributions basées sur les sources : Gentoo, Lunar, Sabayon, Sorcerer, Source Mage

Sauf mention contraire, les documentations publiées sont sous licence Creative-Commons