|
|
@ -17,6 +17,26 @@ verifMVExiste()
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initEnv()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
echo "initEnv" # Debogage
|
|
|
|
|
|
|
|
local l_option=${1}
|
|
|
|
|
|
|
|
echo "l_option=${l_option}" # Debogage
|
|
|
|
|
|
|
|
shift
|
|
|
|
|
|
|
|
case "${l_option}" in
|
|
|
|
|
|
|
|
"sousvolume")
|
|
|
|
|
|
|
|
echo "initEnv - sousvolume" # Debogage
|
|
|
|
|
|
|
|
case "${1}" in
|
|
|
|
|
|
|
|
"btrfs"|"BTRFS")
|
|
|
|
|
|
|
|
echo "initEnv - sousvolume - BTRFS" # Debogage
|
|
|
|
|
|
|
|
btrfs subvolume create ${base_chemin_mv}
|
|
|
|
|
|
|
|
if [[ $? -gt 0 ]]; then
|
|
|
|
|
|
|
|
die "La création du sous-volume dans le système de fichier cible n'est pas possible." 7
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
nouvMV()
|
|
|
|
nouvMV()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
local l_option=${1}
|
|
|
|
local l_option=${1}
|
|
|
@ -78,11 +98,10 @@ nouvMV()
|
|
|
|
execCmd()
|
|
|
|
execCmd()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#verifEnv
|
|
|
|
#verifEnv
|
|
|
|
for ((id_commande=0 ; "${#commandes_a_executer[*]}" - "${id_commande}"; id_commande++)); do
|
|
|
|
liste_executions=("$@")
|
|
|
|
${commandes_a_executer["${id_commande}"]}
|
|
|
|
for ((id_commande=0 ; "${#liste_executions[*]}" - "${id_commande}"; id_commande++)); do
|
|
|
|
|
|
|
|
${liste_executions["${id_commande}"]}
|
|
|
|
done
|
|
|
|
done
|
|
|
|
echo "########## FICHIER ##########" # Debogage
|
|
|
|
|
|
|
|
cat ${chemin_mv} # Debogage
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
confInteractive()
|
|
|
|
confInteractive()
|
|
|
@ -341,12 +360,27 @@ creeMV()
|
|
|
|
|
|
|
|
|
|
|
|
commandes_a_executer+=( "nouvMV reseau ${reseau_nom_interface} ${reseau_type} ${reseau_activ_pont} ${reseau_nom_pont} ${reseau_activ_8021q} ${reseau_mode_8021q} ${reseau_vid}")
|
|
|
|
commandes_a_executer+=( "nouvMV reseau ${reseau_nom_interface} ${reseau_type} ${reseau_activ_pont} ${reseau_nom_pont} ${reseau_activ_8021q} ${reseau_mode_8021q} ${reseau_vid}")
|
|
|
|
echo "nouvMV reseau ${reseau_nom_interface} ${reseau_type} ${reseau_activ_pont} ${reseau_nom_pont} ${reseau_activ_8021q} ${reseau_mode_8021q} ${reseau_vid}" # Debogage
|
|
|
|
echo "nouvMV reseau ${reseau_nom_interface} ${reseau_type} ${reseau_activ_pont} ${reseau_nom_pont} ${reseau_activ_8021q} ${reseau_mode_8021q} ${reseau_vid}" # Debogage
|
|
|
|
|
|
|
|
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
"-s") # Sous-volume BTRFS
|
|
|
|
"-p") # VFIO PCI
|
|
|
|
|
|
|
|
echo "pci" # Debogage
|
|
|
|
|
|
|
|
# -device vfio-pci,host=0b:10.0,id=hostdev0,bus=pci.0,addr=0xa
|
|
|
|
|
|
|
|
shift
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
"-s") # Sous-volume
|
|
|
|
echo "sous-volume" # Debogage
|
|
|
|
echo "sous-volume" # Debogage
|
|
|
|
|
|
|
|
parametre="${2}"
|
|
|
|
|
|
|
|
echo "sous-volume parametre=${parametre}" # Debogage
|
|
|
|
|
|
|
|
presenceParametre "$#" "$1"
|
|
|
|
|
|
|
|
shift
|
|
|
|
if [[ ${temoin_s} -ne 1 ]]; then
|
|
|
|
if [[ ${temoin_s} -ne 1 ]]; then
|
|
|
|
#commandes_a_executer+=( "nouvMV ${nom_mv}")
|
|
|
|
case ${1} in
|
|
|
|
|
|
|
|
"btrfs"|"BTRFS")
|
|
|
|
|
|
|
|
if [[ ! $(command -v btrfs) ]]; then
|
|
|
|
|
|
|
|
die "Le paquet btrfs-progs n'est pas installé." 6
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
commandes_init_a_executer+=( "initEnv sousvolume ${1}" )
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
temoin_s=1
|
|
|
|
temoin_s=1
|
|
|
|
else
|
|
|
|
else
|
|
|
|
die "L'option ${1} a déjà été renseignée." 3
|
|
|
|
die "L'option ${1} a déjà été renseignée." 3
|
|
|
@ -384,9 +418,12 @@ creeMV()
|
|
|
|
if [[ ${temoin_c} -ne 1 || ${temoin_m} -ne 1 ]]; then
|
|
|
|
if [[ ${temoin_c} -ne 1 || ${temoin_m} -ne 1 ]]; then
|
|
|
|
die "Les parametres -c et -m sont obligatoires." 2
|
|
|
|
die "Les parametres -c et -m sont obligatoires." 2
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
#verifMVExiste ${nom_mv} &&
|
|
|
|
#verifMVExiste ${nom_mv}
|
|
|
|
|
|
|
|
execCmd "${commandes_init_a_executer[@]}"
|
|
|
|
mkdir -p ${base_chemin_mv}/${nom_mv}
|
|
|
|
mkdir -p ${base_chemin_mv}/${nom_mv}
|
|
|
|
execCmd
|
|
|
|
execCmd "${commandes_a_executer[@]}"
|
|
|
|
|
|
|
|
echo "########## FICHIER ##########" # Debogage
|
|
|
|
|
|
|
|
cat ${chemin_mv} # Debogage
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
usage()
|
|
|
|
usage()
|
|
|
|