Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: remote_access.sh

Issue 5550001: Create a new command update_kernel.sh (Closed) Base URL: http://git.chromium.org/git/crosutils.git@master
Patch Set: Fix comment. Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « image_to_live.sh ('k') | update_kernel.sh » ('j') | update_kernel.sh » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remote_access.sh
diff --git a/remote_access.sh b/remote_access.sh
index f3d490ab973e03d8011b142ded42341ea0a43297..794deff8e755ed0a98a35513016e86c3239cdbad 100644
--- a/remote_access.sh
+++ b/remote_access.sh
@@ -68,6 +68,31 @@ function learn_board() {
info "Target reports board is ${FLAGS_board}"
}
+function remote_reboot {
+ info "Rebooting."
+ remote_sh "touch /tmp/awaiting_reboot; reboot"
+ local output_file
+ output_file="${TMP}/output"
+
+ while true; do
+ REMOTE_OUT=""
+ # This may fail while the machine is down so generate output and a
+ # boolean result to distinguish between down/timeout and real failure
+ ! remote_sh_allow_changed_host_key \
+ "echo 0; [ -e /tmp/awaiting_reboot ] && echo '1'; true"
+ echo "${REMOTE_OUT}" > "${output_file}"
+ if grep -q "0" "${output_file}"; then
+ if grep -q "1" "${output_file}"; then
+ info "Not yet rebooted"
+ else
+ info "Rebooted and responding"
+ break
+ fi
+ fi
+ sleep .5
+ done
+}
+
function cleanup_remote_access() {
# Call this function from the exit trap of the main script.
# Iff we started ssh-agent, be nice and clean it up.
« no previous file with comments | « image_to_live.sh ('k') | update_kernel.sh » ('j') | update_kernel.sh » ('J')

Powered by Google App Engine
This is Rietveld 408576698