rootfs: Print attempt number after max check

With the old code it was possible to see odd messages like:
"INFO: Create root disk image. Attempt 6 out of 5."

Move the attempt number print to after we check against the max

Fixes #251

Signed-off-by: Matt Fischer <matt@mattfischer.com>
This commit is contained in:
Matt Fischer 2019-03-15 22:56:35 -06:00
parent ecd072430f
commit ad5d879f8c

View File

@ -205,10 +205,10 @@ detach()
create_rootfs_disk() create_rootfs_disk()
{ {
ATTEMPT_NUM=$(($ATTEMPT_NUM+1)) ATTEMPT_NUM=$(($ATTEMPT_NUM+1))
info "Create root disk image. Attempt ${ATTEMPT_NUM} out of ${MAX_ATTEMPTS}."
if [ ${ATTEMPT_NUM} -gt ${MAX_ATTEMPTS} ]; then if [ ${ATTEMPT_NUM} -gt ${MAX_ATTEMPTS} ]; then
die "Unable to create root disk image." die "Unable to create root disk image."
fi fi
info "Create root disk image. Attempt ${ATTEMPT_NUM} out of ${MAX_ATTEMPTS}."
calculate_img_size calculate_img_size
if [ ${OLD_IMG_SIZE} -ne 0 ]; then if [ ${OLD_IMG_SIZE} -ne 0 ]; then