|
|
|
@ -39,6 +39,17 @@ nouvMV()
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
;;
|
|
|
|
|
"disque")
|
|
|
|
|
echo "${2}"
|
|
|
|
|
if [[ ! -z ${2} ]]; then
|
|
|
|
|
if [[ ! -f ${bin_qemu_img} ]]; then
|
|
|
|
|
die "Le paquet qemu-utils n'est pas installé." 6
|
|
|
|
|
fi
|
|
|
|
|
echo "Création du disque..." # Debogage
|
|
|
|
|
qemu-img create -f ${2} ${1} ${3}
|
|
|
|
|
fi
|
|
|
|
|
echo "-drive file=${1},if=virtio \\" >> ${chemin_mv}
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -154,6 +165,33 @@ creeMV()
|
|
|
|
|
presenceParametre "$#" "$1"
|
|
|
|
|
echo "disque parametre=${parametre}" # Debogage
|
|
|
|
|
shift
|
|
|
|
|
|
|
|
|
|
# <chemin disque>|(<chemin disque>|<nom disque>):(raw|qcow2):<capacité>)
|
|
|
|
|
|
|
|
|
|
disque_nom=$( echo ${1} | awk -F: '{print $1}' )
|
|
|
|
|
echo "disque_nom=${disque_nom}" # Debogage
|
|
|
|
|
if [[ -z "${disque_nom}" ]]; then
|
|
|
|
|
die "Le disque n'est pas renseigné.\nSyntaxe attendue : <chemin disque>|(<chemin disque>|<nom disque>):(raw|qcow2):<capacité>)." 5
|
|
|
|
|
fi
|
|
|
|
|
if [[ "$(dirname ${1})" == "." ]];then
|
|
|
|
|
disque_nom="${base_chemin_mv}/${nom_mv}/${disque_nom}"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
disque_format=$( echo ${1} | awk -F: '{print $2}' )
|
|
|
|
|
echo "disque_format=${disque_format}" # Debogage
|
|
|
|
|
if [[ -z "${disque_format}" && "$(dirname ${1})" == "." ]]; then
|
|
|
|
|
die "Le format du disque n'est pas renseigné.\nSyntaxe attendue : <chemin disque>|(<chemin disque>|<nom disque>):(raw|qcow2):<capacité>)." 5
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
disque_capacite=$( echo ${1} | awk -F: '{print $3}' )
|
|
|
|
|
echo "disque_capacite=${disque_capacite}" # Debogage
|
|
|
|
|
if [[ -z "${disque_capacite}" && "$(dirname ${1})" == "." ]]; then
|
|
|
|
|
die "La capacité du disque n'est pas renseigné.\nSyntaxe attendue : <chemin disque>|(<chemin disque>|<nom disque>):(raw|qcow2):<capacité>)." 5
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
commandes_a_executer+=( "nouvMV disque ${disque_nom} ${disque_format} ${disque_capacite}")
|
|
|
|
|
;;
|
|
|
|
|
"-i") # Iso
|
|
|
|
|
echo "iso" # Debogage
|
|
|
|
@ -218,6 +256,8 @@ usage()
|
|
|
|
|
case ${1} in
|
|
|
|
|
cree)
|
|
|
|
|
echo "usage_cree" # Debogage
|
|
|
|
|
# qemu-img: Invalid image size specified. You may use k, M, G, T, P or E suffixes for
|
|
|
|
|
# qemu-img: kilobytes, megabytes, gigabytes, terabytes, petabytes and exabytes.
|
|
|
|
|
die "" 0
|
|
|
|
|
;;
|
|
|
|
|
demarre)
|
|
|
|
|