|
default 0 timeout 10 splashimage=(cd)/boot/grub/splash.xpm.gz title=Gentoo Linux Live root (cd) kernel (cd)/boot/kernel-genkernel-x86-versionNoyau root=/dev/ram0 rw init=/linuxrc cdroot looptype=squashfs loop=/livecd.squashfs splash=verbose,fadein,theme:Metal-Tosh quiet CONSOLE=/dev/tty1 initrd (cd)/boot/initramfs-genkernel-x86-versionNoyau |
|
# /etc/fstab: static file system information. # $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/fstab,v 1.14 2003/10/13 20:03:38 azarah Exp $ # # noatime turns off atimes for increased performance (atimes normally aren't # needed; notail increases performance of ReiserFS (at the expense of storage # efficiency). It's safe to drop the noatime options if you want and to # switch between notail and tail freely. # <fs> <mountpoint> <type> <opts> <dump/pass> # NOTE: If your BOOT partition is ReiserFS, add the notail option to opts. #/dev/BOOT /boot ext2 noauto,noatime 1 1 #/dev/ROOT / xfs noatime 0 0 #/dev/SWAP none swap sw 0 0 #/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0 /dev/fd0 /mnt/floppy auto noauto 0 0 # NOTE: The next line is critical for boot! none /proc proc defaults 0 0 ## glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for # POSIX shared memory (shm_open, shm_unlink). # (tmpfs is a dynamically expandable/shrinkable ramdisk, and will # use almost no memory if not populated with files) # Adding the following line to /etc/fstab should take care of this: #none /dev/shm tmpfs defaults 0 0 /dev/loop0 / squashfs ro,defaults 0 0 tmpfs /var/lib/init.d tmpfs defaults 0 0 |
|
#GNU General Public License Version #This program is free software; you can redistribute it and/or #modify it under the terms of the GNU General Public License #version 2 as published by the Free Software Foundation. #This program is distributed in the hope that it will be useful, #but WITHOUT ANY WARRANTY; without even the implied warranty of #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. #!/bin/sh #fichiers temporaires livecd_target="/root/target" #point de montage de votre gentoo LiveCD livecd_source="/mnt/gentooLive" #ou creer le .iso livecd_output="/root/live/livecd.iso" mkdir /root/target mkdir /root/live #deplacement de portage pour installer grub sans internet avec le script d'installation rm -rf "$livecd_source"/usr/portage/distfiles mirrorselect -s3 -b10 -o | grep 'GENTOO_MIRRORS=' >> "$livecd_source"/etc/make.conf #chroot "$livecd_source" ebuild /usr/local/portage/sys-boot/grub/grub-0.96-r100.ebuild digest mv "$livecd_source"/usr/portage "$livecd_source"/usr/portage2 mkdir "$livecd_source"/usr/portage mkdir "$livecd_source"/usr/portage/sys-boot mkdir "$livecd_source"/usr/portage/distfiles cp -aRv "$livecd_source"/usr/portage2/eclass "$livecd_source"/usr/portage/eclass cp -aRv "$livecd_source"/usr/portage2/profiles "$livecd_source"/usr/portage/profiles cp -aRv "$livecd_source"/usr/portage2/header.txt "$livecd_source"/usr/portage/header.txt cp -aRv "$livecd_source"/usr/portage2/skel.ChangeLog "$livecd_source"/usr/portage/skel.ChangeLog cp -aRv "$livecd_source"/usr/portage2/skel.ebuild "$livecd_source"/usr/portage/skel.ebuild cp -aRv "$livecd_source"/usr/portage2/skel.metadata.xml "$livecd_source"/usr/portage/skel.metadata.xml cp -aRv "$livecd_source"/usr/portage2/sys-boot/grub "$livecd_source"/usr/portage/sys-boot chroot "$livecd_source" emerge grub #va telecharger les fichiers necessaires # Liste des dossiers à exlcure: exclude_dir="/usr/portage2 /usr/src /proc /dev /usr/share/doc /usr/doc/usr/share/man /usr/man /tmp /var/tmp /var/log /var/cache /var/db " #Vous pouvez en ajouter # efface ancien iso rm -f "$livecd_output" # efface ancien fichiers temporaires rm -rf "$livecd_target" mkdir "$livecd_target" #mise en place du fstabLive mv "$livecd_source"/etc/fstab "$livecd_source"/etc/fstabdd mv "$livecd_source"/etc/fstablive "$livecd_source"/etc/fstab cp -a "$livecd_source"/boot "$livecd_target" rm -f "$livecd_source"/etc/mtab touch "$livecd_source"/etc/mtab echo -e "\nCreation squashfs...\n" for i in $exclude_dir; do exclude_sqfs="$exclude_sqfs $livecd_source$i" done #création du fichier squashfs mksquashfs "$livecd_source" "$livecd_target"/livecd.squashfs -e $exclude_sqfs echo -e "\nCreation image ISO dans /root/live ...\n" cd / mkisofs -J -R -l -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4-boot-info-table -z -iso-level 4 -c livecd -o $livecd_output $livecd_target/ > /dev/null 2>&1 #remet le bon fstab mv "$livecd_source"/etc/fstab "$livecd_source"/etc/fstablive mv "$livecd_source"/etc/fstabdd "$livecd_source"/etc/fstab #remet portage en place rm -rf "$livecd_source"/usr/portage mv "$livecd_source"/usr/portage2 "$livecd_source"/usr/portage #Suppression fichiers temporaires rm -Rf /root/target echo "Image iso créée dans /root/live" |
|
#GNU General Public License Version #This program is free software; you can redistribute it and/or #modify it under the terms of the GNU General Public License #version 2 as published by the Free Software Foundation. #This program is distributed in the hope that it will be useful, #but WITHOUT ANY WARRANTY; without even the implied warranty of #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. #!/bin/sh #Les variables BACK_TITLE="OS Installeur" TEMP_FILE=/var/log/temp LOG_FILE=/var/log/log.txt CDROM_MOUNT_POINT=/mnt/cdrom RepInstall=/mnt/gentoo FileSquash=/mnt/cdrom/livecd.squashfs FileTar=/mnt/cdrom/files sourceSquash=/mnt/squash SysFichier="ext3" userInput="" PartDDChoix="" LiveCD=0 #Les fonctions ############################################################################## #L'installation ############################################################################## function installOS() { let boxHeight=7 if [ $LiveCD == 1 ]; then echo "Installation de Gentoo" > $LOG_FILE RepInstall="/mnt/gentoo" dialog --backtitle "$BACK_TITLE" \ --title "Installation" \ --yesno "Cela va installer Gentoo sur votre ordinateur.\ Désirez-vous continuer ? \n \ Pensez à créer les partitions si besoin dans le menu configuration."\ 16 70 if [ $? -eq 1 ]; then #On quitte exitInstaller fi # choix de la la partition PartDD="" umount $RepInstall title="Choix de la partition Root" message="Sélectionner la partition Root." SelChoixPartition PartDD=$PartDDChoix if [ $PartDD =="" ]; then #On retourne au debut! title="Erreur" message="Il faut une partition." echo "Aucune partition choisie" >> $LOG_FILE showMessageBox installOS fi showSysFile TypePartition=$SysFichier echo "Systeme de fichier : $TypePartition " >> $LOG_FILE title="Choix de la partition Swap" message="Sélectionner la partition Swap." SelChoixPartition SwapMont=$PartDDChoix echo "Partion swap : $SwapMont " >> $LOG_FILE # Formater la partition oui/non dialog --backtitle "$BACK_TITLE" \ --title "Installation LiveCd" \ --yesno "\n Désirez-vous formater $PartDD ?" \ 16 70 if [ $? -eq 1 ]; then echo "Pas de formatage " else mkfs.$TypePartition $PartDD echo "Formatage de $PartDD " >> $LOG_FILE fi mount -t $TypePartition $PartDD $RepInstall LigneMtab="" #traitement de LigneMtab LigneMtab=$(grep $RepInstall /etc/mtab) if [$LigneMtab == ""]; then #il y a probleme title="Erreur" message="Aucune partition root trouvée pour $PartDD ." echo "Pas de partition Root " >> $LOG_FILE showMessageBox installOS fi executeOK="f" if [ $SwapMont != '' ] ; then # Formater la partition swap oui/non dialog --backtitle "$BACK_TITLE" \ --title "Installation LiveCd" \ --yesno "\n Désirez-vous formater et activer votre partition swap ?" \ 16 70 if [ $? -eq 1 ]; then echo "Pas de formatage " else mkswap $SwapMont swapon $SwapMont echo "Activation et formatage de la partition swap " >> $LOG_FILE sleep 2 fi fi if [ -d $RepInstall ]; then #creation du point de montage pour le fichier squash mkdir $sourceSquash >> $LOG_FILE mount $FileSquash $sourceSquash -t squashfs -o loop 2>> $LOG_FILE dialog --backtitle "$BACK_TITLE" \ --title "Installation LiveCd" \ --yesno "\n Gentoo va être installé sur $RepInstall " \ 16 70 if [ $? -eq 1 ]; then exit 2>> $LOG_FILE #/dev/null fi title="Installation" message="Copie des fichiers en cours..." showInfoBox echo "Début de la copie des fichiers " >> $LOG_FILE cp -Rva $sourceSquash/* $RepInstall && executeOK="t" cp -vp /etc/resolv.conf $RepInstall/etc/resolv.conf cp -Ra /dev $RepInstall echo "Copie des fichiers terminées " >> $LOG_FILE fi if [ $executeOK = "t" ]; then cd $RepInstall #chroot environnement mkdir $RepInstall/proc #mkdir $RepInstall/usr/local/portage mount -t proc none $RepInstall/proc disk=${LigneMtab:0:9} #Installation de grub oui/non rm -R $RepInstall/boot/grub dialog --backtitle "$BACK_TITLE" \ --title "GRUB" \ --yesno "\n Désirez vous installer grub ? " \ 16 70 if [ $? -eq 1 ]; then #Mise a jour du menu.lst si grub #demander ou se trouve menu.lst afin de le mettre à jour echo "Pas encore implémenté" else echo "Installation de grub " >> $LOG_FILE chroot $RepInstall emerge grub cp -vpf /boot/grub/menu.lst $RepInstall/boot/grub/grub.conf chroot $RepInstall ln -s /boot/grub/grub.conf /boot/grub/menu.lst diskGrub="" OptionGrub="" case $disk in "/dev/hda1" ) diskGrub='(hd0,0)' ;; "/dev/hda2" ) diskGrub='(hd0,1)' ;; "/dev/hda3" ) diskGrub='(hd0,2)' ;; "/dev/hda4" ) diskGrub='(hd0,3)' ;; "/dev/hda5" ) diskGrub='(hd0,4)' ;; "/dev/hda6" ) diskGrub='(hd0,5)' ;; "/dev/hda7" ) diskGrub='(hd0,6)' ;; "/dev/hda8" ) diskGrub='(hd0,7)' ;; "/dev/hdb1" ) diskGrub='(hd1,0)' ;; "/dev/hdb2" ) diskGrub='(hd1,1)' ;; "/dev/hdb3" ) diskGrub='(hd1,2)' ;; "/dev/hdb4" ) diskGrub='(hd1,3)' ;; "/dev/hdb5" ) diskGrub='(hd1,4)' ;; "/dev/hdb6" ) diskGrub='(hd1,5)' ;; "/dev/hdb7" ) diskGrub='(hd1,6)' ;; "/dev/hdb8" ) diskGrub='(hd1,7)' ;; "/dev/hdc1" ) diskGrub='(hd2,0)' ;; "/dev/hdc2" ) diskGrub='(hd2,1)' ;; "/dev/hdc3" ) diskGrub='(hd2,2)' ;; "/dev/hdc4" ) diskGrub='(hd2,3)' ;; "/dev/hdc5" ) diskGrub='(hd2,4)' ;; "/dev/hdc6" ) diskGrub='(hd2,5)' ;; "/dev/hdc7" ) diskGrub='(hd2,6)' ;; "/dev/hdc8" ) diskGrub='(hd2,7)' ;; "/dev/hdd1" ) diskGrub='(hd3,0)' ;; "/dev/hdd2" ) diskGrub='(hd3,1)' ;; "/dev/hdd3" ) diskGrub='(hd3,2)' ;; "/dev/hdd4" ) diskGrub='(hd3,3)' ;; "/dev/hdd5" ) diskGrub='(hd3,4)' ;; "/dev/hdd6" ) diskGrub='(hd3,5)' ;; "/dev/hdd7" ) diskGrub='(hd3,6)' ;; "/dev/hdd8" ) diskGrub='(hd3,7)' ;; "/dev/sda1" ) diskGrub='(hd0,0)' OptionGrub="doscsi" ;; * ) title="Erreur" message="La partition racine n'a pas étée trouvée\n\n\ Vous devez éditer menu.lst manuellement" let boxHeight=7 showMessageBox diskGrub="erreur" esac if [ $diskGrub == "erreur" ]; then nano $RepInstall/boot/grub/grub.conf echo "Pas trouvé de partition racine pour Grub " >> $LOG_FILE else #modification menu.lst sed -i 's:(cd):'$diskGrub':' $RepInstall/boot/grub/grub.conf sed -i 's:cdroot:'real_root=$disk':' $RepInstall/boot/grub/grub.conf sed -i 's:looptype=squashfs:'':' $RepInstall/boot/grub/grub.conf sed -i "s:loop=/livecd.squashfs:resume2=$SwapMont $OptionGrub:" $RepInstall/boot/grub/grub.conf #resume2=$SwapMont dans le cas ou le noyau prendrait en charge suspend2 echo "menu.lst mis a jour " >> $LOG_FILE #fin modification menu.lst fi #MAj de /etc/mtab sinon l'installation de grub ne fonctionne pas mbrDD=${LigneMtab:0:9} echo "$mbrDD / $TypePartition rw,noatime 0 0" > $RepInstall/etc/mtab #Suppression du fichier contenant les derniers devices de grub rm $RepInstall/boot/grub/device.map chroot $RepInstall grub-install --no-floppy ${LigneMtab:0:8} echo "Installation de Grub sur le mbr " >> $LOG_FILE fi #Mettre a jour fstab echo "Mise à jour de /etc/fstab " >> $LOG_FILE mv $RepInstall/etc/fstab $RepInstall/etc/fstablive #ce fichier pourra servir pour recréer un livecd echo "# This file is edited by fstab-sync - see 'man fstab-sync' for details "> $RepInstall/fstab echo "# /etc/fstab: static file system information. " >> $RepInstall/etc/fstab echo "# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/fstab,v 1.14 2003/10/1320 :03:38 azarah Exp $ ">> $RepInstall/etc/fstab echo "# " >> $RepInstall/etc/fstab echo "# noatime turns off atimes for increased performance (atimes normally aren't " >> $RepInstall/etc/fstab echo "# needed; notail increases performance of ReiserFS (at the expense ofs torage " >> $RepInstall/etc/fstab echo "# efficiency). It's safe to drop the noatime options if you want and to " >> $RepInstall/etc/fstab echo "# switch between notail and tail freely. " >> $RepInstall/etc/fstab echo " " >> $RepInstall/etc/fstab echo "# <fs> <mountpoint> <type> <opts> <dump/pass> " >> $RepInstall/etc/fstab echo " " >> $RepInstall/etc/fstab echo "# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts. " >> $RepInstall/etc/fstab echo "#/dev/BOOT /boot ext2 noauto,noatime 1 1 " >> $RepInstall/etc/fstab echo " " >> $RepInstall/etc/fstab echo "#/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0 " >> $RepInstall/etc/fstab echo "/dev/fd0 /mnt/floppy auto noauto 0 0 " >> $RepInstall/etc/fstab echo " " >> $RepInstall/etc/fstab echo " " >> $RepInstall/etc/fstab echo " " >> $RepInstall/etc/fstab echo "# NOTE: The next line is critical for boot! " >> $RepInstall/etc/fstab echo "none /proc proc defaults 0 0 " >> $RepInstall/etc/fstab echo " " >> $RepInstall/etc/fstab echo "# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for " >> $RepInstall/etc/fstab echo "# POSIX shared memory (shm_open, shm_unlink). " >> $RepInstall/etc/fstab echo "# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will " >> $RepInstall/etc/fstab echo "# use almost no memory if not populated with files) " >> $RepInstall/etc/fstab echo "# Adding the following line to /etc/fstab should take care of this: " >> $RepInstall/etc/fstab echo " " >> $RepInstall/etc/fstab echo "none /dev/shm tmpfs defaults 0 0 " >> $RepInstall/etc/fstab #Mise a jour partition Root echo "$disk / $TypePartition defaults 1 1 " >> $RepInstall/etc/fstab if [ $SwapMont != '' ] ; then echo "$SwapMont none swap sw 0 0 ">> $RepInstall/etc/fstab fi #Quitter l'installeur message="Gentoo a été copié sur votre Disque dur \n\n\ L'historique de l'installation est disponible dans $LOG_FILE\n\n\ N'oubliez pas de synchroniser votre arbre de portage : \n\n\ # emerge sync" echo "Installation terminee " >> $LOG_FILE showMessageBox exitInstaller else message="Un problème est survenu durant la copie des fichiers,consulter $LOG_FILE " echo "Problème de copie :-(" >> $LOG_FILE showMessageBox fi else title="Warning" let boxHeight=7 message="Le LiveCd n'a pas été trouvé" showMessageBox fi return } ############################################################################## # Information ############################################################################## function showMessageBox() { getBoxWidth dialog --backtitle "$BACK_TITLE" \ --title "$title" \ --msgbox "\n$message" \ $boxHeight $boxWidth return } ############################################################################## # Apparition d'une boite d'information ############################################################################## function showInfoBox () { getBoxWidth dialog --backtitle "$BACK_TITLE" \ --sleep 3 \ --title "$title" \ --infobox "\n$message" \ 5 $boxWidth return } ############################################################################## #Choix systeme de fichier ############################################################################## function showSysFile() { dialog --backtitle "$BACK_TITLE" \ --title "Systeme de fichier disponible" \ --menu "Selection :" \ 18 60 6 \ "reiserfs" "Reiser fs" \ "ext3" "ext3" \ "ext2" "ext2" \ "xfs" "xfs" \ "jfs" "jfs" 2> $TEMP_FILE if [ $? -eq 0 ]; then installMethod=$(cat $TEMP_FILE) rm -f $TEMP_FILE SysFichier=$installMethod elif [ $? -eq 1 ]; then SysFichier="ext3" #Il faut un systeme de fichiers. Par défaut ext3 fi } ############################################################################## #Recherche des partitions connues ############################################################################## function SelChoixPartition() { rm -f $TEMP_FILE find /dev/hd?? >> $TEMP_FILE find /dev/sd?? >> $TEMP_FILE rm $TEMP_FILE.2nd 2> /dev/null echo "Debut analyse partition" tmp="" cat $TEMP_FILE | while read line do tmp=$(grep ${line:5:9} /proc/partitions) if [ ${tmp:1:1} !="" ] ; then #Trouver dans /proc/partitions grep ${line:5:9} /proc/partitions |awk '{print "/dev/"$4 " /dev/"$4":Taille:" int($3/1000000)"GB \n"}' >> $TEMP_FILE.2nd fi done #toutes les partitions possible local radioList=$(cat $TEMP_FILE.2nd) rm $TEMP_FILE.2nd let boxHeight=12 dialog --backtitle "$BACK_TITLE" \ --title "$title" \ --menu "$message" \ 18 60 6 \ $radioList 2> $TEMP_FILE if [ $? -eq 0 ]; then userInput=$(cat $TEMP_FILE) rm -f $TEMP_FILE fi PartDDChoix=$userInput return } ############################################################################## # Apparition d'une boite d'information ############################################################################## function showInfoBox () { getBoxWidth dialog --backtitle "$BACK_TITLE" \ --sleep 3 \ --title "$title" \ --infobox "\n$message" \ 5 $boxWidth return } ############################################################################## # quitter installeur ############################################################################## function exitInstaller() { title="Quitter" message="A bientôt" let boxHeight=7 showMessageBox exit 0 } #Lancement du script : if [ -s $FileSquash ]; then echo "LiveCD detecte" LiveCD=1 installos else echo "LiveCD non trouvé" exitInstaller fi |
- [
Basé sur Itseasy
|
Thème : Frogdev
] -
Les informations ne sont données qu'à titre indicatif.
© frogdev site francophone sur Gentoo, Licence FDL 2008
[ Page générée en 0.02649 secondes | Compression gZip active ]
Poids XHTML : 56.76 ko (60.74 ko non compressé) - CSS : 5.92 ko
Eléments chargés : 41.91 ko