Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detect_pinmap hard codes /proc/device-tree/model causing docker issues #154

Open
masahji opened this issue Nov 24, 2021 · 0 comments · May be fixed by #155, MarkvanderPol/node-rpio#1 or #181
Open

detect_pinmap hard codes /proc/device-tree/model causing docker issues #154

masahji opened this issue Nov 24, 2021 · 0 comments · May be fixed by #155, MarkvanderPol/node-rpio#1 or #181

Comments

@masahji
Copy link

masahji commented Nov 24, 2021

detect_pinmap hard codes /proc/device-tree/model causing non-privileged docker containers to fail hardware autodetect. This is a common issue that is being worked around by either A) making the container privileged B) Or wait for the container to come up then perform some kind of just in time post start remount. Both solutions are not ideal.

There was another issue that partially resolved the problem but did not address the hardware autodetect failure.
See Here

On a container, /proc/device-tree is actually a symbolic link to /sys/firmware/devicetree/base, but /sys/firmware doesn't exist at all. Simply mounting /sys/firmware/devicetree/base as a volume does not appear to work.

However, you CAN mount /sys/firmware to another path while non privileged. Like so:

    volumes:
      - type: bind
        source: /sys/firmware
        target: /psys/firmware

/psys is just a made up path. So a simple solution might be to not hard code /proc/device-tree/model and allow it to be changed from gpio.init. like this:

gpio.init({
    devicetree: '/psys/firmware/devicetree/base/model',
})
masahji added a commit to masahji/node-rpio that referenced this issue Nov 24, 2021
…#154 rather than assume /proc/device-tree/model

This allows non privileged docker containers to specify a different path for the model file since it can't use /proc/device-tree/model
masahji added a commit to masahji/node-rpio that referenced this issue Nov 24, 2021
…#154 rather than assume /proc/device-tree/model

This allows non privileged docker containers to specify a different path for the model file since it can't use /proc/device-tree/model
MarkvanderPol pushed a commit to MarkvanderPol/node-rpio that referenced this issue Apr 5, 2024
…#154 rather than assume /proc/device-tree/model

This allows non privileged docker containers to specify a different path for the model file since it can't use /proc/device-tree/model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant