KERNEL_DEVICETREE cannot be appended?


Matthias Klein
 

Hello,

 

I am trying to add a device tree in a yocto based on the meta-raspberrypi layer.

Adding the device tree via a patch in a bbapend of the kernel recipe is no problem.

 

But all attempts to add the file in the local.conf of the variable KERNEL_DEVICETREE replace all other device trees.

I.e. on the device is then only my new file. It seems that the "append" works like a "="?

 

#KERNEL_DEVICETREE:raspberrypi3-64:append = " broadcom/my-custom-tree.dtb"

KERNEL_DEVICETREE:raspberrypi3-64 += " broadcom/my-custom-tree.dtb"

 

Is there any way to add the device tree?

Preferably without having to create a custom machine for it?

 

Best regards,
Matthias

 


Alexandre Belloni
 

Hi,

On 22/03/2022 17:10:10+0000, Matthias Klein wrote:
Hello,

I am trying to add a device tree in a yocto based on the meta-raspberrypi layer.
Adding the device tree via a patch in a bbapend of the kernel recipe is no problem.

But all attempts to add the file in the local.conf of the variable KERNEL_DEVICETREE replace all other device trees.
I.e. on the device is then only my new file. It seems that the "append" works like a "="?

#KERNEL_DEVICETREE:raspberrypi3-64:append = " broadcom/my-custom-tree.dtb"
KERNEL_DEVICETREE:raspberrypi3-64 += " broadcom/my-custom-tree.dtb"

Is there any way to add the device tree?
Did you try RPI_KERNEL_DEVICETREE:append?


Whatt is happening here is that KERNEL_DEVICETREE is set like that in
rpi-base.inc:

KERNEL_DEVICETREE ??= " \
${RPI_KERNEL_DEVICETREE} \
${RPI_KERNEL_DEVICETREE_OVERLAYS} \
"

You are creating KERNEL_DEVICETREE:raspberrypi3-64 which is more
specific than KERNEL_DEVICETREE and so the default content of
KERNEL_DEVICETREE is dropped and replaced by the value of
KERNEL_DEVICETREE:raspberrypi3-64.

Preferably without having to create a custom machine for it?
You should probably create a new machine, it is a bad practice to change
KERNEL_DEVICETREE from local.conf

Best regards,
Matthias



--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


Matthias Klein
 

Hello Alexandre,

Did you try RPI_KERNEL_DEVICETREE:append?
Thank you, that works.

You should probably create a new machine, it is a bad practice to change KERNEL_DEVICETREE from local.conf
OK.

Best regards,
Matthias


Matthias Klein
 

Hello Alexandre,

Did you try RPI_KERNEL_DEVICETREE:append?
No, I was wrong.
This also replaces all device trees.
Only the overlays are then additionally present.

I understand that it is bad practice.
However, I would still like to understand why the "append" behaves so strangely.

Best regards,
Matthias