Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

U-Boot boot commands Support #1082

Merged
merged 2 commits into from Feb 23, 2023
Merged

Conversation

jremmet
Copy link
Contributor

@jremmet jremmet commented Jan 26, 2023

uboot doesn't have pre defined boot sources. The "boot" command takes no parameters.
Add self.boot_commands to hold different boot_command by name.
They can be used with LinuxBootProtocol boot(name)

Checklist

  • Tests for the feature
  • PR has been tested

@codecov
Copy link

codecov bot commented Jan 26, 2023

Codecov Report

Base: 63.2% // Head: 63.3% // Increases project coverage by +0.0% 🎉

Coverage data is based on head (cfb9903) compared to base (1318c27).
Patch coverage: 100.0% of modified lines in pull request are covered.

Additional details and impacted files
@@          Coverage Diff           @@
##           master   #1082   +/-   ##
======================================
  Coverage    63.2%   63.3%           
======================================
  Files         152     152           
  Lines       11330   11339    +9     
======================================
+ Hits         7168    7179   +11     
+ Misses       4162    4160    -2     
Impacted Files Coverage Δ
labgrid/driver/ubootdriver.py 61.4% <100.0%> (+4.1%) ⬆️
labgrid/resource/udev.py 50.6% <0.0%> (-0.3%) ⬇️
labgrid/resource/remote.py 82.5% <0.0%> (+0.1%) ⬆️
labgrid/pytestplugin/reporter.py 87.0% <0.0%> (+0.7%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Comment on lines 209 to 211
@step(args=['cmd'])
def boot(self, cmd: str = ""):
"""Boot the default if cmd is empty or a specific boot cmd otherwise.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The LinuxBootProtocol defines this parameter as cmd: https://github.com/labgrid-project/labgrid/blob/master/labgrid/protocol/linuxbootprotocol.py#L6

We could have a dict in the UBootDriver configuration which defines commands for each boot "entry". What do you think? @jremmet @Emantor

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea. I would be configurable, and we can check if exists. Guess self.boot_commandshould continue to work and the default for name = "" ? @jluebbe

Copy link
Member

@jluebbe jluebbe Feb 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Perhaps something like:

boot_commands:
  a: "run boot_slot_a"
  b: "run boot_slot_b"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way, you could also reuse test cases and Strategies easier with different boards.

uboot doesn't have pre defined boot sources. The "boot" command takes no
parameters.
Add self.boot_commands to hold different boot_command by name.
They can be used with LinuxBootProtocol boot(name)

Signed-off-by: Jan Remmet <j.remmet@phytec.de>
Test if cmd parameter is send to console or the default if no cmd is
given.
Fix names while on it.

Signed-off-by: Jan Remmet <j.remmet@phytec.de>
@Emantor Emantor changed the title Wip/uboot boot U-Boot boot commands Support Feb 23, 2023
@Emantor Emantor merged commit 3adfbaf into labgrid-project:master Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants