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.
dfiso-buster/DFbuild.sh

110 lines
3.4 KiB

#!/bin/bash
# Debian-Facile live-build script
# https://debian-facile.org/git/ProjetsDF/dfiso-buster/
# cfg ------------------------------------------------------------------
VERSION="10.5-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 DFiso-${VERSION}-${ARCH}"
## mise en place du dossier des paquets externes
mkdir -p config/packages
## construction des paquets debian
mkdir -p src-deb
cd src-deb/
# gdebi-fixdesk
echo ""
echo "INFOS : construction du gdebi-fixdesk.deb"
git clone --branch master --depth 1 https://debian-facile.org/git/ProjetsDF/gdebi-fixdesk.git
cd gdebi-fixdesk/
equivs-build gdebi-fixdesk.equivs
mv *.deb ../../config/packages/
cd ../
# handymenu
echo ""
echo "INFOS : construction du handymenu.deb"
git clone --branch master --depth 1 https://debian-facile.org/git/ProjetsDF/handymenu.git
cd handymenu/
equivs-build handymenu.equivs
mv *.deb ../../config/packages/
cd ../
# df-manuel
echo ""
echo "INFOS : récupération des sources pour doc-dfiso-buster"
git clone --branch master --depth 1 https://debian-facile.org/git/ProjetsDF/doc-dfiso-buster.git
cd doc-dfiso-buster/docs/
./mkpdf
cd ../debian/
./mkdeb
cd ../
mv *.deb ../../config/packages/
cd ../../
echo ""
echo "INFOS : nettoyage du dossier de construction des deb's"
rm -Rf src-deb/
# import des cahiers du débutant
# pensez à vérifier la version sur le serveur pour ajuster la commande
echo ""
echo "INFOS : récupération des cahiers du débutant"
cd config/packages/
wget -q -c https://debian-facile.org/projets/lescahiersdudebutant/download/lescahiersdudebutant_10.5-2_all.deb
cd ../../
4 years ago
# 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" --bootloader "syslinux"; fi
if [ "$ARCH" == "amd64" ]; then lb config -a ${ARCH} ${CACHE[@]} --bootloader "syslinux,grub-efi"; fi
4 years ago
lb build
## renommage
if test -f live-image-${ARCH}.hybrid.iso; then
echo "INFO: renommer"
mkdir -p dfiso-${ARCH}
mv live-image-${ARCH}.hybrid.iso dfiso-${ARCH}/debian-facile-${VERSION}_${ARCH}.iso
mv chroot.packages.install dfiso-${ARCH}/debian-facile-${VERSION}_${ARCH}.pkgs
mv dfiso.log dfiso-${ARCH}/debian-facile-${VERSION}_${ARCH}.log
cd dfiso-${ARCH} && md5sum debian-facile-${VERSION}_${ARCH}.iso > debian-facile-${VERSION}_${ARCH}.md5 && cd ../
lb clean
else
echo "ISO non construite : erreur, voir le fichier dfiso.log"
exit 1
fi
echo "Opération achevée en $(($SECONDS/60)) minutes"
exit 0