I am currently working on snapping my application and found some great help here thanks to @kyrofa on the app side of my application.
Now, i need to build drivers from source that uses kernel modules.
I am using pc-kernel which is the kernel 4.4 with core16.
Building a driver can be achieved easily on an Ubuntu 16.04 that has the kernel modules.
Now, i dont want to build my snaps on this system, i want all my team to be able to build snaps with snapcore/snapcraft docker image.
On a docker container, i dont have my kernel modules.
Here is my approach on this problem:
- I think that i need to use a gadget snap in order to install my drivers and then be able to use interfaces to do some slots. I have done that and it works when i am snapcrafting on Ubuntu 16.04.
- Using such a gadget snap on my docker container, i think that i need to dump the kernel modules on my stage dir and then make my driver use those in order to build the correct version.
Do you think this is the good approach ?
Here is an example:
cp -r ./Drivers/Linux /usr/src/PlxSdk
Here, builddriver build with the current system kernel modules. I know that i can change builddriver to use the right version of the kernel and $SNAPCRAFT_STAGE.
If this is the good approach, where to find the modules ? Should i use plugin dump and stage the modules ?
Or maybe i’ll need to work on the kernel snap part (which i want to avoid).
Thanks by advance.