Skip to content

Commit 3790824

Browse files
committed
labgrid/driver/usbloader: fix uuu command
The current implementation adds the cmd as last arg. There it is ignored by uuu tool. It runs in the default mode with just an image. For CPUs relying on a special build-in run scripts it must be added with -b before the file argument. Removed the broken cmd and add script as config option. This way currently working setups should work further. uuu help text (libuuu_1.4.43) uuu [-d -m -v -V] <bootloader|cmdlists|cmd> uuu [-d -m -v] -b[run] <emmc|emmc_all|fat_write|nand|qspi|sd|sd_all|spl> arg... spl boot spl and uboot arg0: _flash.bin Signed-off-by: Jan Remmet <j.remmet@phytec.de>
1 parent 5d3d571 commit 3790824

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

doc/configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2210,7 +2210,7 @@ Implements:
22102210
Arguments:
22112211
- image (str): optional, key in :ref:`images <labgrid-device-config-images>` containing the path
22122212
of an image to bootstrap onto the target
2213-
- cmd (str, default="spl"): single command used for mfgtool
2213+
- script (str): run built-in script with "uuu -b", called with image as arg0
22142214

22152215
USBStorageDriver
22162216
~~~~~~~~~~~~~~~~

labgrid/driver/usbloader.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class UUUDriver(Driver, BootstrapProtocol):
153153
}
154154

155155
image = attr.ib(default=None)
156-
cmd = attr.ib(default='spl', validator=attr.validators.instance_of(str))
156+
script = attr.ib(default='', validator=attr.validators.instance_of(str))
157157

158158
def __attrs_post_init__(self):
159159
super().__attrs_post_init__()
@@ -177,8 +177,10 @@ def load(self, filename=None):
177177
mf = ManagedFile(filename, self.loader)
178178
mf.sync_to_resource()
179179

180+
cmd = ['-b', self.script] if self.script else []
181+
180182
processwrapper.check_output(
181-
self.loader.command_prefix + [self.tool, mf.get_remote_path(), self.cmd]
183+
self.loader.command_prefix + [self.tool] + cmd + [mf.get_remote_path()]
182184
)
183185

184186

0 commit comments

Comments
 (0)