easytarget / MQ-Pro-IO

Investigating the MangoPi MQ pro
14 stars 0 forks source link

Use Device Tree Overlays #7

Open easytarget opened 2 months ago

easytarget commented 2 months ago

An alternative solution than making a full replacement trees is to keep the upstream vanilla tree and apply Overlays to it at boot time.

An initial start has been made on the branch overlays:

https://github.com/easytarget/MQ-Pro-IO/tree/overlays/build-overlays

This is low priority for me since it only brings minimal advantage over the current approach.

easytarget commented 2 months ago

This: https://developer.toradex.com/software/linux-resources/device-tree/first-steps-with-device-tree-overlays/#write-a-device-tree-overlay

This: https://developer.toradex.com/linux-bsp/os-development/build-u-boot-and-linux-kernel-from-source-code/build-device-tree-overlays-from-source-code/

And This: https://developer.toradex.com/linux-bsp/os-development/build-yocto/device-tree-overlays-linux/#deploying-a-device-tree-overlay

It's for YOCTO but the principle is the same.

Easier than I thought?

easytarget commented 2 months ago

Easier than I thought?

No. Not particularly easy.

I spent a few hrs on this; I have a .dtbo file that appears to be valid. At least it compiles..

But I cannot work out how to get it applied at boot. I went off down a (probably bad) rabbit hole of trying to get /boot/boot.scr working so that it can load the overlay. Total fail, and I'm not sure it is the correct approach on an EFI system anyway.

I will edit the main issue; since the fact that the overlays (ideally) need to be recompiled for each kernel update and applied during a reboot negates most of the advantage over having to recompile the whole device tree.

I will check the work I did last night in to a branch, and return to it later if necessary.