Skip to content

Commit b66689a

Browse files
committed
ridesx: improve error for ridesx flashing
Signed-off-by: Benny Zlotnik <[email protected]>
1 parent b05be84 commit b66689a

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

packages/jumpstarter-driver-ridesx/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Both drivers require:
104104

105105
```{testcode}
106106
# Flash a single partition
107-
ridesx_client.flash("/path/to/boot.img", partition="boot")
107+
ridesx_client.flash("/path/to/boot.img", target="boot")
108108
```
109109

110110
### Flash Multiple Partitions
@@ -125,7 +125,7 @@ The driver automatically handles compressed images (`.gz`, `.gzip`, `.xz`):
125125

126126
```{testcode}
127127
# Flash compressed images - decompression is automatic
128-
ridesx_client.flash("/path/to/boot.img.gz", partition="boot")
128+
ridesx_client.flash("/path/to/boot.img.gz", target="boot")
129129
```
130130

131131
### Power Control

packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/client.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,22 @@ def flash(
8181
self,
8282
path: str | Dict[str, str],
8383
*,
84-
partition: str | None = None,
84+
target: str | None = None,
8585
operator: Operator | Dict[str, Operator] | None = None,
8686
compression=None,
8787
):
8888
if isinstance(path, dict):
8989
partitions = path
9090
operators = operator if isinstance(operator, dict) else None
9191
else:
92-
if partition is None:
93-
raise ValueError("'partition' must be provided")
94-
partitions = {partition: path}
95-
operators = {partition: operator} if isinstance(operator, Operator) else None
92+
if target is None:
93+
raise ValueError(
94+
"This driver requires a target partition.\n"
95+
"Usage: j storage flash --target <partition>:<file>\n"
96+
"Example: j storage flash -t boot_a:aboot.img -t system_a:rootfs.simg -t system_b:qm_var.simg"
97+
)
98+
partitions = {target: path}
99+
operators = {target: operator} if isinstance(operator, Operator) else None
96100

97101
for partition_name, file_path in partitions.items():
98102
if not file_path or not file_path.strip():

0 commit comments

Comments
 (0)