From 983ec44099b756705e6bc2b307ae857ff4d61568 Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Mon, 22 Feb 2021 11:04:09 -0600 Subject: [PATCH] cdba: Support specifying cdba-server path For debug purposes it's useful to install a user-local version of the cdba-server and invoke this instead, rather then having to change the code add a flag to support specifying this on the command line. Signed-off-by: Bjorn Andersson --- cdba.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cdba.c b/cdba.c index c8acaf8..ad0e0bb 100644 --- a/cdba.c +++ b/cdba.c @@ -594,6 +594,7 @@ int main(int argc, char **argv) struct timeval timeout_inactivity_tv; struct timeval timeout_total_tv; struct termios *orig_tios; + const char *server_binary = "cdba-server"; int timeout_inactivity = 0; int timeout_total = 600; struct work *next; @@ -615,7 +616,7 @@ int main(int argc, char **argv) int opt; int ret; - while ((opt = getopt(argc, argv, "b:c:C:h:ilRt:T:")) != -1) { + while ((opt = getopt(argc, argv, "b:c:C:h:ilRt:S:T:")) != -1) { switch (opt) { case 'b': board = optarg; @@ -638,6 +639,9 @@ int main(int argc, char **argv) case 'R': fastboot_repeat = true; break; + case 'S': + server_binary = optarg; + break; case 't': timeout_total = atoi(optarg); break; @@ -676,7 +680,7 @@ int main(int argc, char **argv) break; } - ret = fork_ssh(host, "cdba-server", ssh_fds); + ret = fork_ssh(host, server_binary, ssh_fds); if (ret) err(1, "failed to connect to \"%s\"", host);