I have some strange issues with the “io.balena.features.kernel-modules=1” flag. After adding it to my docker-compose.yml the service won’t start and I don’t know what’s the issue. I added the flag as per this comment Modprobe error when trying to enable i2c on rpi - #6 by CameronDiver in order to solve the modprobe
error.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/5.10.83-v8/modules.dep.bin'
modprobe: FATAL: Module i2c-dev not found in directory /lib/modules/5.10.83-v8
I’ve logged to host OS
via ssh
and tried to run balena logs <container-id>
but the logs are empty.
Running balena events
also didn’t help. It shows that service tries to start and then that it stops + some mount volume info. However, I can’t find out what’s the exact issue. Does any one have any pointers about how to solve this issue?
Here’s my docker-compose:
version: '2.1'
services:
test-service:
build:
context: ./docker/test
dockerfile: Dockerfile.template
image: test-service
pid: 'host'
container_name: test-service
ports:
- '5000:5000'
restart: 'on-failure'
privileged: true
command: modprobe i2c-dev && python3 test
# command: /bin/sh -c 'if [ "$TEST_ENABLED" = "True" ]; then python3 test; fi'
volumes:
- data:/app/data
# labels:
# io.balena.features.kernel-modules: '1'
volumes:
data:
Another question. Any idea why the
command: /bin/sh -c 'if [ "$TEST_ENABLED" = "True" ]; then python3 test; fi'
doesn’t work? The var. is properly set (via balena env add
) inside the container. Connecting to the service via ssh
and running printenv
I can see that TEST_ENABLED=True
Context:
Device: RPi 4
OS: balenaOS 2.94.4
Supervisor: 12.11.36