L'ISO Debian-Facile est un projet visant à faire découvrir l'univers GNU/Linux aux très grands débutants.
https://debian-facile.org/projets:iso-debian-facile
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
2.3 KiB
75 lines
2.3 KiB
#!/bin/bash |
|
# DFLinux live-build script |
|
# https://framagit.org/dflinux/DFiso |
|
|
|
# cfg ------------------------------------------------------------------ |
|
VERSION="10.3.1" |
|
|
|
if [ `whoami` != root ]; then |
|
echo "erreur : lancer DFbuild en tant qu'administrateur" |
|
exit 1 |
|
fi |
|
# args ----------------------------------------------------------------- |
|
if [ "$1" == "32" ]; then ARCH="i386" |
|
elif [ "$1" == "64" ]; then ARCH="amd64" |
|
elif [ "$1" == "clean" ]; then lb clean && rm -R -f cache && exit 0 |
|
else |
|
# no args or wrong args > help |
|
echo "Utilisation : en mode administrateur" |
|
echo "./DFbuild.sh 32 > construire DFLinux i386" |
|
echo "./DFbuild.sh 64 > construire DFLinux amd64" |
|
echo "./DFbuild.sh clean > nettoyer le dossier de construction et le cache" |
|
echo "---" |
|
echo "prenez soin de nettoyer le cache avant de construire sous une nouvelle architecture." |
|
exit 1 |
|
fi |
|
|
|
## build ISO ----------------------------------------------------------- |
|
|
|
## place nette |
|
lb clean |
|
|
|
## mise en place |
|
echo "INFO: building DFLinux-${VERSION}-${ARCH}" |
|
|
|
# dossier des paquets externes |
|
mkdir -p config/packages |
|
|
|
# import des paquets externes |
|
rm config/packages/* |
|
ln ext/*.deb config/packages/ |
|
|
|
# utiliser apt-cacher s'il est installé |
|
if dpkg-query -W apt-cacher-ng &>"/dev/null" |
|
then |
|
export http_proxy="http://127.0.0.1:3142/" |
|
CACHE=("--apt-http-proxy" "$http_proxy") |
|
else |
|
echo "WARNING: apt-cacher-ng n'est pas installé" |
|
fi |
|
|
|
# architecture |
|
if [ "$ARCH" == "i386" ]; then lb config -a ${ARCH} ${CACHE[@]} -k "686"; fi |
|
if [ "$ARCH" == "amd64" ]; then lb config -a ${ARCH} ${CACHE[@]}; fi |
|
lb build |
|
|
|
# nettoyage : ça doit ralentir l'ensemble, ça. Voyons ce que ça donne sans. |
|
#rm -Rf config/packages config/includes config/includes.bootstrap config/includes.source |
|
|
|
## renommage |
|
echo "INFO: renommer" |
|
if test -f live-image-${ARCH}.hybrid.iso; then |
|
mkdir -p dfl-${ARCH} |
|
mv live-image-${ARCH}.hybrid.iso dfl-${ARCH}/debian-facile-${VERSION}-${ARCH}.iso |
|
mv chroot.packages.install dfl-${ARCH}/debian-facile-${VERSION}-${ARCH}.pkgs |
|
mv dflinux.log dfl-${ARCH}/debian-facile-${VERSION}-${ARCH}.log |
|
cd dfl-${ARCH} && md5sum debian-facile-${VERSION}-${ARCH}.iso > debian-facile-${VERSION}-${ARCH}.md5 && cd ../ |
|
lb clean |
|
else |
|
echo "ISO non construite : erreur, voir le fichier dflinux.log" |
|
exit 1 |
|
fi |
|
|
|
echo "Opération achevée en $(($SECONDS/60)) minutes" |
|
|
|
exit 0
|
|
|