[riot-notifications] [RIOT-OS/RIOT] makefiles/docker: add flash and term in docker (#11220)

Francisco notifications at github.com
Wed Mar 20 14:14:17 CET 2019

The RIOT community cares a lot about code quality.
Therefore, before describing what your contribution is about, we would like
you to make sure that your modifications are compliant with the RIOT
coding conventions, see https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions.

### Contribution description

Put here the description of your contribution:
- describe which part(s) of RIOT is (are) involved
- if it's a bug fix, describe the bug that it solves and how it is solved
- you can also give more information to reviewers about how to test your changes

This PR allows user to use make term and make flash from within the docker container.

The only problem is I haven't found a way to flash the device without giving --privileged flag when executing the docker container.

When only using term the --privileged flag won't be added and only the specific PORT will me mapped as a device to the docker container.


- only use docker to build, flash and term
- option to use term can be added on its own


- still need to take care of udev rules or run as sudo
- option to the use term not very interesting without flash
- "--privileged" flags passed when flashing
- need to update riot/riotbuild image
- not sure if it would work in mac or windows

How do you fill about the pros/cons balance? 

I think **properly documented** this can still be useful as an option for developing using RIOT, it barely changes the Image size and largely extends usability.

### Testing procedure


- riot/riotbuild is not update with https://github.com/RIOT-OS/riotdocker where python dependencies have been added to the docker image. To test this properly you will need to build the image locally, to lets say riotbuild, and provided the DOCKER_IMAGE parameter.
- udev rules must be set in the host for popper access to the device, otherwise everything must be done using sudo.
   - for samr21-xpro:
`echo 'KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="plugdev"' \
    | sudo tee -a /etc/udev/rules.d/99-usb.rules`
- works with openocd using https://github.com/RIOT-OS/riotdocker/pull/69 as an image

To enable term and flash, ALL_IN_DOCKER=1 must be set

make term:
DOCKER_IMAGE=riotbuild ALL_IN_DOCKER=1 make -C examples/hello-world/ BOARD=samr21-xpro term`

make flash:
DOCKER_IMAGE=riotbuild ALL_IN_DOCKER=1 make -C examples/hello-world/ BOARD=samr21-xpro term`

### Issues/PRs references

In riotdocker: https://github.com/RIOT-OS/riotdocker/pull/69
You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * makefiles/docker: add flash and term in docker

-- File Changes --

    M Makefile.include (16)
    M makefiles/docker.inc.mk (21)

-- Patch Links --


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190320/1f68f432/attachment-0001.html>

More information about the notifications mailing list