How to overlay a .dts file into the device tree? (asking for a friend...)

  • First off, I doubt this is something I will actually do, just asking for my curiosity/education.

    I have a fix** for a hardware glitch on my OrangePi that I found here, and I can implement it (when running Armbian) by overlaying a small .dts file onto the device tree. Its simple and I verified it fixes my glitch.

    How would I implement that same fix on LIbreElec? ChatGPT says i need to compile the .dts file to a .dtbo first (ok), and then add some commands to /flash/boot.cmd, and then recompile boot.scr... and by that point I am pretty sure ChatGPT is spouting hallucinations at me.

    So hypothetically how would I add this change to LibreElec, or is it even possible?

    **The glitch in question: I have several OrangePi 3 LTS's, some of them won't always re-initialize the ethernet interface after a reboot. Was reported and discussed in this thread. The "fix" I referenced earlier basically adds some delays to the ethernet init process..


    Thanks!

  • The Allwinner image supports overlays so you can probably just drop the existing dtbo file onto the SD card and modify the extlinux.conf to use it; LE and Armbian should be similar in how that’s done as they both use mainline u-boot.

    Or you need to compile an LE image with a kernel patch to add the overlay so it will be compiled and added to the image. Or you submit the patch to our GitHub repository so it’s merged and added to the image; although we mostly refuse patches that are not also submitted to kernel mailing lists (we want to know the patch is good and will be dropped in the future when the fix is upstream).