Derexed
Derexed

Reputation: 66

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.

Upvotes: 2

Views: 6236

Answers (2)

Oleg Kokorin
Oleg Kokorin

Reputation: 2690

alternatively a config file imx6q.cfg with this option inside:

ARCH_SOC_IMX6Q=y

can be created and placed next to the linux-xxx.bb recipe down into files subfolder.

in this case, any defconfig supplied with the kernel will have necessary option enabled before the compilation or any patch applied.

use the following example on how to to append created config file inside the linux-xxx.bb recipe:

SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git;protocol=git;nocheckout=1;name=machine;branch=linux-5.4.y; \
           file://imx6q.cfg"

Upvotes: 1

Derexed
Derexed

Reputation: 66

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.

Upvotes: 2

Related Questions