Add Block Device Support
Adds support for using ls, mkdir, cp (including between host and device), rm, and cat commands, with LittleFS (used by MicroPython) or FatFS filesystem support.
Works with block devices specified in the binary info, and with partitions. It autodetects the file system if --filesystem is not specified, and also supports formatting the block device if required with the -f argument.
This fixes #58
A thought I just had - to make this slightly easier to use, could you have picotool check what filename it was invoked with (e.g. like busybox does), and then you could have picotool_ls, picotool_cat, etc. symlinks to the picotool binary, and then calling picotool_ls somedir would do the same thing as picotool bdev ls somedir ? (Or if that's not possible, perhaps the picotool CMake install could add a bunch of shell scripts e.g. named picotool_ls which just does picotool bdev ls $@)
A thought I just had - to make this slightly easier to use, could you have
picotoolcheck what filename it was invoked with (e.g. likebusyboxdoes), and then you could havepicotool_ls,picotool_cat, etc. symlinks to thepicotoolbinary, and then callingpicotool_ls somedirwould do the same thing aspicotool bdev ls somedir? (Or if that's not possible, perhaps the picotool CMake install could add a bunch of shell scripts e.g. namedpicotool_lswhich just doespicotool bdev ls $@)
I think that might be best left to the user to do, to avoid polluting their shell (eg you might want picotool_ls to list devices, not use the bdev command) - you could also create an alias to picotool bdev in bashrc (which also avoids the need for underscores and therefore the shift key), so I don’t think I’ll include that is this PR