|
|
@ -18,25 +18,16 @@ verifMVExiste()
|
|
|
|
nouvMV()
|
|
|
|
nouvMV()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
local l_option=${1}
|
|
|
|
local l_option=${1}
|
|
|
|
echo "l_option=${l_option}" # Debogage
|
|
|
|
local l_parametre=${2}
|
|
|
|
shift
|
|
|
|
|
|
|
|
case "${l_option}" in
|
|
|
|
case "${l_option}" in
|
|
|
|
"nom")
|
|
|
|
"nom")
|
|
|
|
echo "-name ${1} \\" > ${chemin_mv}
|
|
|
|
echo "-name ${l_parametre} \\" > ${chemin_mv}
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
"cpu")
|
|
|
|
"cpu")
|
|
|
|
echo "-cpu ${1} -smp cores=${2},theads=${3},sockets=1 \\" >> ${chemin_mv}
|
|
|
|
echo "-cpu ${l_parametre} \\" >> ${chemin_mv}
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
"memoire")
|
|
|
|
"memoire")
|
|
|
|
echo "-m ${1} \\" >> ${chemin_mv}
|
|
|
|
echo "-memoire ${l_parametre} \\" >> ${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
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -88,27 +79,7 @@ creeMV()
|
|
|
|
presenceParametre "$#" "$1"
|
|
|
|
presenceParametre "$#" "$1"
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
if [[ ${temoin_c} -ne 1 ]]; then
|
|
|
|
if [[ ${temoin_c} -ne 1 ]]; then
|
|
|
|
# <type de cpu>:<nombre de coeur>:<nombre de file d'execution>
|
|
|
|
commandes_a_executer+=("nouvMV cpu ${1}")
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
temoin_c=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
|
|
|
@ -134,14 +105,7 @@ creeMV()
|
|
|
|
presenceParametre "$#" "$1"
|
|
|
|
presenceParametre "$#" "$1"
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
if [[ ${temoin_b} -ne 1 ]]; then
|
|
|
|
if [[ ${temoin_b} -ne 1 ]]; then
|
|
|
|
case ${1} in
|
|
|
|
#commandes_a_executer+=( "nouvMV ${nom_mv}")
|
|
|
|
"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
|
|
|
|
temoin_b=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
|
|
|
|