Repository navigation
snagflash: dfu: support partition names - #107
Conversation
Currently the partitions used by snagflash DFU have to be the numeric altsettings, let's allow the names defined in u-boot to be used too. Eg if u-boot is configured with dfu_alt_info "mmc 0=fsbl raw 0 1000 mmcpart 1;ssbl part 0 1" writing to the ssbl currently requires the snagflash option -D 1:binaries/u-boot.img with this patch the following is also accepted -D ssbl:u-boot.img
rgantois
left a comment
There was a problem hiding this comment.
Thanks a lot! I've added a few comments.
|
|
||
| **Note:** If you want a static block device path, you can use the following udev | ||
| rules to create symlinks when a certain VID:PID pair is detected: | ||
| rules to create symlinks when a certain VID:PID pair is detected: |
|
Hi Romain,
Thanks for the quick review
On Fri, 2 Oct 2026 at 11:56, Romain Gantois ***@***.***> wrote:
@rgantois requested changes on this pull request.
Thanks a lot! I've added a few comments.
________________________________
In docs/snagflash.md:
> @@ -166,7 +166,7 @@ snagflash -P ums -s binaries/u-boot.stm32 -d /mnt/u-boot.stm32
```
**Note:** If you want a static block device path, you can use the following udev
-rules to create symlinks when a certain VID:PID pair is detected:
+rules to create symlinks when a certain VID:PID pair is detected:
stray whitespace
________________________________
It's the reverse. There was previously stray whitespace and my patch
removed it (because of my editor settings to automatically do that).
Is that a problem?
Regarding this statement in the commit log:
Note: if the name starts with a number it will still be interpreted as
a numeric alt setting.
This doesn't seem to be the case? int(partname) will throw a ValueError if partname has letters in it. And search_partid() will not match on the numerical altsetting.
Nevertheless, I'm okay with how the code currently works as I don't want incorrect partname arguments to be interpreted in a lossy way, but I'm just confused about the commit log note.
Yes you are right of course. I must of been thinking in C with atoi()
not python when I wrote that comment.
|
Ah yes indeed, then no it's not a problem! |
de065f4 to
511409c
Compare
|
Thanks! |
Currently the partitions used by snagflash DFU have to be the numeric altsettings, let's allow the names defined in u-boot to be used too.
Eg if u-boot is configured with
dfu_alt_info "mmc 0=fsbl raw 0 1000 mmcpart 1;ssbl part 0 1"
writing to the ssbl currently requires the snagflash option
-D 1:binaries/u-boot.img
with this patch the following is also accepted
-D ssbl:u-boot.img
Note: if the name starts with a number it will still be interpreted as a numeric alt setting.