Docker-based build helper tool

Because installing Arduino, all the Kaleidoscope libraries and whatnot can be a bit of a pain, so I created a Docker image that assists with that. You give it a sketch directory, and it will do the rest. It can also install third-party plugins, and even flash your newly built firmware!

Find it at:

6 Likes

The tool has seen significant improvements today, and it can even help you with flashing now. I’d be thrilled if some of you could take it for a spin, and see how well (or how bad) it works.

It is a bit short on documentation and error handling, both of those will eventually improve. There should be enough documentation in there to get started though.

2 Likes

I just tried this. First run was confusing, as it didn’t give any output about what was going on. I was expecting to see a manual page, as described under Usage. I realized after a while that it was running docker before showing the manual.

After that, I tried running one of the examples.

bin/builder -s https://github.com/keyboardio/Model01-Firmware.git

This resulted in:

cp: cannot create regular file './kaleidoscope-builder.conf': Permission denied
Compiled firmware available at /home/const/projects/Model01-Firmware/Kaleidoscope-Docker/output/1533148514/.

This ended up with a symbolic link that leads nowhere.

Thanks for working on this, I look forward to making it work, soon I hope :smile:

Oh btw, and I thought I didn’t have to write the -s option as the parent directory was Model01-Firmware in this case.

Oof, yes… I’ll add a message to the script that’ll let you know that it’s building an image under the hood.

I think I know why this happens too. Thanks for the report, will fix it soon!

The script is not clever enough to notice that yet, but this is certainly a feature I will implement, it’s convenient. Thanks for the idea!

I added :Z to all the bind volumes, and it seems to work now. Thanks!

This is for some SELinux stuff that is running on default on Fedora.

docker run -ti --rm                           \
       -v "${SKETCHDIR}:/src/firmware/sketch":Z \
       -v "${OUTPUT}:/src/firmware/output":Z    \
       -v "${CFGDIR}:/src/firmware/config":Z    \
       -v "${LIBDIR}:/src/firmware/lib":Z       \
       -e OWNER="$(id -u):$(id -g)"           \
       local/kaleidoscope-builder "$@" || true
1 Like

Tried the flasher:

bin/flasher Model01
When ready, hold down PROG, and press ENTER. Keep holding PROG until flashing starts...

avrdude: can't open config file "/home/jenkins/workspace/avrdude/label/debian7-x86_64/objdir/etc/avrdude.conf": No such file or directory
avrdude: error reading system wide configuration file "/home/jenkins/workspace/avrdude/label/debian7-x86_64/objdir/etc/avrdude.conf"

So far, I know AVRDUDE_CONF is probably used for this config file somehow, but I didn’t get it to work yet.

Hm, it probably works for me, because I have avrdude installed outside the container anyway, so it finds a config file. I suppose if I copy the config out, like the binary, that’ll work. I’ll push a fix in a bit.

1 Like

Solved it by modifying:

output/tools/avrdude -C /etc/avrdude/avrdude.conf -q -patmega32u4 -cavr109 -D -P "${LOADER_PORT}" -b57600 "-Uflash:w:${HEX}:i"

I have it installed too. It would probably best to not rely on it though. I am also using the Fedora Arduino package, so maybe the file is in a different place for me.

1 Like

Yeah, the idea was to copy the avrdude out of the container, and use it for flashing. I didn’t realize I need to copy the config file out, too. Just pushed an update that does that, and now it should work, and not rely on the host having avrdude installed at all.

Thanks a lot for trying the tool, debugging the issues, and for finding the solutions too! <3