[riot-notifications] [RIOT-OS/RIOT] calliope-mini: flash script not very cleanly written (#11404)

Martine Lenders notifications at github.com
Tue Apr 16 12:15:28 CEST 2019


While testing #11395, I noticed that the [flash script for the calliope mini](https://github.com/RIOT-OS/RIOT/blob/master/boards/calliope-mini/dist/flash.sh) isn't that well written. It makes some assumptions that just aren't given or expects given configuration that isn't documented anywhere:

- It assumes that Linux always auto-mounts at `/media/${USER}` which it doesn't (e.g. in Arch it is `/run/media/${USER}`)
  https://github.com/RIOT-OS/RIOT/blob/5e789c659584534ffb2e7eb9c86a56a9f6127dcf/boards/calliope-mini/dist/flash.sh#L24-L26
- Appearently it assumes that the storage device of the calliope mini is configured in the `fstab` and can somehow be mounted this way without root. Otherwise I can't explain https://github.com/RIOT-OS/RIOT/blob/5e789c659584534ffb2e7eb9c86a56a9f6127dcf/boards/calliope-mini/dist/flash.sh#L42 to myself.
- It exits on 0 in its error states, so make returns success even if flashing failed.

Sadly, after a short while of trying to fix it I had to give up, since I'm short on time, but I suggest instead of trying to infer the device somehow from the mount-point to use tools like [`lsblk`](https://linux.die.net/man/8/lsblk) (on Linux) and [`diskutil`](https://www.unix.com/man-page/All/8/diskutil) (on OSX) to determine the device name from the `MINI` label (maybe even confirm the USB-ID) and mount the device using `udiskctl` [[1]] [[2]] if it is available to mount it (don't know the equivalent on OSX though).

[1]: https://wiki.ubuntuusers.de/DeviceKit/
[2]: https://wiki.archlinux.org/index.php/Udisks 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/11404
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190416/4225bb2f/attachment.html>


More information about the notifications mailing list