This might be little bit more challenging. I believe that you should be able to compile it but it won’t run in lxc unless you pass through some interfaces to lxc. I had it solved once so I might dig out some email where I described how to do it but it definitely wasn’t nice.
Digest from my emails:
… If so, it’s not supported. Although it can be done in default it won’t work. LXC
containers are separated from real hardware. Turris GPIO Python library support
two ways of access. First one is direct memory mapping. If that fails, it tries to
use /sys/class/gpio. I am not sure what happens if you try to do memory map on
absolute address in LXC, but I suspect it won’t work. So only other way is to use
it by rebind mounting /sys/class/gpio to container.
…
As first thing you have to allow access to /dev/mem from LXC container. In all of
these examples I am going to use lxc container names ubuntu, so replace it with
your name.
You have to add line “lxc.cgroup.devices.allow = c 1:1 rwm” to
/srv/lxc/ubuntu/config.
Next restart your lxc container.
Then to install gpio library, you have to clone repository (master branch) and run
command: python3 setup.py install --board=Omnia
You wrote that you already did this, so I won’t elaborate further. Just small
note, if you forgot to specify board, then you have to remove build directory
before running it again.
As next step you have to create /dev/mem inside container. So I would suggest
adding it somewhere to init. Command is "mknod -m 660 /dev/mem c 1 1"
And that should be all. I ran some small tests and it works. So I hope it helps
you.