labgrid
labgrid copied to clipboard
remote/client: implement udisks2-using write-files command
Description
Adds a write-files client command to copy files onto mass storage. This is useful for bootloader development for processors with bootroms that load code from file systems (e.g. EFI system partition, OMAP, AT91, Zynq, Raspberry ... etc.). The user interface tries to reproduce the semantics of the UNIX cp command as much as possible.
As of now, we can only copy individual files, but not recursively on directories; in the future we might want to extend the ManagedFile class to support this use case as well.
This is mostly based on @sephalon's #548, with some sprinkles of my #820, but with udisksctl instead of pmount.
How to test
labgrid-client write-files a b # writes files a, b into /mnt/
labgrid-client write-files -t a b c # writes files b, c into /mnt/a/
labgrid-client write-files -T a b # writes file b to /mnt/a
Checklist
- [x] Documentation for the feature
- [ ] Tests for the feature
- [x]
The arguments and description indoc/configuration.rst have been updated - [x] CHANGES.rst has been updated
- [x] PR has been tested
- [x] Man pages have been regenerated
Codecov Report
Attention: Patch coverage is 16.56051% with 131 lines in your changes are missing coverage. Please review.
Project coverage is 62.2%. Comparing base (
6c8c6e5) to head (a712ee2).
| Files | Patch % | Lines |
|---|---|---|
| labgrid/util/agents/udisks2.py | 0.0% | 70 Missing :warning: |
| labgrid/driver/usbstoragedriver.py | 24.5% | 43 Missing :warning: |
| labgrid/remote/client.py | 40.0% | 18 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #1219 +/- ##
========================================
- Coverage 62.7% 62.2% -0.6%
========================================
Files 163 164 +1
Lines 12051 12191 +140
========================================
+ Hits 7560 7584 +24
- Misses 4491 4607 +116
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hi Ahmad, the idea for the feature looks great, however we would very much prefer a solution which uses the udisks2 DBus API with the agent interface. The regex may not work across versions and the DBus interface should be much more stable.
The case-insensitive regexes are only used for error recovery and if they don't match, they would just bubble up the error. The only hard requirement is the Mounted %s at %s message. But yes, using udiskctl in scripts is inferior to pmount. I have reworked the PR to do DBus in an agent. Looking forward to your feedback.
Rebased on latest master and added a few fixups. With those applied, I'm all for finally merging this PR.
@a3f @sephalon Are those fixups okay with you?
Thanks, @Bastian-Krause! Changes look ok to me.
Fixups squashed.