As we use our own device tree file.
I set the variable KERNEL_DEVICETREE = "ourowndevicetree.dtb" in layers/ourlayer/conf/machine/apalis-imx6.conf. “Our layer” has the hightest priority. Notice that I changed KERNEL_DEVICETREE += "... " to KERNEL_DEVICETREE = ...
But that does not stop the build to still include the files mentioned in layers/meta-toradex-nxp/conf/machine/include/apalis-imx6.inc and other layers where KERNEL_DEVICETREE is also set.
What is the cleanest way to override that variable without editing the apalis-imx6.inc in other layers?
How can I get rid of the devicetree overlay files?
It is good to know that you found a way to make it work!
But I ask you to reconsider the idea of setting such a variable in a layer-related configuration file. If you check other examples, you will see that such a variable is expected to be configured in a machine-related configuration.
As an example, if you cd into your layers and run (I am using ripgrep):
$ rg -l KERNEL_DEVICETREE | rg layer
You will see that no layer sets this variable.
I would say that doing so in layer.conf is not recommended / “hackish”