Correction de la méthode d'ajout de l'image iso.
On fait télécharger l'image iso directement par ONE. Pour l'instant pour garder l'esprit on attend la fin de l'initialisation pour rendre la main, mais on pourrais très bien laisser l'ajout se faire en tache de fond ref #17430 @1h (Contribution Cadoles)
This commit is contained in:
parent
776da48429
commit
5985b56e46
|
@ -80,13 +80,7 @@ echo
|
||||||
#*****************************************************
|
#*****************************************************
|
||||||
if ! runOneCmd "oneimage" "show ${ISONAME}" &>/dev/null
|
if ! runOneCmd "oneimage" "show ${ISONAME}" &>/dev/null
|
||||||
then
|
then
|
||||||
echo "***** Téléchargement de ${ISONAME} *****"
|
echo -ne "***** Création de l'image ${ISONAME} *****\n\n"
|
||||||
wget --output-document "/tmp/eole-${VERSIONISO}-alternate-amd64.iso" ${ISOURL}
|
|
||||||
echo "***** Création de ${ISONAME} *****"
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "Erreur lors du téléchargement, Abandon"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
FILE=$(mktemp)
|
FILE=$(mktemp)
|
||||||
cat > ${FILE} <<EOF
|
cat > ${FILE} <<EOF
|
||||||
|
@ -94,19 +88,27 @@ NAME="${ISONAME}"
|
||||||
TYPE="CDROM"
|
TYPE="CDROM"
|
||||||
DESCRIPTION="${ISODESC}"
|
DESCRIPTION="${ISODESC}"
|
||||||
DEV_PREFIX="hd"
|
DEV_PREFIX="hd"
|
||||||
PATH="/tmp/eole-${VERSIONISO}-alternate-amd64.iso"
|
PATH="${ISOURL}"
|
||||||
PERSISTENT="No"
|
PERSISTENT="No"
|
||||||
EOF
|
EOF
|
||||||
runOneCmd "oneimage" "create -d $(CreoleGet one_ds_iso_name) ${FILE}"
|
runOneCmd "oneimage" "create -d $(CreoleGet one_ds_iso_name) ${FILE}"
|
||||||
/bin/rm -f ${FILE}
|
/bin/rm -f ${FILE}
|
||||||
for i in `seq 60`
|
|
||||||
do
|
spin='-\|/'
|
||||||
sleep 1
|
i=0
|
||||||
#oneimage show ${ISONAME} | grep STATE | grep rdy &>/dev/null && break
|
while :
|
||||||
runOneCmd "oneimage" "show ${ISONAME}" | grep STATE | grep lock &>/dev/null || break
|
do
|
||||||
echo -n "Attente : "
|
imgState=$(runOneCmd "oneimage" "show ${ISONAME}" | awk '{if ($1 == "STATE") {print $3}}')
|
||||||
runOneCmd "oneimage" "show ${ISONAME}" | grep STATE
|
if [[ ${imgState} == "lock" ]]
|
||||||
done
|
then
|
||||||
|
i=$(( (i+1) %4 ))
|
||||||
|
printf "\rInitialisation en cours, merci de patienter [${spin:$i:1}] "
|
||||||
|
sleep 2
|
||||||
|
else
|
||||||
|
printf "\r Création terminée, l'image a le statut : ${imgState}\n"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
rm -f "/tmp/eole-${VERSIONISO}-alternate-amd64.iso"
|
rm -f "/tmp/eole-${VERSIONISO}-alternate-amd64.iso"
|
||||||
else
|
else
|
||||||
echo "***** ${ISONAME} existe déjà *****"
|
echo "***** ${ISONAME} existe déjà *****"
|
||||||
|
|
Loading…
Reference in New Issue