jacobrosenthal / hf2-rs

Microsoft HF2 HID Flashing Format for UF2 Bootloaders
49 stars 14 forks source link

Add an option for a shell command to run before invoking cargo #37

Closed rtsuk closed 3 years ago

rtsuk commented 3 years ago

As a Mac user of cargo hf2 with an Adafruit Feather M4, I find the endless chiding about not properly ejecting the FEATHERBOOT volume distressing.

What do folks think about adding an option to cargo hf2 to execute a command before invoking cargo? I could use that command to safely eject FEATHERBOOT.

I'd be happy to create a PR for this feature if the idea seems good.

jacobrosenthal commented 3 years ago

What is the command. Just an unmount? I sort of agree I get annoyed by the list of pop up notifications, but Im not sure distressing is the right word nor that its really a problem. Every other mass storage bootloader thing does that.

You CAN actually swap the bootloader firmware on the device to disable the mass storage entirely since you're not using it. https://github.com/adafruit/uf2-samdx1/blob/master/inc/uf2.h#L61

Another option for yourself would be something like maybe cargo xtask. Its a rust native make like tool, you can run multiple commands with one command so youd do like cargo xtask hf2 or something

jacobrosenthal commented 3 years ago

You can probably also tell mac not to auto mount that volume ever. One of these links might do it https://www.google.com/search?q=macosx+disable+auto+mounting&ei=Q298YOruHYGd-gSNxoiICg&oq=macosx+disable+auto+mounting&gs_lcp=Cgdnd3Mtd2l6EAMyBQgAEM0CMgUIABDNAjIFCAAQzQI6BwgAEEcQsANQwNADWKXVA2Co1gNoA3ACeACAAXeIAe4GkgEDMS43mAEAoAEBqgEHZ3dzLXdpesgBCMABAQ&sclient=gws-wiz&ved=0ahUKEwiqnP7Fq4jwAhWBjp4KHQ0jAqEQ4dUDCA4&uact=5

rtsuk commented 3 years ago

Well, distressing might have just been me exaggerating for effect.

I ended up implementing it, since it was easy enough, but your other suggestions are welcome, thanks!

jacobrosenthal commented 3 years ago

Happy to hear more feedback from more users in future as well. Thanks for the issue