Skip to content

Support extra files in UUUDriver, and pass usb device path #1632

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

hundeboll
Copy link
Contributor

Teach the UUUDriver to syncrhonize extra files to the exporter before invoking uuu. This is useful the the "image" passed to uuu is a script file that references such extra files. In our case, we load the u-boot image twice (first SPL, then U-Boot proper). After U-Boot starts, we load a fitimage using uuu's fastboot support.

While working with UUUDriver, we might as well tell it what USB device path to operate, so we can attach multiple targets to a single exporter. Also, avoid messing up the pytest output by add -v to the uuu command.

This is tested using with and without a coordinator.

Checklist

  • Documentation for the feature
  • Tests for the feature
  • The arguments and description in doc/configuration.rst have been updated
  • Add a section on how to use the feature to doc/usage.rst
  • Add a section on how to use the feature to doc/development.rst
  • PR has been tested
  • Man pages have been regenerated

When using a non-builtin ``uuu`` script as image for the ``UUUDriver``,
that script can reference files relative to script file itself. To
support that case, the ``UUUDriver`` is expandend to take a list of
files to synchronize to the remote exporter before invoking ``uuu``.

However, the ``ManagedFile`` helper places the files in a per-file
directory based on the hash of the file being synchronized (when using
``rsync`` instead of ``nfs``). This breaks the files-relative-to-uuu-
script use case, so use a combined hash of all the configured files
instead.

Signed-off-by: Martin Hundebøll <martin@geanix.com>
The `uuu` tool messes up the terminal output when it detects a pty as
stdout, which makes reading the pytest output difficult. Disable the
pty-detection by passing `-v` to `uuu`.

The extra output from verbose mode isn't that much, so no harm should
be expected.

Signed-off-by: Martin Hundebøll <martin@geanix.com>
Avoid races/colisions when multiple targets are connected to the same
exporter by telling `uuu` which usb device path to use.

Signed-off-by: Martin Hundebøll <martin@geanix.com>
@hundeboll
Copy link
Contributor Author

Hmm... I see now that two of my commits duplicate this (not so much) older PR:
#1587

I'm happy to rebase mine, should you merge the other one.

@jremmet
Copy link
Contributor

jremmet commented Mar 11, 2025

We run into the same issue using snagrecover. Here we need multiple files with descripting names. This doesn't fit into the BootstrapProtocol.
Maybe we can add multi file support there? We would prefer a dict as input to be able to use the key as name of the file to be used in snagrecover

@hundeboll
Copy link
Contributor Author

We run into the same issue using snagrecover. Here we need multiple files with descripting names. This doesn't fit into the BootstrapProtocol. Maybe we can add multi file support there? We would prefer a dict as input to be able to use the key as name of the file to be used in snagrecover

Hmm.. As far as I can tell, protocols cannot specify functionality like that.

Instead, we can add a ManagedFiles util, that can synchronize multiple files to a single folder. That util can then take either a simple list of sources to transfer, or a dictionary of src: dst pairs to transfer instead?

@jremmet
Copy link
Contributor

jremmet commented Mar 11, 2025

It think the interface load with a single files as parameter is not sufficient for this use cases.
Also in your case, you can only use the extra_files from the config. You can't call load with the extra files as parameter.
Not sure if others see the need of this too.

@hundeboll
Copy link
Contributor Author

It think the interface load with a single files as parameter is not sufficient for this use cases.
Also in your case, you can only use the extra_files from the config. You can't call load with the extra files as parameter.
Not sure if others see the need of this too.

I see. Yeah, we can expand the load() method in the protocol to take an optional dictionay of extra files as you suggest. That parameter can then take precedence over any configured extra files...

But we need the labgrid maintainers to weigh in here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants