Auto-detect device from device tree#422
Conversation
Attempt to auto-detect the device by reading the device tree compatibility from the kernel. If this information is unavailable or the values are unknown, gracefully fall back to the current approach (using environment variables). I've only included the Clara HD for now: I don't have access to other devices in order to figure out which values they return, but I've left a clear place where they can be added progressively by others.
|
I have a kobo libra colour, how can I help? [root@kobo ~]# cat /proc/device-tree/compatible
mediatek,mt8110mediatek,mt8512
[root@kobo ~]# cat /sys/firmware/devicetree/base/compatible
mediatek,mt8110mediatek,mt8512 |
|
That's a bit of a generic description for the device. I wonder if mapping that to |
|
I guess there is only really 1 way to find out, and just keep crowd sourcing the values. Can also add code to log it at start up, if it's an unknown value, and have docs for interested users to report the value. Or they can unconsciously report it when sharing logs for an unrelated bug report. Since some early boot process is setting these values for Nickel, there might be way to reverse engineer how the env variable is set, and that might confirm if these are unique or not. Or what is actually used to populate these env vars. |
Attempt to auto-detect the device by reading the device tree compatibility from the kernel. If this information is unavailable or the values are unknown, gracefully fall back to the current approach (using environment variables).
I've only included the Clara HD for now: I don't have access to other devices in order to figure out which values they return, but I've left a clear place where they can be added progressively by others.