Page MenuHomeFreeBSD

stand/fdt: Check /compatible property on overlay if it exists

Authored by kevans on Jan 18 2018, 4:21 PM.



Example overlays seen in other places use a compatible property on root node of an overlay to specify SOC compatibility. These don't get merged into base FDT as they're not part of the fragment, but it's expected that consumers of the overlay may want to check it.

If /compatible on the overlay is missing, just apply it. This is the "I know what I'm doing" mode for those wanting to whip up a quick overlay and apply it. An overlay intended for distribution should include /compatible so as not to break a user's system.

If /compatible on the overlay exists, honor it and cross-check it with /compatible on the base FDT. If /compatible on the base FDT is missing in this case, don't apply the overlay rather than risk breaking the system.

Move the COPYOUT of overlay material to before we allocate space for next_fdtp so that we can avoid the allocation and copy into next_fdtp if we already know that the overlay can't apply.

This gives way to the possibility of autoloading overlays found in /boot/overlays, since this provides a means of filtering out overlays not applicable to the current board.

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

kevans created this revision.Jan 18 2018, 4:21 PM
gonzo accepted this revision.Jan 28 2018, 12:22 AM
This revision is now accepted and ready to land.Jan 28 2018, 12:22 AM
This revision was automatically updated to reflect the committed changes.