diff --git a/kickstart/files/kickstart.cfg b/kickstart/files/kickstart.cfg index 176e3861..c19df1a1 100644 --- a/kickstart/files/kickstart.cfg +++ b/kickstart/files/kickstart.cfg @@ -2042,11 +2042,23 @@ else fi ilog "Executing: ostree --repo=${repo} pull --depth=-1 --mirror ${instbr}:${instbr}" - ostree --repo=${repo} pull --depth=-1 --mirror ${instbr}:${instbr} - rc=$? - if [ $rc -ne 0 ]; then - report_failure_with_msg "ostree pull failed, rc=$rc" - fi + MAX_TRIES=3 + RETRY_WAIT=10 + for try in 1 2 3 + do + ostree --repo=${repo} pull --depth=-1 --mirror ${instbr}:${instbr} + rc=$? + if [ ${rc} -ne 0 ]; then + if [ ${try} -lt ${MAX_TRIES} ] ; then + wlog "ostree pull failed on try ${try} of ${MAX_TRIES}, rc=${rc} ; retry in ${RETRY_WAIT} seconds ..." + sleep ${RETRY_WAIT} + else + report_failure_with_msg "ostree pull failed, rc=${rc} ; max tries ${try} of ${MAX_TRIES}" + fi + else + break + fi + done umount ${PHYS_SYSROOT} diff --git a/kickstart/files/miniboot.cfg b/kickstart/files/miniboot.cfg index 5b76e846..4e6580ec 100644 --- a/kickstart/files/miniboot.cfg +++ b/kickstart/files/miniboot.cfg @@ -2178,11 +2178,23 @@ else fi ilog "Executing: ostree --repo=${repo} pull --depth=-1 --mirror ${instbr}:${instbr}" - ostree --repo=${repo} pull --depth=-1 --mirror ${instbr}:${instbr} - rc=$? - if [ $rc -ne 0 ]; then - report_failure_with_msg "ostree pull failed, rc=$rc" - fi + MAX_TRIES=3 + RETRY_WAIT=10 + for try in 1 2 3 + do + ostree --repo=${repo} pull --depth=-1 --mirror ${instbr}:${instbr} + rc=$? + if [ ${rc} -ne 0 ]; then + if [ ${try} -lt ${MAX_TRIES} ] ; then + wlog "ostree pull failed on try ${try} of ${MAX_TRIES}, rc=${rc} ; retry in ${RETRY_WAIT} seconds ..." + sleep ${RETRY_WAIT} + else + report_failure_with_msg "ostree pull failed, rc=${rc} ; max tries ${try} of ${MAX_TRIES}" + fi + else + break + fi + done if [ -n "${remote_insturl}" ]; then # In this case, we've initialized our ostree repo from local disk @@ -2204,12 +2216,21 @@ else ostree config --repo=${repo} set "remote \"${instbr}\"".gpg-verify false fi ilog "Executing ostree pull from ${remote_insturl}:" - ilog "ostree --repo=${repo} pull --depth=-1 --mirror ${instbr}:${instbr}" - ostree --repo=${repo} pull --depth=-1 --mirror ${instbr}:${instbr} - rc=$? - if [ $rc -ne 0 ]; then - report_failure_with_msg "ostree pull failed, rc=$rc" - fi + for try in 1 2 3 + do + ostree --repo=${repo} pull --depth=-1 --mirror ${instbr}:${instbr} + rc=$? + if [ ${rc} -ne 0 ]; then + if [ ${try} -lt ${MAX_TRIES} ] ; then + wlog "ostree pull failed on try ${try} of ${MAX_TRIES}, rc=${rc} ; retry in ${RETRY_WAIT} seconds ..." + sleep ${RETRY_WAIT} + else + report_failure_with_msg "ostree pull failed, rc=${rc} ; max tries ${try} of ${MAX_TRIES}" + fi + else + break + fi + done fi ilog "ostree log for ${repo}, branch=${instbr}:" ostree --repo=${repo} log ${instbr}