conf_disk: bug fixes, splitted init function to library, language concistancy fixes
This commit is contained in:
@@ -1,26 +1,27 @@
|
||||
# Configuration du disque de calcul
|
||||
# Secondary drive configuration
|
||||
|
||||
export VER_conf_disks="0.0.6"
|
||||
export VER_conf_disks="0.0.7"
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Cas de ZFS
|
||||
# ZFS case
|
||||
conf_zfs()
|
||||
{
|
||||
prnt I "Création du volume calcul en ZFS."
|
||||
|
||||
# On crée les répertoires d'accueil
|
||||
mkdir -pv /calcul/$HOSTNAME
|
||||
# Create destination directory
|
||||
mkdir -pv $CALCMOUNTPOINT
|
||||
|
||||
# Installation de ZFS
|
||||
# Install ZFS
|
||||
pkginst zfsutils-linux
|
||||
|
||||
# Chargement du module et vérification
|
||||
# Load ZFS module to check it works
|
||||
modprobe zfs || (
|
||||
prnt E "Échec de chargement du module noyau, abandon."
|
||||
die 2
|
||||
)
|
||||
sleep 1
|
||||
|
||||
# Create filesystem
|
||||
prnt I "Création du pool zcalc..."
|
||||
if [[ $FORCEBLANK ]]; then
|
||||
local opt="--force"
|
||||
@@ -29,13 +30,18 @@ conf_zfs()
|
||||
prnt I "Effacement des donnée de $drv..."
|
||||
dd if=/dev/zero of=$drv bs=1024 count 1000000
|
||||
fi
|
||||
|
||||
# Empty cache and inform kernel of the change
|
||||
sync
|
||||
partprobe
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ $(zpool create zcalc -m /calcul/$HOSTNAME $CALCLEVEL $opt $CALCDRV) ]]; then
|
||||
# On active la compression par défaut
|
||||
if [[ $(zpool create zcalc -m $CALCMOUNTPOINT $CALCLEVEL $opt $CALCDRV) ]]; then
|
||||
# We activate lz4 compression by default
|
||||
zpool set zcalc compression=lz4
|
||||
|
||||
# If a VM is projected we create associated volume
|
||||
if [[ $WITH_VM == true ]]; then
|
||||
prnt I "Création du conteneur pour la future VM..."
|
||||
zfs create zcalc/vm
|
||||
@@ -47,7 +53,7 @@ conf_zfs()
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Création des partitions pour XFS et Ext4
|
||||
# Creation partitions for XFS or Ext4
|
||||
mkpart()
|
||||
{
|
||||
prnt I "Création d'une nouvelle table de partition GPT..."
|
||||
@@ -58,7 +64,7 @@ mkpart()
|
||||
conf_ext4()
|
||||
{
|
||||
mkpart
|
||||
# A finir
|
||||
# Todo
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -67,20 +73,20 @@ conf_xfs()
|
||||
prnt I "Installation des outils XFS..."
|
||||
pkginst xfsprogs
|
||||
mkpart
|
||||
# A finir
|
||||
# todo
|
||||
}
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
conf_disks()
|
||||
{
|
||||
[[ $STOP_CONF_DISK ]] && return 0
|
||||
[[ -n $STOP_CONF_DISK ]] && return 0
|
||||
|
||||
if [[ ! $CALCDRV ]]; then
|
||||
prnt I "Pas de disque de calcul défini, rien à faire."
|
||||
return 0
|
||||
fi
|
||||
|
||||
|
||||
prnt I "Installation des outils de partitionnement..."
|
||||
pkginst parted
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Locale
|
||||
|
||||
export VER_conf_locale="0.0.3
|
||||
"
|
||||
export VER_conf_locale="0.0.3"
|
||||
|
||||
conf_locale()
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ conf_ssh()
|
||||
|
||||
precheck_conf_ssh()
|
||||
{
|
||||
: # Rien à vérifier
|
||||
: # Nothing to check
|
||||
}
|
||||
|
||||
export -f conf_ssh
|
||||
|
||||
@@ -12,7 +12,7 @@ conf_syslog()
|
||||
|
||||
precheck_conf_syslog()
|
||||
{
|
||||
: # Rien à vérifier
|
||||
: # Nothing to check
|
||||
}
|
||||
|
||||
export -f conf_syslog
|
||||
|
||||
@@ -1,22 +1,32 @@
|
||||
# Installation des paquets
|
||||
|
||||
export VER_install_pkg="0.1.0"
|
||||
export VER_install_pkg="0.1.1"
|
||||
|
||||
install_pkg()
|
||||
{
|
||||
# Remove unnecessary packages
|
||||
[[ -n $PKGS_RMLIST ]] &&
|
||||
prnt I "Suppression de paquets supperflus..." &&
|
||||
pkgrem $PKGS_RMLIST
|
||||
|
||||
# Blacklist some anoying packages (and remove them if needed)
|
||||
if [[ -n PKGS_BLACKLIST ]]; then
|
||||
for pkg in $PKGS_BLACKLIST; do
|
||||
prnt I "Mise du paquet $pkg en liste noire..."
|
||||
local dest=/usr/apt/preferences.d/blacklist_$pkg.conf
|
||||
installfile blacklist.conf $dest &&
|
||||
sed -i -e "s/@pkg@/pkg/" $dest
|
||||
|
||||
# If blacklisted we suppose uninstall as well (if neeeded)
|
||||
pkgrem $pkg
|
||||
done
|
||||
fi
|
||||
|
||||
# Cleaning
|
||||
prnt I "Suppression des paquets résiduels le cas échéant..."
|
||||
pkgautorem
|
||||
|
||||
# Install all the configured packages
|
||||
[[ -n $PKGSEL ]] &&
|
||||
prnt I "Installation de la sélection de paquets..." &&
|
||||
pkginst $PKGSEL
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Module mise à jour de la distribution
|
||||
# Distribution upgrade module, should be ran prior any other module
|
||||
|
||||
export VER_upgrade_dist="0.0.4"
|
||||
export VER_upgrade_dist="0.0.5"
|
||||
|
||||
upgrade_dist()
|
||||
{
|
||||
@@ -25,8 +25,6 @@ upgrade_dist()
|
||||
pkgupdt
|
||||
prnt I "Application des mises à jour de paquets..."
|
||||
pkgupdg
|
||||
prnt I "Suppression de paquets indésirables..."
|
||||
pkgrem $RMLIST
|
||||
prnt I "Suppression des paquets résiduels..."
|
||||
pkgautorem
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user