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,18 +88,26 @@ 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`
|
|
||||||
|
spin='-\|/'
|
||||||
|
i=0
|
||||||
|
while :
|
||||||
do
|
do
|
||||||
sleep 1
|
imgState=$(runOneCmd "oneimage" "show ${ISONAME}" | awk '{if ($1 == "STATE") {print $3}}')
|
||||||
#oneimage show ${ISONAME} | grep STATE | grep rdy &>/dev/null && break
|
if [[ ${imgState} == "lock" ]]
|
||||||
runOneCmd "oneimage" "show ${ISONAME}" | grep STATE | grep lock &>/dev/null || break
|
then
|
||||||
echo -n "Attente : "
|
i=$(( (i+1) %4 ))
|
||||||
runOneCmd "oneimage" "show ${ISONAME}" | grep STATE
|
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
|
done
|
||||||
rm -f "/tmp/eole-${VERSIONISO}-alternate-amd64.iso"
|
rm -f "/tmp/eole-${VERSIONISO}-alternate-amd64.iso"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue