f0cal / farm-client

CLI client for FØCAL's cluster of edge devices and AI co-processors
https://f0cal.com
MIT License
1 stars 0 forks source link

Phase4 (blocker): Remove the need for the user to wait for the DUT to flash #53

Open thrix opened 2 years ago

thrix commented 2 years ago

Currently, we use these commands to flash the DUT (high level, non f0cal functions omitted):

info "Rendering flash configuration"

info "Powering off DUT"
f0cal farm target set --power off $DEVICE

info "Adding flash configuraton"
f0cal farm target set --nfsroot $RENDERED $DEVICE

info "Powering on DUT"
f0cal farm target set --power on $DEVICE

info "Wait until flashed"
f0cal farm target connect --method=uart $DEVICE

info "Rendering boot configuration"

info "Powering off DUT"
f0cal farm target set --power off $DEVICE

info "Add boot configuration"
f0cal farm target set --nfsroot $RENDERED $DEVICE

info "Powering on DUT"
f0cal farm target set --power on $DEVICE

info "Booting flashed image"
f0cal farm target connect --method=uart $DEVICE

We need to get rid of the Wait until flashed step. The user here needs to coordinate the process, by waiting on the flashing to finish, deciding if it was successful and then powering off the DUT and adding the configuration so the DUT boots the flashed image. Using sleep here instead of watching the serial console is insufficient, as it is error-prone and does not provide feedback if the actual image was flashed.

To recap, we would need here a command which can:

Another possibility is to provide the workflow command as described in #52 with proper error handling.

brianthelion commented 2 years ago

If we provide the UART output as text on stdout, can you write an expect script to detect successful boot?