Controlling a strategy at runtime

Open
#1,374 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
cli, embedded-iot

Research direction

Start at the labgrid-client command-line entry point and review how strategies currently receive configuration and startup commands. Compare the proposed -V variables and the three do-build/do-bootstrap modes, then define how each mode should select console startup, U-Boot writing, and building; done means the requested runtime strategy behavior is controllable from the command line.

Written by the indexing model from the issue text.

Description

I would like to be able to tell the U-Boot strategy what to do at runtime, e.g.:

  1. just start up the board and connect a console
  2. write U-Boot to the board, then do 1
  3. build U-Boot and then do 2

At the moment I have implemented this with a new --variable (-V) argument to labgrid-client, with these variables available for use by strategies.

By far the most common use case I have is to build, write and start U-Boot on a board (case 3). This is:

labgrid-client -c env_rpi_try.cfg -V do-bootstrap 1 -V do-build 1 -p opi_pc -s start console 

To just write the already-built U-Boot (case 2):

labgrid-client -c env_rpi_try.cfg -V do-bootstrap 1 -V do-build 0 -p opi_pc -s start console 

To just start with whatever the board has (case 1):

labgrid-client -c env_rpi_try.cfg -V do-bootstrap 0 -V do-build 0 -p opi_pc -s start console 

Does this seems like a reasonable feature? Is there an existing mechanism to control strategies from the cmdline?

Dominant language
Python
Stars
528
Forks
278
Avg merge
2d 19h
Merged PRs (30d)
4

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from labgrid-project/labgrid

All issues in labgrid-project/labgrid

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.