diff --git a/README.md b/README.md index 7b2f16b..068eac9 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ module name. If that option is provided, the module list is mandatory. In that situation, no change should be done to the system. - **-j, --jump**: Jump the checks and goes directly to system transformation. That option should only be run after successfull checks (eg. after using the -\--checkonly option). +\--check-only option). - **-k, --keep-going**: The scripts will try to continue even if errors occurs. Thus some unrecoverable errors might stop the script anyway if it's not allowing it to work. Please use with care as it might leads to unexpected results. @@ -51,6 +51,9 @@ it to work. Please use with care as it might leads to unexpected results. that failed. - **-R, --no-root-check**: Disable checks on root rights (or the 0 UID). - **-h, --help**: Display informations on command line usage. +- **-s, --shell**: Launch a shell with entire script's environment for +debugging purpose. No action or modification is made to the system unless you +launch commands manually doing some. - **-l, --logfile**: Specify a custom name for the logfile. Standard logfile is named init-hostname-date-time.log in the log subdirectory. That file can also be customized using the LOGFILE environement variable. @@ -161,7 +164,15 @@ Unless only configuration files have been changed, any change in the code implies an increment of a version number in the code **and** a git commit. ```shell +# ------------------------------------------------------------------------------ # Description @template@ module +# Copyright (c) Year Your Name +# ------------------------------------------------------------------------------ +# +# ------------------------------------------------------------------------------ +# Variable list: +# * : role explaination +# ------------------------------------------------------------------------------ # Module version export VER_@template@="0.0.1" @@ -182,6 +193,11 @@ precheck_@template@() export -f @template@ export -f precheck_@template@ ``` + +Unexported template function will work but won't be available in the integrated +debugging shell (see --shell option). + + ## Error code table The following table is giving a list of error code with explanation: diff --git a/conf/includes/legos-bas.conf.sh b/conf/includes/legos-bas.conf.sh new file mode 100644 index 0000000..f660435 --- /dev/null +++ b/conf/includes/legos-bas.conf.sh @@ -0,0 +1,19 @@ +# Domaine LEGOS +export MAINDOM="legos.obs-mip.fr" + +# Proxy LEGOS +#export PROXYAPT="acng.$MAINDOM" +#export PROXYAPTPORT="3142" +export PROXYSRV="proxy.$MAINDOM" +export PROXYSRVPORT="3128" + +# Langues supportés et langue du systême +export LOCALESET="en_US.UTF-8 fr_FR.UTF-8" +export SYSLOCALE="fr_FR.UTF-8" + +# Configuration du disque de calcul : zfs, ext4 et xfs accepté +#export CALCTYPE="zfs" +#export CALCMOUNTPOINT="/calcul/$HOSTNAME" + +# Liste des serveurs NTP +export NTPSERVERS="ntp1.$MAINDOM ntp2.$MAINDOM" diff --git a/conf/lell213893.conf.sh b/conf/lell213893.conf.sh new file mode 100644 index 0000000..2fe1baa --- /dev/null +++ b/conf/lell213893.conf.sh @@ -0,0 +1,86 @@ +# Fichier de configuration principal + +# ------------------------------------------------------------------------------ +# -------------------- Importation de paramêtres globaux ----------------------- +# ------------------------------------------------------------------------------ + +# Importe les paramètres spécifiques LEGOS +. $MYPATH/conf/includes/legos-bas.conf.sh + +# Importe les paramètres pour Debian et Ubuntu +. $MYPATH/conf/includes/debian.conf.sh + +# Importe la sélection de paquets par défaut +. $MYPATH/conf/includes/pkgsel.conf.sh + +# Les paramètres précédemment importés sont surchargeable après cette ligne + +# ------------------------------------------------------------------------------ +# ----------------------------- Section générale ------------------------------- +# ------------------------------------------------------------------------------ + +# Utilisateur de la machine (doit exister) +MAINUSER=tchilibou + +# Interface réseau principale +MAINIF=enx381428f15e75 + +# Pilotes X11 non libre à installer ? +X11_DRV="nvidia-driver-470" + +# Authentification: utiliser LDAP+Kerberos ? +WITH_LDAP_KERB=no + +# Utilisateurs à créer ou ajouter +LOCAL_USERS="$MAINUSER" +#REMOTE_USERS="kroot" + +# Indique la déclinaison d'Ubuntu à installer +# * xubuntu : bureau XFCE léger (par défaut) +# * ubuntu : bureau Gnome lourd, très peu configurable +# * kubuntu : bureau KDE lourd, très configurable +# * ubuntu-mate : bureau Mate intermédiaire légèrement configurable +# * lubuntu : bureau LXQT très léger +UBUNTU_FLAVOR= + +# Booléen indiquant une ou plusieurs futures VM +# Les lignes suivantes devraient être commentés si à false +#WITH_VM=yes +#. $MYPATH/conf/includes/legos_vm_win7.conf.sh + +# Nom de la VM +#VM_NAME=vm-levasseur + +# Logiciels optionnels non packagé Debian +# export WITH_MATLAB="true" +# export WITH_IDL="true" +# export WITH_="true" + +# Mode d'installation : +# * dev : installe les paquets un par un avec apt (lent) +# * full : envoie d'un seul coup la liste de tous les paquets à apt (rapide) +INTALL_MODE=full + +# ------------------------------------------------------------------------------ +# ------------------------- Section disque de calcul --------------------------- +# ------------------------------------------------------------------------------ + +# Niveau ZFS : mirror (RAID1), raidz1 (RAID5), raidz2 (RAID6) +# Laisser vide pour RAID0 +CALCLEVEL="" + +# Liste de lecteurs à utiliser (voir dans /dev/disk/by-id) +# Un seul tolléré pour Ext4 et XFS, plusieurs séparés par des espaces pour ZFS +#CALCDRV=/dev/disk/by-id/ata-ST2000DM008-2FR102_ZFL3AGRQ + +# Doit on forcer l'effacement du disque ? +FORCEBLANK=false + +# ------------------------------------------------------------------------------ +# -------------------------- Section modules d'init ---------------------------- +# ------------------------------------------------------------------------------ + +# Liste des modules à executer (surchargeable en ligne de commande) +MODULE_LIST="upgrade_dist authnz conf_locale conf_ssh \ + install_desktop install_pkg install_chromium \ + install_profile" diff --git a/init.sh b/init.sh index 987e865..18330f6 100755 --- a/init.sh +++ b/init.sh @@ -36,7 +36,7 @@ export LC_ALL=C export LANG=C # Version of init -export VERSION="0.99.6" +export VERSION="0.99.7" # Store script's path export MYPATH=$(dirname $0) @@ -126,6 +126,7 @@ for mod in $MODULE_LIST; do done if [[ $RUN_SHELL == true ]]; then + prnt I "Lancement d'un shell intéractif..." bash --noprofile --rcfile $MYPATH/bash.rc prnt I "Sortie du script après exécution du shell." exit 0 diff --git a/modules/authnz.sh b/modules/authnz.sh index ab5cfb0..f8b1d7d 100644 --- a/modules/authnz.sh +++ b/modules/authnz.sh @@ -29,6 +29,7 @@ add_remote_user() create_user() { if [[ $(noerror --noout id $1) != 0 ]]; then + prnt I "Création de l'utilisateur $1 ..." useradd -Um $1 else prnt W "L'utilisateur $1 existe déjà. Rien à faire..." diff --git a/modules/template b/modules/template index c031e60..4697a6a 100644 --- a/modules/template +++ b/modules/template @@ -1,4 +1,4 @@ -# Generic templateque to use as a model for new modules creation # +# Generic template to use as a model for new modules creation # # # # !!! ATTENTION : modules are not supposed to contains any specific code for # # !!! a distribution or a other. Please use configuration files # @@ -15,6 +15,7 @@ # * y : increased on minor functionnality additions # # * z : increased on fixes (+n fixes => increased by +n) # # # +##------------------------------------------------------------------------------ ##Description of module @template@ ##Copyright (c) Year Your Name ##------------------------------------------------------------------------------