Adding custom overlays (dts) errors custom layer

I’m attempting to add an overlay that enables some pins for my raspberrypi-cm3.
In my layer I’ve created a file
recipes-kernel/linux/linux_raspberrypi_%.bbappend that adds a patch from the
recipes-kernel/linux/files/ directory.

To add it to the device tree I added this line in the layer.conf file

KERNEL_DEVICETREE += "overlays/name_of_overlay"

This throws errors when attempting to build in a docker container and the following error is produced

make[1]: *** No rule to make target 'modules_prepare'. Stop.

Was wondering if anyone could help me find ways to properly add overlays to the Kernel using .patch files and if there was a solution to this issue.



A couple of quick questions

  • are you trying to build balenaOS? Wasn’t clear from your question so was wondering what distro you are building
  • Can you elaborate on what docker container you are using to build the pi image?
  • Do you intend to use KERNEL_DEVICETREE_append instead?