[File] [PATCH] UF2 support

Christos Zoulas christos at zoulas.com
Sun Apr 25 17:48:50 UTC 2021


Hi,

> On Apr 25, 2021, at 1:30 PM, Blake Ramsdell <blaker at gmail.com> wrote:
> 
> In my example below, I'd like them to take ownership of the
> uf2families.json file. Then we can jq our way to success.
> 
> ➜  file git:(bcr-uf2) ✗ cat uf2families.json
> [
>    { "id": "0x68ed2b88", "description": "Microchip (Atmel) SAMD21" },
>    { "id": "0x1851780a", "description": "Microchip (Atmel) SAML21" },
>    { "id": "0x55114460", "description": "Microchip (Atmel) SAMD51" }
> ]
> ➜  file git:(bcr-uf2) ✗ jq -r '.[] | ">>28 lelong
> \(.id)\t\(.description)"' uf2families.json
>>> 28 lelong 0x68ed2b88  Microchip (Atmel) SAMD21
>>> 28 lelong 0x1851780a  Microchip (Atmel) SAML21
>>> 28 lelong 0x55114460  Microchip (Atmel) SAMD51
> ➜  file git:(bcr-uf2) ✗
> 

Yup, that would be great. I just put this as a comment in the
magic file.

> Thank you for maintaining!
> 
> Also, you note that I skipped the checking of the two magic numbers.
> You got a philosophy about that? It's probably safer than just the uf2
> string check, but probably overkill, and I note you didn't add it back
> in.

In general checking more is better :-) In this case I left it as is for now,
because files starting with uf2\n are not common.

Best,

christos

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP
URL: <https://mailman.astron.com/pipermail/file/attachments/20210425/7e539da8/attachment.asc>


More information about the File mailing list