Skip to content

Commit 8503839

Browse files
JPEWdevEmantor
authored andcommitted
remote/client: Add add mode argument to write-image
Adds a --mode argument to the `write-image` sub command so that users may choose between the bmaptool and dd copy modes Signed-off-by: Joshua Watt <[email protected]>
1 parent c938408 commit 8503839

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGES.rst

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ New Features in 0.3.0
6363
resources.
6464
- PyVISA support added, allowing to use PyVISA controlled test equipment from
6565
Labgrid.
66+
- ``labgrid-client write-image`` gained a new argument ``--mode`` to specify
67+
which tool should be used to write the image (either ``dd`` or ``bmaptool``)
6668

6769
Breaking changes in 0.3.0
6870
~~~~~~~~~~~~~~~~~~~~~~~~~

labgrid/remote/client.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from .. import Target, target_factory
2626
from ..util.proxy import proxymanager
2727
from ..util.helper import processwrapper
28+
from ..driver import Mode
2829

2930
txaio.use_asyncio()
3031
txaio.config.loop = asyncio.get_event_loop()
@@ -1150,7 +1151,7 @@ def write_image(self):
11501151
target.activate(drv)
11511152
try:
11521153
drv.write_image(self.args.filename, partition=self.args.partition, skip=self.args.skip,
1153-
seek=self.args.seek)
1154+
seek=self.args.seek, mode=self.args.write_mode)
11541155
except subprocess.CalledProcessError as e:
11551156
raise UserError("could not write image to network usb storage: {}".format(e))
11561157
except FileNotFoundError as e:
@@ -1544,6 +1545,9 @@ def main():
15441545
help="skip n 512-sized blocks at start of input")
15451546
subparser.add_argument('--seek', type=int, default=0,
15461547
help="skip n 512-sized blocks at start of output")
1548+
subparser.add_argument('--mode', dest='write_mode',
1549+
type=Mode, choices=Mode, default=Mode.DD,
1550+
help="Choose tool for writing images (default: %(default)s)")
15471551
subparser.add_argument('filename', help='filename to boot on the target')
15481552
subparser.set_defaults(func=ClientSession.write_image)
15491553

0 commit comments

Comments
 (0)