|
|
@ -17,26 +17,6 @@ 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}
|
|
|
@ -98,10 +78,11 @@ nouvMV()
|
|
|
|
execCmd()
|
|
|
|
execCmd()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#verifEnv
|
|
|
|
#verifEnv
|
|
|
|
liste_executions=("$@")
|
|
|
|
for ((id_commande=0 ; "${#commandes_a_executer[*]}" - "${id_commande}"; id_commande++)); do
|
|
|
|
for ((id_commande=0 ; "${#liste_executions[*]}" - "${id_commande}"; id_commande++)); do
|
|
|
|
${commandes_a_executer["${id_commande}"]}
|
|
|
|
${liste_executions["${id_commande}"]}
|
|
|
|
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "########## FICHIER ##########" # Debogage
|
|
|
|
|
|
|
|
cat ${chemin_mv} # Debogage
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
confInteractive()
|
|
|
|
confInteractive()
|
|
|
@ -360,27 +341,12 @@ 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
|
|
|
|
|
|
|
|
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
"-p") # VFIO PCI
|
|
|
|
"-s") # Sous-volume BTRFS
|
|
|
|
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
|
|
|
|
case ${1} in
|
|
|
|
#commandes_a_executer+=( "nouvMV ${nom_mv}")
|
|
|
|
"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
|
|
|
@ -418,12 +384,9 @@ 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 "${commandes_a_executer[@]}"
|
|
|
|
execCmd
|
|
|
|
echo "########## FICHIER ##########" # Debogage
|
|
|
|
|
|
|
|
cat ${chemin_mv} # Debogage
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
usage()
|
|
|
|
usage()
|
|
|
|