diff --git a/conf/includes/legos.conf.sh b/conf/includes/legos.conf.sh index 16885c7..0ae830e 100644 --- a/conf/includes/legos.conf.sh +++ b/conf/includes/legos.conf.sh @@ -7,10 +7,6 @@ export PROXYAPTPORT="3142" export PROXYSRV="proxy.legos.obs-mip.fr" export PROXYSRVPORT="3128" -# Paquets à enlever après installation -export RMLIST="apparmor laptop-detect resolvconf" -export APTBLACKLIST="apparmor chafa resolvconf" - # Langues supportés et langue du systême export LOCALESET="en_US.UTF-8 fr_FR.UTF-8" export SYSLOCALE="fr_FR.UTF-8" diff --git a/conf/includes/pkgsel.conf.sh b/conf/includes/pkgsel.conf.sh index 79554cc..2179895 100644 --- a/conf/includes/pkgsel.conf.sh +++ b/conf/includes/pkgsel.conf.sh @@ -1,5 +1,11 @@ # Liste de paquets pour installation +# Paquets à enlever après installation +export PKGS_RMLIST="apparmor laptop-detect resolvconf snapd" + +# Paquets dont l'installation est interdite +export PKGS_BLACKLIST="apparmor resolvconf snapd" + # Base export PKGS_BASE="debconf-utils debhelper deborphan ethtool hardinfo \ cpufrequtils hwinfo lm-sensors libatasmart-bin lsscsi pciutils \ diff --git a/init.sh b/init.sh index fb2497a..5b5ea5a 100755 --- a/init.sh +++ b/init.sh @@ -189,6 +189,7 @@ exec 3>&1 4>&2 trap 'exec 2>&4 1>&3' 0 1 2 3 exec > >(tee -a $LOGFILE) exec 2> >(tee -a $LOGFILE >&2) +prnt I "Démarrage d'init version $VERSION." # Récupère la configuration prnt I "Chargement de la configuration..." @@ -246,5 +247,12 @@ fi precheck_$mod done +# If we only checks, we stop here +if [[ $CHECK_ONLY == true ]]; then + prnt I "Mode de vérification seulement, on s'arrête là." + exit 0 +fi + + prnt I "That's all folks !" #echo "Après vérification des logs, vous devriez redémarrer la machine..." diff --git a/modules/conf_ntp.sh b/modules/conf_ntp.sh index bbb6b81..9efbb50 100644 --- a/modules/conf_ntp.sh +++ b/modules/conf_ntp.sh @@ -1,6 +1,6 @@ # NTP -export VER_conf_ntp="0.0.4" +export VER_conf_ntp="0.0.5" conf_ntp() { @@ -15,7 +15,7 @@ conf_ntp() svc_stop ntp prnt I "Installation du fichier de configuration de NTP." - dest="/etc/ntp.conf.work" + local dest="/etc/ntp.conf.work" backupdist /etc/ntp.conf installfile ntp.conf $dest local line="" diff --git a/modules/install_pkg.sh b/modules/install_pkg.sh index 375fc7a..f871669 100644 --- a/modules/install_pkg.sh +++ b/modules/install_pkg.sh @@ -1,20 +1,40 @@ # Installation des paquets -export VER_install_pkg="0.0.2" +export VER_install_pkg="0.1.0" install_pkg() { - [[ $PKGSEL ]] && + [[ -n $PKGS_RMLIST ]] && + prnt I "Suppression de paquets supperflus..." && + pkgrem $PKGS_RMLIST + + if [[ -n PKGS_BLACKLIST ]]; then + for pkg in $PKGS_BLACKLIST; do + prnt I "Mise du paquet $pkg en liste noire..." + local dest=/usr/apt/apt.conf.d/blacklist_$pkg.conf + installfile blacklist.conf $dest && + sed -i -e "s/@pkg@/pkg/" $dest + done + fi + + [[ -n $PKGSEL ]] && prnt I "Installation de la sélection de paquets..." && pkginst $PKGSEL } precheck_install_pkg() { + if [[ -z PKGS_RMLIST ]]; then + prnt I "Aucun paquet à désinstaller" + else + prnt I "$(echo $PKGS_RMLIST | wc -w) paquets à supprimer." + fi + [[ -z PKGS_BLACKLIST ]] && + prnt W "Les paquets $pkg seront placés en liste noire !" if [[ -z $PKGSEL ]]; then prnt W "Pas de paquet additionel à installer !" else - prnt I "$(echo $PKGSEL | wc -w) paquets additionels seront installés" + prnt I "$(echo $PKGSEL | wc -w) paquets additionels seront installés." fi } diff --git a/repo/common/blacklist.conf b/repo/common/blacklist.conf new file mode 100644 index 0000000..80484c8 --- /dev/null +++ b/repo/common/blacklist.conf @@ -0,0 +1,3 @@ +Package: #pkg# +Pin: release * +Pin-Priority: -1