Custom ResinOS and OS update


#1

Use case:

Custom ResinOS (https://github.com/resin-os/resin-intel) with additional kernel parameters is created. This is compiled, config injected and installed on one-to-many devices.

Changes to git repo (https://github.com/resin-os/resin-intel) will produces a new custom ResinOS.

Question:

How can custom ResinOS be updated when a new custom ResinOS is available?

The dashboard supports this for Resin provided ResinOS images, but does not seem to be supported for custom ResinOS images. How can this be performed?


Application name for custom ResinOS and Dashboard
Application name for custom ResinOS and Dashboard
Application name for custom ResinOS and Dashboard
Application name for custom ResinOS and Dashboard
#3

Hi @aliasbits – I’m afraid we don’t support custom build OS updates through resin.io.

If the goal is to include kernel modules that are not included in our kernel build, you could use the stock image and add kernel modules using https://github.com/resin-io-playground/kernel-module-build

Hope that helps!


#4

Hi Chris

The goal is to include support for CAN bus which requires CONFIG_CAN in the kernel and can-utils. If the CAN support comes from kernel or from a loaded kernel modules does not matter.

From what I can read, the https://github.com/resin-io-playground/kernel-module-build build system will allow me to build a kernel module. This then needs to be included in a docker images and ensure that the docker image is run’ed --privileged.

Is that correctly understood?


#5

@aliasbits that is correct – a lot of the magic in this case happens in the https://github.com/resin-io-playground/kernel-module-build/blob/master/build.sh file

You could clone that, copy over the source for the CAN bus module, install the developer tools to have all compiler & make and so on, apt-get install can-utils, build the module from your Dockerfile.template, and finally modprobe the module from the bash script that starts your app – and you should be good to go!


#6

Sounds good. I will look into it.


#8

Hey @aliasbits

Here is our Dockerfile stage to compile a custom kernel module:

Change the module path in the kernel tree and you should be good to go.

Peter


#10

Hi Peter

That is pretty clever. I managed to compile kernel modules this morning, but I will for sure adapt this dockerfile to automate kernel module building into the application container.

Thanks


#11

Update:

I found that I was missing can.ko and can-raw.ko from net/can. I already got slcan from drivers/net/can

When adding these to the application image then the network is stopped by a kernel bug/panic. This kernel bug is reported for net/netlink/af_netlink.c:1315. The modules are still being compiled and runned on 2.13.1+rev1.dev resinOS image

Note: Target is unaccesable after kernel bug/panic. A re-installation is needed

From my understanding then CAN supported can only be available if can.ko (CONFIG_CAN) raw and can-raw.ko (CONFIG_CAN_RAW) are provided by the kernel and not being loaded by via kernel modules. Then it is up to resin users to compile what ever CAN driver they need. I my case slcan.

Anyone got an idea?


#12

Show the kernel issue:


#17

Hi everyone,

Just a quick update to let you know that CAN drivers are included in the latest resinOS 2.13.6 intel NUC release. Let us know if you have a chance to try the image out.


#19

Hi Lekkas

Initial tests show that these modules works as expected. The initial test uses can.ko, can-raw.ko and slcan.ko which is to be used in the final docker container. I will need to create a docker container which load and use these modules in order to be sure all works as expected.

One question:

Will the CAN resinOS provided kernel modules be available and persist in all future resinOS releases?


#22

Hi,

Yes, we plan to keep CAN kernel modules in future version of resinOS.


#25

The provided CAN kernel modules by resinOS is working as expected. Has been tested on a CAN network with 15+ CAN nodes.

To other users. Generally do not use custom ResinOS if possible if you want a resin upgradable and managed device from the Dashboard, supervisor api or python SDK.

Kernel builder docker file is still valid for custom kernel modules. For my use case the ch341 usb serial driver was needed. Custom build into the container and insmod used to load it from container.