Cannot build TorizonCore dunfell-5.x.y

I am attempting to build a modified kernel (to enable some missing drivers and add associated userland utilities), building a TorizonCore image as described Here.

I have created my own meta-layer with a kernel recipe, userland recipe and an image definition. It built fine… once. Thereafter, any time I touch anything that bitbake thinks needs the kernel recompiled, I get the following errors:

| make[2]: *** No rule to make target 'arch/arm64/boot/dts/freescale/imx8qm-apalis-eval-ar0521.dtb'.  Stop.
| /home/gregory-bond/Workspace/TorizonCore/build-torizon/tmp-torizon/work-shared/apalis-imx8/kernel-source/Makefile:1246: recipe for target 'freescale/imx8qm-apalis-eval-ar0521.dtb' failed
| make[1]: *** [freescale/imx8qm-apalis-eval-ar0521.dtb] Error 2
| /home/gregory-bond/Workspace/TorizonCore/build-torizon/tmp-torizon/work-shared/apalis-imx8/kernel-source/Makefile:179: recipe for target 'sub-make' failed
| make: *** [sub-make] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/home/gregory-bond/Workspace/TorizonCore/build-torizon/tmp-torizon/work/apalis_imx8-tdx-linux/linux-toradex/5.4.47+gitAUTOINC+2521581b9b+gitAUTOINC+2521581b9b-r0/temp/run.do_compile.68095' failed with exit code 1:
|   GEN     Makefile
|   CALL    /home/gregory-bond/Workspace/TorizonCore/build-torizon/tmp-torizon/work-shared/apalis-imx8/kernel-source/scripts/atomic/check-atomics.sh
|   CALL    /home/gregory-bond/Workspace/TorizonCore/build-torizon/tmp-torizon/work-shared/apalis-imx8/kernel-source/scripts/checksyscalls.sh
|   CHK     include/generated/compile.h
| make[2]: *** No rule to make target 'arch/arm64/boot/dts/freescale/imx8qm-apalis-eval-ar0521.dtb'.  Stop.
| /home/gregory-bond/Workspace/TorizonCore/build-torizon/tmp-torizon/work-shared/apalis-imx8/kernel-source/Makefile:1246: recipe for target 'freescale/imx8qm-apalis-eval-ar0521.dtb' failed
| make[1]: *** [freescale/imx8qm-apalis-eval-ar0521.dtb] Error 2
| /home/gregory-bond/Workspace/TorizonCore/build-torizon/tmp-torizon/work-shared/apalis-imx8/kernel-source/Makefile:179: recipe for target 'sub-make' failed
| make: *** [sub-make] Error 2
| WARNING: exit code 1 from a shell command.
| 
ERROR: Task (/home/gregory-bond/Workspace/TorizonCore/build-torizon/conf/../../layers/meta-toradex-nxp/recipes-kernel/linux/linux-toradex_5.4-2.1.x.bb:do_compile) failed with exit code '1'

I do not know what the ar0521 device is, we do not mention that anywhere in our meta-layer.

Once I get this error the first time, it is very sticky. Even if I remove my meta-layer and revert to the stock out-of-the-box torizon-core-docker image, I eventually wind up with the same error. If I remove all the build artifacts (apart from the fetched data), then I can sometimes successfully (eventually) build an image again… sometimes.

This sounds like some mis-configured build dependencies. Any clues how to attack this? I’m very new to bitbake/yocto and out of ideas, and google is not helping me much.

This is now failing for me for every build, even starting from a completely empty workspace, with only the official TorizonCore layers:

  • mkdir workspace
  • cd workspace
  • repo init -u https://git.toradex.com/toradex-manifest.git -b dunfell-5.x.y -m torizoncore/default.xml
  • repo sync
  • export MACHINE=apalis-imx8
  • source setup-environment
  • bitbake -c do_compile linux-toradex

This now always fails with the same error message

| make[2]: *** No rule to make target 'arch/arm64/boot/dts/freescale/imx8qm-apalis-eval-ar0521.dtb'.  Stop.
| make[1]: *** [/workdir/build-torizon/tmp-torizon/work-shared/apalis-imx8/kernel-source/Makefile:1246: freescale/imx8qm-apalis-eval-ar0521.dtb] Error 2
| make: *** [/workdir/build-torizon/tmp-torizon/work-shared/apalis-imx8/kernel-source/Makefile:179: sub-make] Error 2
| WARNING: exit code 1 from a shell command.
| 
ERROR: Task (/workdir/build-torizon/conf/../../layers/meta-toradex-nxp/recipes-kernel/linux/linux-toradex_5.4-2.1.x.bb:do_compile) failed with exit code '1'

I have tried the head of dunfell-5.x.y branch as well as explicitly specifying previous commits ( e.g. e89febe4e43dbe52ebf49eaac2d4fbd7ca747c28).

I do not understand why this was (sometimes) working yesterday, but today I cannot get a kernel to build at all.

Help me, Obi Wan.

And if I choose “master” branch rather than “dunfell-5.x.y” then it compiles just fine and builds the image just fine.

Many hours (and many, many gigabytes) later…

I have found that if, after the repo sync but before the bitbake build command, I edit the file layers/meta-toradex-nxp/conf/machine/apalis-imx8.conf to remove all three references to ar0521.dtb files, then I can successfully compile a kernel and build the required images.

This is a workaround hack, not an actual solution, and I don’t understand why this was working on Monday but failing so miserably on Thursday, but at least I can proceed for now.,

This appears to be fixed with the latest commit

https://git.toradex.com/cgit/toradex-manifest.git/commit/?h=dunfell-5.x.y&id=3a9ad94f0c337fb714960f242e084d1f28c0f931

This appears to have brought in a newer meta-toradex-npx layer which has fixed the problem.

Perfect that the issue is solved. Thanks for the feedback.

Best regards,
Jaski