Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| projets:traduction_live_cd:script_francisation.sh [Le 06/10/2010, 23:24] – snip | projets:traduction_live_cd:script_francisation.sh [Le 11/09/2022, 13:17] (Version actuelle) – Suppression des espaces en fin de ligne (détecté et corrigé via le bot wiki-corrector (https://forum.ubuntu-fr.org/viewtopic.php?id=2067892) moths-art | ||
|---|---|---|---|
| Ligne 3: | Ligne 3: | ||
| * Connexion à Internet | * Connexion à Internet | ||
| * [[: | * [[: | ||
| - | * [[: | + | * [[: |
| - | * Un autre script : [[projets: | + | * ~4Gio d' |
| - | ===== Utilisation | + | ===== Récupérer les scripts |
| - | En tant que superutilisateur : | + | |
| + | Les scripts sont dans Launchpad ( [[https:// | ||
| <code bash> | <code bash> | ||
| - | ./ | + | bzr branch lp:~ubuntu-fr/+junk/iso-fr |
| </ | </ | ||
| - | ===== Script | + | ===== Utilisation |
| + | **Les manipulations sont à faire en tant que superutilisateur.** | ||
| + | Pour la version 11.04 : | ||
| <code bash> | <code bash> | ||
| - | #!/bin/bash | + | ./script_francisation.sh |
| - | + | </code> | |
| - | # Translation script for Ubuntu CDs | + | |
| - | # Copyright (C) 2010 Vincent-Xavier JUMEL | + | |
| - | + | ||
| - | # This program is free software: you can redistribute it and/or modify | + | |
| - | # it under the terms of the GNU General Public License as published by | + | |
| - | # the Free Software Foundation, either version 3 of the License, or | + | |
| - | # (at your option) any later version. | + | |
| - | + | ||
| - | # 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. | + | |
| - | # GNU General Public License for more details. | + | |
| - | + | ||
| - | # You should have received a copy of the GNU General Public License | + | |
| - | # along with this program. | + | |
| - | + | ||
| - | # Be sure to set up the variables according to your needs and preferences | + | |
| - | # Usage: usage | + | Pour la version 10.04.2 (LTS) : |
| - | # Print the usage. | + | <code bash> |
| - | usage () { | + | ./ |
| - | | + | </code> |
| - | Usage: `basename $0` [OPTION] | + | Le temps nécessaire pour générer une iso est d' |
| - | Localize the CD | + | |
| - | -d, --directory=WD working directory (default to / | + | ===== Participation ===== |
| - | -a, --arch=ARCH | + | |
| - | -r, --release | + | |
| - | -D, --debug | + | |
| - | -u, --url | + | |
| - | -h, --help | + | |
| - | -v, --version | + | |
| - | Report bugs to < | + | Pour proposer une amélioration, |
| - | EOF | + | Après avoir modifié les scripts : (changez // |
| - | } | + | <code bash> |
| + | bzr commit -m "un message explicatif" | ||
| + | bzr push lp: | ||
| + | </ | ||
| - | # | + | Ensuite, sur https://code.launchpad.net/~votresurnom/ |
| - | V_NAME=lucid # stand for version name | + | |
| - | ARCH=i386 # Architecture | + | |
| - | WD=/root/projets/traduction_live_cd # our working directory, should not interfere with anything you have | + | |
| - | debug=0 # Setting the debug value | + | |
| - | # Note that we use `" | ||
| - | # separate word. The quotes around `$@' are essential! | ||
| - | # We need TEMP as the `eval set --' would nuke the return value of getopt. | ||
| - | TEMP=`getopt -o d:a:r:u:hD --long directory:, | ||
| - | |||
| - | if [ $? != 0 ] ; then echo " | ||
| - | |||
| - | # Note the quotes around `$TEMP': | ||
| - | eval set -- " | ||
| - | |||
| - | while true ; do | ||
| - | case " | ||
| - | -d|--directory) WD=$2 ; shift 2;; | ||
| - | -a|--arch) ARCH=$2 ; shift 2 ;; | ||
| - | -r|--release) V_NUM=$2 ; shift 2 ;; | ||
| - | -D|--debug) debug=" | ||
| - | -u|--url) DL_URL=$2; shift 2 ;; | ||
| - | --) shift ; break ;; | ||
| - | *) usage ; exit 0 ;; | ||
| - | esac | ||
| - | done | ||
| - | |||
| - | #Test if version number is given | ||
| - | if [ " | ||
| - | echo "-r [option] is required" | ||
| - | exit 1 | ||
| - | fi | ||
| - | |||
| - | if [ $ARCH != i386 ]; then | ||
| - | if [ $ARCH != amd64 ]; then | ||
| - | echo "Arch not recognized or supported" | ||
| - | exit 1 | ||
| - | fi | ||
| - | fi | ||
| - | |||
| - | # This will create final working directory, even if the full path don't exists. | ||
| - | for i in mnt extract-cd edit tmp ; do | ||
| - | if [ ! -d ${WD}/${i} ]; then | ||
| - | mkdir -p ${WD}/${i} ; | ||
| - | else | ||
| - | sudo rm -rf ${WD}/ | ||
| - | fi | ||
| - | done | ||
| - | |||
| - | # http:// | ||
| - | |||
| - | # Change this next line to the directory where your previously downloaded iso image sits. | ||
| - | DIR=${WD} | ||
| - | |||
| - | FLAVOR=" | ||
| - | |||
| - | if [ $V_NUM == " | ||
| - | V_NAME=" | ||
| - | elif [ $V_NUM == " | ||
| - | V_NAME=" | ||
| - | else | ||
| - | echo "Wrong version number" | ||
| - | exit 1 | ||
| - | fi | ||
| - | |||
| - | VERSION=$V_NAME | ||
| - | |||
| - | ISOPATH=$(echo $DL_URL | sed s, | ||
| - | |||
| - | if [[ -z " | ||
| - | if [[ " | ||
| - | ISOPATH=" | ||
| - | elif [[ " | ||
| - | ISOPATH=" | ||
| - | elif [[ " | ||
| - | ISOPATH=" | ||
| - | elif [[ " | ||
| - | ISOPATH=" | ||
| - | elif [[ " | ||
| - | ISOPATH=" | ||
| - | else | ||
| - | echo " | ||
| - | exit 1 | ||
| - | fi | ||
| - | fi | ||
| - | ISO=$VERSION-$FLAVOR-$ARCH.iso | ||
| - | |||
| - | # Save the original location | ||
| - | ORIG_DIR=$PWD | ||
| - | |||
| - | [ ! -d $DIR ] && mkdir $DIR | ||
| - | cd $DIR | ||
| - | |||
| - | # create identical formatted md5sum file from local copy | ||
| - | if [[ -f $ISO ]]; then | ||
| - | md5sum $ISO | sed -e " | ||
| - | fi | ||
| - | |||
| - | wget -q http:// | ||
| - | grep $ISO MD5SUMS > $ISO.md5.server | ||
| - | rm MD5SUMS | ||
| - | diff -q $ISO.md5.local $ISO.md5.server | ||
| - | |||
| - | if [ ! $? -eq " | ||
| - | echo " | ||
| - | rsync -avzhhP rsync:// | ||
| - | if [ ! $? -eq " | ||
| - | echo " | ||
| - | exit 1 | ||
| - | fi | ||
| - | else | ||
| - | echo "no need to refresh" | ||
| - | fi | ||
| - | md5sum $ISO | sed -e " | ||
| - | diff -q $ISO.md5.local $ISO.md5.server | ||
| - | |||
| - | if [ ! $? -eq " | ||
| - | echo "rsync failed" | ||
| - | exit 1 | ||
| - | else | ||
| - | echo " | ||
| - | fi | ||
| - | |||
| - | |||
| - | # Going into working directory | ||
| - | cd ${WD} | ||
| - | sudo mount -o loop ${WD}/ | ||
| - | rsync --exclude=/ | ||
| - | |||
| - | sudo unsquashfs -d ${WD}/ | ||
| - | sudo umount mnt | ||
| - | |||
| - | # Just replace archives by French ones | ||
| - | |||
| - | sudo sed -i ' | ||
| - | |||
| - | # We just uncomment universe and multiverse for special package. They | ||
| - | # will be commented out by the end of the installation dans / | ||
| - | # will be purged to gain space. | ||
| - | |||
| - | sudo sed -i -r -e 's/# (deb .* .*iverse)/ | ||
| - | |||
| - | # Preparing and entering the chroot environment | ||
| - | sudo cp / | ||
| - | sudo cp /etc/hosts ${WD}/ | ||
| - | sudo mount --bind /dev/ ${WD}/ | ||
| - | sudo mount -t proc none ${WD}/ | ||
| - | sudo mount -t sysfs none ${WD}/ | ||
| - | sudo mount -t devpts none ${WD}/ | ||
| - | |||
| - | sudo cp $ORIG_DIR/ | ||
| - | |||
| - | sudo chroot ${WD}/edit /bin/bash /root/fr.sh | ||
| - | |||
| - | sudo umount ${WD}/ | ||
| - | sudo umount ${WD}/ | ||
| - | sudo umount ${WD}/ | ||
| - | sudo umount ${WD}/ | ||
| - | |||
| - | # Getting out the chroot environment | ||
| - | sudo mv -f ${WD}/ | ||
| - | |||
| - | # Updating the autorun.inf | ||
| - | |||
| - | sudo sed -i ' | ||
| - | |||
| - | # Dealing with gfxboot | ||
| - | |||
| - | sudo chmod -R u+w ${WD}/ | ||
| - | echo fr > ${WD}/ | ||
| - | echo fr > ${WD}/ | ||
| - | sudo cp ${WD}/ | ||
| - | sudo rm ${WD}/ | ||
| - | sudo mv ${WD}/ | ||
| - | sudo chmod u-w ${WD}/ | ||
| - | |||
| - | sudo sed -i " | ||
| - | s/\^Try Ubuntu without installing/ | ||
| - | s/\^Install Ubuntu/ | ||
| - | s/\^Check disc for defects/ | ||
| - | s/Test ^memory/ | ||
| - | s/\^Boot from first hard disk/ | ||
| - | " ${WD}/ | ||
| - | |||
| - | # Creating CD manifest | ||
| - | |||
| - | sudo chmod +w ${WD}/ | ||
| - | sudo chroot ${WD}/edit dpkg-query -W --showformat=' | ||
| - | sudo cp ${WD}/ | ||
| - | |||
| - | echo -e " | ||
| - | printf $(sudo du -sx --block-size=1 ${WD}/edit | cut -f1) > ${WD}/ | ||
| - | if [[ ! -e " | ||
| - | echo " | ||
| - | exit 0 | ||
| - | fi | ||
| - | |||
| - | sudo sed -i '/ | ||
| - | |||
| - | # Creating the squashfs | ||
| - | if [ -e ${WD}/ | ||
| - | sudo rm ${WD}/ | ||
| - | fi | ||
| - | sudo mksquashfs ${WD}/edit ${WD}/ | ||
| - | |||
| - | sudo chmod 777 ${WD}/tmp | ||
| - | if [ -e ${WD}/ | ||
| - | sudo rm ${WD}/ | ||
| - | fi | ||
| - | sudo rm ${WD}/ | ||
| - | cd ${WD}/ | ||
| - | sudo cp ${WD}/ | ||
| - | |||
| - | cd ${WD}/ | ||
| - | sudo mkisofs -r -V " | ||
| - | |||
| - | if [ $debug -eq " | ||
| - | cd ${WD} | ||
| - | sudo rm -rf ${WD}/mnt ${WD}/ | ||
| - | fi | ||
| - | </ | ||
