Browse Source

readme: added evil workaround to enable access to /sys/firmware/devicetree (required by Adafruit-DHT)

Fabian Peter Hammerle 5 years ago
parent
commit
43d9a69a5f
1 changed files with 17 additions and 0 deletions
  1. 17 0
      README.md

+ 17 - 0
README.md

@@ -29,3 +29,20 @@ ACTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea6
 # check permissions of /dev/zwave-dongle
 $ sudo docker run --device /dev/zwave-dongle:/dev/zwave-dongle …
 ```
+
+## mount `/proc/device-tree`
+
+required by `Adafruit-DHT`:
+https://github.com/adafruit/Adafruit_Python_DHT/blob/a609d7dcfb2b8208b88498c54a5c099e55159636/source/Raspberry_Pi_2/pi_2_mmio.c#L43
+
+`/proc/device-tree` is a symlink to `/sys/firmware/devicetree/base`.
+
+However, `docker run -v /sys/firmware/devicetree/base:/sys/firmware/devicetree/base:ro …` is ineffective.
+
+Evil workaround:
+```sh
+# start container without explicitly mounting devicetree
+$ sudo docker run --name home_assistant …
+# umount shadowing tmpfs
+$ sudo nsenter --target $(sudo docker inspect --format={{.State.Pid}} home_assistant) --mount umount /sys/firmware
+```