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 23/04/2011, 18:10] – [Récupérer les scripts] olive | 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' | * ~4Gio d' | ||
| ===== Récupérer les scripts ===== | ===== Récupérer les scripts ===== | ||
| - | Les scripts sont dans la [[http://bazaar.launchpad.net/ | + | Les scripts sont dans Launchpad ( [[https://code.launchpad.net/ |
| - | Il est nécessaire d' | + | |
| <code bash> | <code bash> | ||
| bzr branch lp: | bzr branch lp: | ||
| Ligne 18: | Ligne 16: | ||
| **Les manipulations sont à faire en tant que superutilisateur.** | **Les manipulations sont à faire en tant que superutilisateur.** | ||
| - | Pour la version 11.04 : | + | Pour la version 11.04 : |
| <code bash> | <code bash> | ||
| ./ | ./ | ||
| </ | </ | ||
| - | Pour la version 10.04.2 (LTS) : | + | Pour la version 10.04.2 (LTS) : |
| <code bash> | <code bash> | ||
| ./ | ./ | ||
| Ligne 30: | Ligne 28: | ||
| Le temps nécessaire pour générer une iso est d' | Le temps nécessaire pour générer une iso est d' | ||
| - | ===== script_francisation.sh | + | ===== Participation |
| + | Pour proposer une amélioration, | ||
| + | Après avoir modifié les scripts : (changez // | ||
| <code bash> | <code bash> | ||
| - | # | + | bzr commit |
| - | + | bzr push lp:~votresurnom/iso-fr | |
| - | # Translation script for Ubuntu CDs | + | </code> |
| - | # Copyright (C) 2010 Didier ROCHE, Vincent-Xavier JUMEL, Olivier FRAYSSE, Islem ABD-EL RAHMAN | + | |
| - | + | ||
| - | # 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 | + | Ensuite, sur https:// |
| - | # Print the usage. | + | |
| - | usage () { | + | |
| - | cat <<EOF | + | |
| - | Usage: `basename $0` [OPTION] | ||
| - | Localize the CD | ||
| - | |||
| - | -d, --directory=WD | ||
| - | -a, --arch=ARCH | ||
| - | -r, --release | ||
| - | -D, --debug | ||
| - | -u, --url | ||
| - | -h, --help | ||
| - | -v, --version | ||
| - | |||
| - | Report bugs to < | ||
| - | EOF | ||
| - | } | ||
| - | |||
| - | # This function should be called on error to unmount filesystems | ||
| - | exit_on_error () { | ||
| - | for i in `grep $1 / | ||
| - | do umount $i ; sleep 2 | ||
| - | done | ||
| - | echo " | ||
| - | exit 1 | ||
| - | } | ||
| - | |||
| - | V_NUM=10.10 | ||
| - | ARCH=i386 # Architecture | ||
| - | WD=/ | ||
| - | 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 | ||
| - | |||
| - | if [ $ARCH != i386 -a $ARCH != amd64 ]; then | ||
| - | echo "Arch not recognized or supported" | ||
| - | exit 1 | ||
| - | 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 | ||
| - | rm -rf ${WD}/ | ||
| - | fi | ||
| - | done | ||
| - | |||
| - | # http:// | ||
| - | |||
| - | FLAVOR=" | ||
| - | |||
| - | V_NUM_B=$V_NUM | ||
| - | LTS="" | ||
| - | if [ $V_NUM == " | ||
| - | V_NUM_B=" | ||
| - | V_NAME=" | ||
| - | LTS=" LTS" | ||
| - | elif [ $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 | ||
| - | |||
| - | cd $WD | ||
| - | |||
| - | # 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} | ||
| - | mount -o loop ${WD}/ | ||
| - | rsync --exclude=/ | ||
| - | |||
| - | unsquashfs -d ${WD}/ | ||
| - | umount mnt | ||
| - | |||
| - | # Just replace archives by French ones | ||
| - | |||
| - | 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. | ||
| - | |||
| - | sed -i -r -e 's/# (deb .* .*iverse)/ | ||
| - | |||
| - | # Preparing and entering the chroot environment | ||
| - | cp / | ||
| - | cp /etc/hosts ${WD}/ | ||
| - | mount --bind /dev/ ${WD}/ | ||
| - | mount -t proc none ${WD}/ | ||
| - | mount -t sysfs none ${WD}/ | ||
| - | mount -t devpts none ${WD}/ | ||
| - | |||
| - | cp $ORIG_DIR/ | ||
| - | |||
| - | chroot ${WD}/edit /bin/bash /root/fr.sh $V_NUM $V_NAME $ARCH | ||
| - | |||
| - | if [ ! $? -eq " | ||
| - | exit_on_error $WD | ||
| - | else | ||
| - | umount ${WD}/ | ||
| - | umount ${WD}/ | ||
| - | umount ${WD}/ | ||
| - | umount ${WD}/ | ||
| - | fi | ||
| - | |||
| - | # Getting out the chroot environment | ||
| - | mv -f ${WD}/ | ||
| - | |||
| - | # Updating the autorun.inf | ||
| - | sed -i ' | ||
| - | |||
| - | # Correction d'un BUG de traduction dans la 10.04.1 et 10.10 | ||
| - | sed -i " | ||
| - | sed -i " | ||
| - | |||
| - | # Dealing with gfxboot | ||
| - | chmod -R u+w ${WD}/ | ||
| - | echo fr > ${WD}/ | ||
| - | echo fr > ${WD}/ | ||
| - | cp ${WD}/ | ||
| - | rm ${WD}/ | ||
| - | mv ${WD}/ | ||
| - | chmod u-w ${WD}/ | ||
| - | |||
| - | # Login in french keyboard and french language (for livecd, or for user " | ||
| - | mkdir -p ${WD}/ | ||
| - | cat > ${WD}/ | ||
| - | [Desktop] | ||
| - | Language=fr_FR.UTF-8 | ||
| - | Layout=fr | ||
| - | EOF | ||
| - | |||
| - | if [ $V_NUM == " | ||
| - | |||
| - | 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 | ||
| - | |||
| - | chmod +w ${WD}/ | ||
| - | chroot ${WD}/edit dpkg-query -W --showformat=' | ||
| - | cp ${WD}/ | ||
| - | |||
| - | echo -e " | ||
| - | printf $(du -sx --block-size=1 ${WD}/edit | cut -f1) > ${WD}/ | ||
| - | if [[ ! -e " | ||
| - | echo " | ||
| - | exit 0 | ||
| - | fi | ||
| - | |||
| - | sed -i '/ | ||
| - | |||
| - | # Creating the squashfs | ||
| - | rm -f ${WD}/ | ||
| - | mksquashfs ${WD}/edit ${WD}/ | ||
| - | |||
| - | chmod 777 ${WD}/tmp | ||
| - | rm -f ${WD}/ | ||
| - | rm ${WD}/ | ||
| - | cd ${WD}/ | ||
| - | cp ${WD}/ | ||
| - | |||
| - | cd ${WD}/ | ||
| - | mkisofs -r -V " | ||
| - | cd .. | ||
| - | echo " | ||
| - | if [[ -s MANIFESTS ]]; then | ||
| - | sed -i / | ||
| - | fi | ||
| - | echo -e `md5sum ubuntu-${V_NUM_B}-desktop-${ARCH}-fr.iso ` " | ||
| - | |||
| - | if [ $debug -eq " | ||
| - | cd ${WD} | ||
| - | rm -rf ${WD}/mnt ${WD}/ | ||
| - | fi | ||
| - | </ | ||
