aboutsummaryrefslogtreecommitdiff
path: root/sample_images/generate_images.sh
diff options
context:
space:
mode:
authorAlex Deymo <deymo@google.com>2016-03-30 18:31:49 -0700
committerAlex Deymo <deymo@google.com>2016-04-04 19:17:27 -0700
commit0d29854cf5bb05a22cf161b50052539aa420a36e (patch)
tree323b0577ca6767d0e39fec74067bb2f32d5d1ea1 /sample_images/generate_images.sh
parente384bb2e403b0f0f666e89d5f6acfaec41120cc5 (diff)
downloadupdate_engine-0d29854cf5bb05a22cf161b50052539aa420a36e.tar.gz
Parse postinstall program progress updates.
In Android postinstall is expected to take a long time in common cases. This patch allows the postinstall program to report back to the updater a progress indication, which will then be forwarded to all the clients listening. These progress updates are part of the FINALIZING status. Bug: 27880754 TEST=Added unittests. Deployed an update to an edison-eng and post-install reported progress back with the postinstall_example. Change-Id: I35f96b92f090219c54cca48d8ab07c54cf8b4ab1
Diffstat (limited to 'sample_images/generate_images.sh')
-rwxr-xr-xsample_images/generate_images.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/sample_images/generate_images.sh b/sample_images/generate_images.sh
index ed5e00d3..6a0d1ea0 100755
--- a/sample_images/generate_images.sh
+++ b/sample_images/generate_images.sh
@@ -172,6 +172,17 @@ done
exit 1
EOF
+ # A program that reports back progress.
+ sudo tee "${mntdir}"/bin/postinst_progress >/dev/null <<EOF
+#!/etc/../bin/sh
+# These values have exact representation in IEEE 754 so we avoid rounding
+# errors.
+echo global_progress 0.25 >&3
+echo global_progress 0.5 >&3
+echo global_progress 1.0 >&3
+exit 0
+EOF
+
# A postinstall bash program.
sudo tee "${mntdir}"/bin/self_check_context >/dev/null <<EOF
#!/etc/../bin/sh