Search code examples
linuxmakefilelinux-kernelyoctoimx6

Makefile error when trying to build core-image-minimal with custom DTB


I'm new to the Yocto Project and I'm trying to build a simple core-image-minimal image for my custom board based on i.MX6QP/Q/DL SABRE Automotive. Right now I'm only working with the meta-freescale layer.

I have some custom DTS files that I want build and include in a fitImage of the Linux kernel.

This is what I've done so far:

  1. I've created a custom layer with a custom machine, and in the conf/machine.conf file I have specified the DTBs that I want to use:

    KERNEL_DEVICETREE = " \
        imx6qp-g25-protoc-1280x480.dtb \
        ...
    "
    
  2. I've created a linux-fslc-imx_%.bbappend file in /yocto/poky/meta-custom/recipes-kernel/linux/ that references a .patch file that contains the git diff like done here. In the .patch file I've included the required arch/arm/boot/dts/Makefile modifications and the DTS files.

Unfortunately, when trying to build core-image-minimal, the DTB building fails with this message:

make[3]: * No rule to make target 'arch/arm/boot/dts/imx6qp-g25-protoc-1280x480.dtb'. Stop. arch/arm/Makefile:322: recipe for target 'imx6qp-g25-protoc-1280x480.dtb' failed make[2]: [imx6qp-g25-protoc-1280x480.dtb] Error 2 Makefile:146: recipe for target 'sub-make' failed make[1]: [sub-make] Error 2 Makefile:24: recipe for target '__sub-make' failed make: * [__sub-make] Error 2 ERROR: oe_runmake failed WARNING: exit code 1 from a shell command.

I've checked that the patch is applied, in fact, by looking at the source folder linux-fslc-imx/4.1-2.0.x+gitAUTOINC+6c1ad49339-r0/build/source/arch/arm/boot/dts, the Makefile is correct and the DTS files are present.


Solution

  • It looks like the issue was that I was not including a defconfig file in the kernel recipe, so the CONFIG_SOC_IMX6Q variable was not set to y making my target undetected in the arch/arm/boot/dts/Makefile. Including a defconfig with ARCH_SOC_IMX6Q=y solved my issue.