Loading Kernel Modules from Balena OS

Hi,
(1) We are working on jetson-xavier-nx-devkit and we have written a simple kernel module for add-on audio-card attached to nx-devkit. We used this example as reference for building/loading the kernel module.
(2) The module can build fine. Problem we are facing is that it does not get loaded automatically when the device boots up.
(3) We have created a simple script which is supposed to load the module. We run this script from our Dockerfile.
- the script has “insmod path_to_module/our_module.ko”
- Dockerfile has “CMD ./load_module.sh”.
(4) We have cross-checked that script exists in the work directory, and our_module.ko exists in the path_to_module directory. All paths/files look correct. However, if we ssh in to the device and run lsmod, we can’t find our custom module. dmesg does not show any messages from our kernel module, or any attempt to load our kernel module.
(5) Running “insmod path_to_module/our_module.ko” from “working directory” on ssh shell fixes this issue. Or alternatively, we can just run the script “./load_module.sh” from working direcotry in “ssh shell”. This again points towards the script and module being ok as such.

Any idea what could be going wrong and how we can fix this?

Hi, this issue is resolved. The “CMD ./load_module.sh” was not getting executed as we had another “command: [something]” directive in our docker-compose.yml. The drive loads and works fine now. Thanks for your time and support

Glad to hear the issue is resolved, let us know if you run into any additional problems.