Commit Graph

43 Commits

Author SHA1 Message Date
Bjorn Andersson
3554179153 bad: Disconnect link when select board fails
Exit bad as it fails to open a board, so that we don't just rely on the
client to read this message and close the link.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-10-23 21:54:44 -07:00
Bjorn Andersson
47399e9765 bad: Handle SIGPIPE
In some cases as the client is disconnected a SIGPIPE is delivered to
bad, trap this and power off the board.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-10-23 21:54:44 -07:00
Bjorn Andersson
f068352970 cdba: Support sending break with CDB assist
Add special key 'B' to send a break, currently only implemented with the
CDB assist.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-08-26 10:10:49 -07:00
Bjorn Andersson
91ee23ae86 cdba: Add -C argument for power-cycle on success only
When using cdba to bisect for intermittent issues related to boot
lockups or crashes taking us to download mode it's only useful to
power-cycle on success (as a failure case shows the intermittent
problem).

Add a special version of the existing power cycle code, that stops the
power cycling loop if a timeout criteria is hit, cutting down on
unnecessary reboots of a broken kernel.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-08-13 12:40:19 -07:00
Bjorn Andersson
ab93bc2255 cdba: -t should always disable inactivity timeout
Specifying -t means that inactivity timeout should be disabled,
regardless of the value. Specifying either -t 0 or -T 0 will set timeout
to 0, which means no timeout, regardless of timeout_on_inactivity.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-08-01 11:19:27 -07:00
Vinod Koul
75cf87d509 README: Update dependency installation
Add a line for fedora based systems.

Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-01-16 23:13:53 -08:00
Amit Kucheria
40be97cbfa README: Add a line about dependency installation
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
2019-01-12 23:40:08 -08:00
Amit Kucheria
8fa6fc9a2f cdba: Make inactivity timeout a default
Reverse the logic of inactivity timeout so that by default we set
inactivity timeout to 600s. Passing -T 0 disables inactivity timeout
completely.

Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
2019-01-12 23:40:08 -08:00
Amit Kucheria
b996b5eb99 gitignore: Ignore the binaries generated by the program
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
2019-01-12 23:40:08 -08:00
Bjorn Andersson
dcccae8226 conmux: Handle EOF from conmux
If conmux goes away, e.g. by someone invoking ~$quit, the read() from
the conmux fd will continously return 0, which is not discarded as an
error, but sent as a console output message to the client, continuously.

Quit bad when this happens, instead.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-12-10 09:32:19 -08:00
Bjorn Andersson
5da489beee device_parser: Increase max key/value length
When pointing alpaca to persistent named aliases in /dev/serial/by-id we
end up with > 80 chars of path in value, which gets nicely truncated.
Increase this max.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-12-05 17:14:35 -08:00
Bjorn Andersson
07b7d195fc bad: Introduce alpaca support
Introduce support for controlling boards using an alpaca interface.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-12-05 17:14:00 -08:00
Bjorn Andersson
eacf76b7b9 cdba: Support inactivity timeout
In addition to have a fixed timeout (-t) introduce a new inactivity
timeout (-T) which allow us to provide a shorter timeout to quickly
abort when the kernel fails to boot but still allow us to run lengthy
test scripts without getting a timeout.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-11-30 11:36:07 -08:00
Bjorn Andersson
1e92a38df1 cdba: Make exit code reflect exit cause
Make the exit code non-zero when the cdba for some reason failed, to
allow tools calling cdba to differentiate the various scenarios.

There is still some tuning needed here, but for now we exit with error
code 110 if we reached a timeout, 1 if there was an error and 0 if we
either exited by user request or by hitting the power-off token.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-11-30 11:23:54 -08:00
Bjorn Andersson
7c12435aae cdba: Gracefully handle stdin not being a tty
In the event that cdba is launched from e.g. a cron job stdin won't be a
tty and as such we can't modify the termios settings.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-11-30 11:23:54 -08:00
Bjorn Andersson
e44274243a conmux: Fix conmux client name
There are other users than myself of this, so don't hard code the conmux
id as "bjorn" but rather base it on $USER.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-11-30 11:21:00 -08:00
Bjorn Andersson
193c195c2a fastboot: Use stderr to communicate status messages
Use stderr to communicate status messages from fastboot boot, rather
than stdout.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-11-30 11:04:56 -08:00
Bjorn Andersson
fcfb7ad05f fastboot: Don't tear down link when fastboot download fails
There are cases where fastboot simply disconnects, where it makes sense
to maintain the cdba connection, so return gracefully from
fastboot_download() when this happens.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-11-30 11:02:14 -08:00
Bjorn Andersson
8306649692 conmux: Bump max response length
When a conmux is already attached the motd becomes quite long,
surpassing the 128 bytes, bump the max response length.

This solves the problem sometimes seen as:

  bad: parsing reqistry lookup response: truncated percent-encoding

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-11-30 11:00:33 -08:00
Bjorn Andersson
c264b11e94 bad: Introduce lockfile for boards
Grab a flock() in order to prohibit multiple clients from controlling
the same board at any point in time.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-04-22 10:06:00 -07:00
Bjorn Andersson
35a15a991f bad: Enable vbus to boot device and hold fastbot key
Use vbus to trigger boot of the devices and release the fastboot key
once we see traces of fastboot.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-04-20 14:54:56 -07:00
Bjorn Andersson
2205666349 cdb_assist: Support togging the fastboot key
For some devices it's not possible to use fastboot boot and
as such they will not enter fastboot unless the fastboot key
is held. Expose this functionality in the device api.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-04-20 14:54:56 -07:00
Bjorn Andersson
6b334bd512 cdba: Add support for timeout
Support specifying a timeout -t in order to limit the execution time of
stalling test runs.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-04-11 16:35:33 -07:00
Bjorn Andersson
c3a7b4ee9f cdba: Add readme file
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-12 19:09:15 -07:00
Bjorn Andersson
6c5bd3c77e cdba: Add license header where missing
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-12 19:09:15 -07:00