stateful_update: Increase the timeout stateful update timeout Daisy-stake devices are failing because it takes more than two minutes to unzip the update.tgz and write it to the stateful (It takes 2m51 on a DUT with the payload in /tmp). Increase this timeout so we don't hit this problem again if the size of the stateful update grows or the disk is slow. Also added check for the exit code of the call that does the actual work so we know if it fails for any other reason. BUG=chromium:912705 TEST=deployed to a DUT and stateful_update passed successfully. Change-Id: Ib7479f5b46be83fd0c2bdc062e42c211b1229c44 Reviewed-on: https://chromium-review.googlesource.com/1370869 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: David Haddock <dhaddock@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> (cherry picked from commit 3e3f5d022658adfed300971592a345a2426f2f10) Reviewed-on: https://chromium-review.googlesource.com/c/1373952 Reviewed-by: Amin Hassani <ahassani@chromium.org> Commit-Queue: Amin Hassani <ahassani@chromium.org>
diff --git a/stateful_update b/stateful_update index e76d058..a705402 100755 --- a/stateful_update +++ b/stateful_update
@@ -97,9 +97,14 @@ echo >&2 "Successfully downloaded update." else echo >&2 "Reading local payload ${local_payload_path}" - # Set timeout to two minutes to avoid waiting on stdin indefinitely. - timeout 120s tar --ignore-command-error --overwrite \ + # Set timeout to four minutes to avoid waiting on stdin indefinitely. + timeout 240s tar --ignore-command-error --overwrite \ --directory=${STATEFUL_DIR} -xzf ${local_payload_path} + exit_code=$? + if [ "${exit_code}" -ne 0 ]; then + echo >&2 "Failed to unzip and write the stateful update." + return "${exit_code}" + fi echo >&2 "Successfully retrieved update." fi