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

Unified Diff: remote_access.sh

Issue 3276002: Script to generate post mortem of all crashes on device (Closed) Base URL: http://git.chromium.org/git/crosutils.git
Patch Set: Respond to reviews Created 10 years, 4 months 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
« cros_show_stacks ('K') | « image_to_live.sh ('k') | run_remote_tests.sh » ('j') | no next file with comments »
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 f34f30b0b6640ebb86c088a9abb2db68ceb6cb10..6a5a6d1fb6675a9daa6931a9cf8c167f2fdd6ce6 100644
--- a/remote_access.sh
+++ b/remote_access.sh
@@ -14,12 +14,20 @@ DEFINE_integer ssh_port 22 \
"SSH port of the remote machine running Chromium OS instance"
# Copies $1 to $2 on remote host
-function remote_cp() {
+function remote_cp_to() {
REMOTE_OUT=$(scp -o StrictHostKeyChecking=no -o \
UserKnownHostsFile=$TMP_KNOWN_HOSTS $1 root@$FLAGS_remote:$2)
return ${PIPESTATUS[0]}
}
+# Copies a list of remote files specified in file $1 to local location
+# $2. Directory paths in $1 are collapsed into $2.
+function remote_rsync_from() {
+ rsync -e "ssh -o StrictHostKeyChecking=no -o \
+ UserKnownHostsFile=$TMP_KNOWN_HOSTS" --no-R \
+ --files-from=$1 root@${FLAGS_remote}:/ $2
+}
+
function remote_sh() {
REMOTE_OUT=$(ssh -p ${FLAGS_ssh_port} -o StrictHostKeyChecking=no -o \
UserKnownHostsFile=$TMP_KNOWN_HOSTS root@$FLAGS_remote "$@")
@@ -48,6 +56,18 @@ function set_up_remote_access() {
echo "Connection OK"
}
+# Ask the target what board it is
+function learn_board() {
+ [ -n "${FLAGS_board}" ] && return
+ remote_sh grep CHROMEOS_RELEASE_BOARD /etc/lsb-release
+ FLAGS_board=$(echo "${REMOTE_OUT}" | cut -d '=' -f 2)
+ if [ -z "${FLAGS_board}" ]; then
+ error "Board required"
+ exit 1
+ fi
+ info "Target reports board is ${FLAGS_board}"
+}
+
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.
« cros_show_stacks ('K') | « image_to_live.sh ('k') | run_remote_tests.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698