hypriot / flash

Command line script to flash SD card images of any kind
MIT License
1.01k stars 173 forks source link

May be good to check /sys/block/XXX/removable #90

Closed martingkelly closed 5 years ago

martingkelly commented 8 years ago

This isn't a bug, but it is a suggestion that I think would be helpful.

One safety check that could be added to this script is to enumerate only devices that show as removable so that system disks and similar are not even suggested as options for flashing. This can be done on Linux by reading the file /sys/block/XXX/removable, where XXX is your device name (e.g. sda).

ghost commented 6 years ago

Or mayde it's even better to read /sys/block/ directory before and after when user plugs the removable media to get the exact name of device.

StefanScherer commented 5 years ago

Closing due to inactivity. If someone wants to come up with a PR I'm happy to merge. I don't use flash on Linux so PR's should come from the community