Ensure qmk flash
rejects invalid files for uf2 compatible bootloaders (#24802)
Ensure 'qmk flash' rejects invalid files for uf2 compatible bootloaders
This commit is contained in:
parent
9332439d5c
commit
f9430e530b
1 changed files with 6 additions and 1 deletions
|
@ -202,6 +202,10 @@ def _flash_mdloader(file):
|
||||||
|
|
||||||
|
|
||||||
def _flash_uf2(file):
|
def _flash_uf2(file):
|
||||||
|
output = cli.run(['util/uf2conv.py', '--info', file]).stdout
|
||||||
|
if 'UF2 File' not in output:
|
||||||
|
return True
|
||||||
|
|
||||||
cli.run(['util/uf2conv.py', '--deploy', file], capture_output=False)
|
cli.run(['util/uf2conv.py', '--deploy', file], capture_output=False)
|
||||||
|
|
||||||
|
|
||||||
|
@ -235,7 +239,8 @@ def flasher(mcu, file):
|
||||||
elif bl == 'md-boot':
|
elif bl == 'md-boot':
|
||||||
_flash_mdloader(file)
|
_flash_mdloader(file)
|
||||||
elif bl == '_uf2_compatible_':
|
elif bl == '_uf2_compatible_':
|
||||||
_flash_uf2(file)
|
if _flash_uf2(file):
|
||||||
|
return (True, "Flashing only supports uf2 format files.")
|
||||||
else:
|
else:
|
||||||
return (True, "Known bootloader found but flashing not currently supported!")
|
return (True, "Known bootloader found but flashing not currently supported!")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue