labgrid icon indicating copy to clipboard operation
labgrid copied to clipboard

Support extra files in UUUDriver, and pass usb device path

Open hundeboll opened this issue 1 year ago • 6 comments

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
  • [x] 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
  • [x] PR has been tested
  • [ ] Man pages have been regenerated

hundeboll avatar Mar 10 '25 15:03 hundeboll

Hmm... I see now that two of my commits duplicate this (not so much) older PR: https://github.com/labgrid-project/labgrid/pull/1587

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

hundeboll avatar Mar 10 '25 19:03 hundeboll

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

jremmet avatar Mar 11 '25 07:03 jremmet

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?

hundeboll avatar Mar 11 '25 07:03 hundeboll

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.

jremmet avatar Mar 11 '25 07:03 jremmet

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...

hundeboll avatar Mar 11 '25 07:03 hundeboll

It would be nice if the load() method was expanded. That way i could easily expand or make my own driver to use a bmap file together with a wic file for proper sparse flashing.

lauritsriple avatar Jun 23 '25 08:06 lauritsriple