cdba: Add option to run cdba-server locally without ssh and without timeout#85
cdba: Add option to run cdba-server locally without ssh and without timeout#85lumag merged 4 commits intolinux-msm:masterfrom
Conversation
lumag
left a comment
There was a problem hiding this comment.
I've mixed feelings regarding this PR. Some time ago I implemented cdba-power for exactly the same reason - to control local boards (e.g. for the sake of reflashing the rootfs). What prevents you from installing SSH server locally?
The <boot.img> option is optional in cdba. If omitted, cdba falls back to falls back to running "fastboot continue" to boot the installed operating system.
Use execlp() instead of execl() to search the PATH for the ssh binary. This avoids problems in case the ssh binary is installed in a different path.
cdba is mainly intended for remote usage, but it also works well for controlling devices that you just need occasionally and then directly connect to your local laptop instead of a remote server. Another use case is if you just use cdba to power up a standard distro on a remote board and then SSH into it remotely. To avoid interruptions, it's better to start cdba locally on the server in a tmux session. That way, temporary disconnections do not power down the board. From a protocol perspective, everything is transferred through STDIN and STDOUT. It makes no difference if we have ssh piping the data to a remote server, or if the data is directly passed to the cdba-server binary started locally. The functionality works exactly the same. Add an option for this in the cdba client. If the -h <host> option is omitted, cdba-server is started locally.
If cdba is run with "-t 0", then disable the timeout completely and keep running until manually interrupted. This is useful for non-shared boards, e.g. when cdba is just used to power up the board remotely and you then SSH into a standard Linux distro installed on the board.
I'm also using cdba-power sometimes, but most of the time I still want to have the UART log, key combos and so on. With the ftdi_gpio-based debug boards it's hard to do anything without going through CDBA.
I could I guess, but to be honest I wouldn't want to. It's just overhead in this use case, a potential security hole without proper configuration, and you always need to unlock SSH keys etc. What are your concerns with launching cdba-server directly? It's quite elegant I think, since everything works exactly as for the remote case. |
I use CDBA for booting remote boards, but also sometimes to boot locally attached boards. In that case, the SSH tunnel is pointless (and I don't have a SSH server set up on my laptop). Add an option to start the cdba-server locally without SSH if the host is omitted.
Also add an option to disable the total timeout (
-t 0). I also sometimes use CDBA to power on a personal board remotely. Without specifying a boot.img, it boots into my installed Linux distro and then I access it via SSH. In that case, I don't want the board to power off while still being logged in.See commit log for details.