diff --git a/README b/README index 1270d45..1203269 100644 --- a/README +++ b/README @@ -19,11 +19,12 @@ from sandbox/cdba/cdba-server. Available devices are read from $HOME/.cdba = Client side The client is invoked as: - cdba -b -h [-c ] [-s ] [boot.img] + cdba -b [-h ] [-c ] [-s ] [boot.img] will be connected to using ssh and will be selected for operation. As the board's fastboot interface shows up the given boot.img -will be transfered and booted on the device. If [boot.img] is omitted, +will be transfered and booted on the device. If is omitted, the +cdba-server is started locally without using ssh. If [boot.img] is omitted, "fastboot continue" is run to boot the installed operating system. The board will execute until the key sequence ^A q is invoked or the board diff --git a/cdba.c b/cdba.c index 8595fa4..e9bb43a 100644 --- a/cdba.c +++ b/cdba.c @@ -103,8 +103,13 @@ static int fork_ssh(const char *host, const char *cmd, int *pipes) close(piped_stderr[0]); close(piped_stderr[1]); - execlp("ssh", "ssh", host, cmd, NULL); - err(1, "launching ssh failed"); + if (host) { + execlp("ssh", "ssh", host, cmd, NULL); + err(1, "launching ssh failed"); + } else { + execlp(cmd, cmd, NULL); + err(1, "launching cdba-server failed"); + } default: close(piped_stdin[0]); close(piped_stdout[1]); @@ -583,12 +588,12 @@ static void usage(void) { extern const char *__progname; - fprintf(stderr, "usage: %s -b -h [-t ] " + fprintf(stderr, "usage: %s -b [-h ] [-t ] " "[-T ] [boot.img]\n", __progname); - fprintf(stderr, "usage: %s -i -b -h \n", + fprintf(stderr, "usage: %s -i -b [-h ]\n", __progname); - fprintf(stderr, "usage: %s -l -h \n", + fprintf(stderr, "usage: %s -l [-h ]\n", __progname); exit(1); } @@ -667,9 +672,6 @@ int main(int argc, char **argv) } } - if (!host) - usage(); - switch (verb) { case CDBA_BOOT: if (optind > argc || !board)