ODROID-XU4 not detected on kernels with Hardware field in /proc/cpuinfo
Description
The ODROID-XU4 is not detected by PlatformDetect on Armbian (and likely other non-Hardkernel images) because the compatible-string detection block is gated behind if hardware is None:, but the XU4 reports a Hardware field in /proc/cpuinfo.
Environment
- Board: ODROID-XU4
- OS: Armbian (Debian Bookworm, kernel 6.6.141-current-odroidxu4)
- Python: 3.13.5
- adafruit-platformdetect: 3.88.0
/proc/cpuinfo Hardware field
Hardware : Samsung Exynos (Flattened Device Tree)
/proc/device-tree/compatible
hardkernel,odroid-xu4
samsung,exynos5800
samsung,exynos5
Root cause
In chip.py, the block that checks /proc/device-tree/compatible for "odroid-xu4" is nested inside if hardware is None::
hardware = self.detector.get_cpuinfo_field("Hardware")
if hardware is None:
compatible = self.detector.get_device_compatible()
...
if compatible and "odroid-xu4" in compatible: # never reached on XU4
linux_id = chips.EXYNOS5422
Since hardware is "Samsung Exynos (Flattened Device Tree)" (not None), the entire block is skipped. The fallback check later (elif "ODROID-XU4" in hardware) also fails because the hardware string does not contain "ODROID-XU4".
Fix
Move the "odroid-xu4" compatible check outside the if hardware is None: block, similar to the check_dt_compatible_value() calls used for other boards earlier in the same method.
ODROID-XU4 not detected on kernels with
Hardwarefield in/proc/cpuinfoDescription
The ODROID-XU4 is not detected by PlatformDetect on Armbian (and likely other non-Hardkernel images) because the compatible-string detection block is gated behind
if hardware is None:, but the XU4 reports a Hardware field in/proc/cpuinfo.Environment
/proc/cpuinfoHardware field/proc/device-tree/compatibleRoot cause
In
chip.py, the block that checks/proc/device-tree/compatiblefor"odroid-xu4"is nested insideif hardware is None::Since
hardwareis"Samsung Exynos (Flattened Device Tree)"(notNone), the entire block is skipped. The fallback check later (elif "ODROID-XU4" in hardware) also fails because the hardware string does not contain"ODROID-XU4".Fix
Move the
"odroid-xu4"compatible check outside theif hardware is None:block, similar to thecheck_dt_compatible_value()calls used for other boards earlier in the same method.