|
|
|
@ -18,16 +18,25 @@ verifMVExiste()
|
|
|
|
|
nouvMV()
|
|
|
|
|
{
|
|
|
|
|
local l_option=${1}
|
|
|
|
|
local l_parametre=${2}
|
|
|
|
|
echo "l_option=${l_option}" # Debogage
|
|
|
|
|
shift
|
|
|
|
|
case "${l_option}" in
|
|
|
|
|
"nom")
|
|
|
|
|
echo "-name ${l_parametre} \\" > ${chemin_mv}
|
|
|
|
|
echo "-name ${1} \\" > ${chemin_mv}
|
|
|
|
|
;;
|
|
|
|
|
"cpu")
|
|
|
|
|
echo "-cpu ${l_parametre} \\" >> ${chemin_mv}
|
|
|
|
|
echo "-cpu ${1} -smp cores=${2},theads=${3},sockets=1 \\" >> ${chemin_mv}
|
|
|
|
|
;;
|
|
|
|
|
"memoire")
|
|
|
|
|
echo "-memoire ${l_parametre} \\" >> ${chemin_mv}
|
|
|
|
|
echo "-m ${1} \\" >> ${chemin_mv}
|
|
|
|
|
;;
|
|
|
|
|
"bios")
|
|
|
|
|
case "${1}" in
|
|
|
|
|
"OVMF")
|
|
|
|
|
cp /usr/share/ovmf/OVMF.fd ${base_chemin_mv}/OVMF.fd
|
|
|
|
|
echo "-drive if=pflash,format=raw,file=${base_chemin_mv}/OVMF.fd \\" >> ${chemin_mv}
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
}
|
|
|
|
@ -79,7 +88,27 @@ creeMV()
|
|
|
|
|
presenceParametre "$#" "$1"
|
|
|
|
|
shift
|
|
|
|
|
if [[ ${temoin_c} -ne 1 ]]; then
|
|
|
|
|
commandes_a_executer+=("nouvMV cpu ${1}")
|
|
|
|
|
# <type de cpu>:<nombre de coeur>:<nombre de file d'execution>
|
|
|
|
|
|
|
|
|
|
cpu_type=$( echo ${1} | awk -F: '{print $1}' )
|
|
|
|
|
echo "${cpu_type}" # Debogage
|
|
|
|
|
if [[ -z "${cpu_type}" ]]; then
|
|
|
|
|
die "Le type de CPU n'est pas renseigné.\nSyntaxe attendu : <type CPU>:<nombres cœurs CPU>:<nombre files d'execution>." 5
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
cpu_nombre_de_coeurs=$( echo ${1} | awk -F: '{print $2}' )
|
|
|
|
|
echo "${cpu_nombre_de_coeurs}" # Debogage
|
|
|
|
|
if [[ -z "${cpu_nombre_de_coeurs}" ]]; then
|
|
|
|
|
die "Le nombre de cœurs n'est pas renseigné.\nSyntaxe attendu : <type CPU>:<nombres cœurs CPU>:<nombre files d'execution>." 5
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
cpu_nombre_de_files_d_execution=$( echo ${1} | awk -F: '{print $3}' )
|
|
|
|
|
echo "${cpu_nombre_de_files_d_execution}" # Debogage
|
|
|
|
|
if [[ -z "${cpu_nombre_de_files_d_execution}" ]]; then
|
|
|
|
|
die "Le nombre de files d'execution n'est pas renseigné.\nSyntaxe attendu : <type CPU>:<nombres cœurs CPU>:<nombre files d'execution>." 5
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
commandes_a_executer+=("nouvMV cpu ${cpu_type} ${cpu_nombre_de_coeurs} ${cpu_nombre_de_files_d_execution}")
|
|
|
|
|
temoin_c=1
|
|
|
|
|
else
|
|
|
|
|
die "L'option ${1} a déjà été renseignée." 3
|
|
|
|
@ -105,7 +134,14 @@ creeMV()
|
|
|
|
|
presenceParametre "$#" "$1"
|
|
|
|
|
shift
|
|
|
|
|
if [[ ${temoin_b} -ne 1 ]]; then
|
|
|
|
|
#commandes_a_executer+=( "nouvMV ${nom_mv}")
|
|
|
|
|
case ${1} in
|
|
|
|
|
"ovmf"|"OVMF")
|
|
|
|
|
if [[ ! $(ls /usr/share/ovmf/OVMF.fd 2>/dev/null) ]]; then
|
|
|
|
|
die "Le paquet ovmf n'est pas installé." 6
|
|
|
|
|
fi
|
|
|
|
|
commandes_a_executer+=( "nouvMV bios $(echo ${1} | tr '[:lower:]' '[:upper:]')")
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
temoin_b=1
|
|
|
|
|
else
|
|
|
|
|
die "L'option ${1} a déjà été renseignée." 3
|
|
|
|
|