Problems setting PREFERRED_PROVIDER_virtual/kernel

Hello guys,

I am using Apalis iMX6Q on an Apalis Evaluation Board and I am trying to upgrade a current working project (dunfell) to kirkstone.

Now, since I am using baby steps I build a simple tdx-reference-minimal-image which worked fine. Now, I want to add my custom kernel to it, which is based on linux 4.19 kernel and I am forced to use this exact version and all its customizations.

For this, I have a meta-custom/recipes-kernel/linux/ which I added in my bbfiles. When I execute bitbake-layers show-layers my meta-custom is on top of that list with priority 1000.

local.conf contains the following:

MACHINE ?= “apalis-imx6”
BBFILE_PRIORITY_linux-customed = “1000”
PREFERRED_PROVIDER_virtual/kernel_forcevariable = “linux-customed”
PREFERRED_PROVIDER_virtual/kernel = “linux-customed”
OVERRIDES:append = “:virtual/kernel=linux-customed”
PREFERRED_PROVIDER_virtual/kernel_toradex-mainline = “”

The problem is that whenever I try to build something I get this error:

bitbake linux-customed
ERROR: Nothing PROVIDES ‘linux-customed’
linux-customed was skipped: PREFERRED_PROVIDER_virtual/kernel set to linux-toradex-mainline, not linux-customed

Looks like I am stuck with linux-toradex-mainline and cannot force bitbake to use my own linux kernel.

Any idea on how can I force my own kernel into the build?

Hi @Andre1 !

I have several questions regarding what you are trying to accomplish (and how).

Trying you understand your use case

Could you please elaborate a bit more here? Why do you have this limitation?

Also, seems like you came from Dunfell to Kirkstone:

So seems like you are “carrying” this 4.19 Linux Kernel version for a while, right? Toradex’s BSP for Yocto Dunfell version uses Linux Kernel version 5.4 for both upstream and downstream: Embedded Linux Release Matrix | Toradex Developer Center.

I am not sure if what you are doing is simply not recommended, but I feel like it could give you some headaches trying to carry an old Linux Kernel forward for so long.

About your local.conf

Are you sure those configurations you are performing are correct? Setting the BBFILE_PRIORITY of a layer on local.conf is most probably wrong. And the OVERRIDES one called my attention. If you compare with the content of a “default” OVERRIDES, seems like what you are doing is wrong:

$ bitbake virtual/kernel -e | grep "^OVERRIDES="


Please be aware that the override syntax on Yocto Kirkstone does not accept _. It must be :. Please check Yocto (Bitbake) documentation for Kirkstone version.

Also, as you can see from a “default” local.conf, we have the following line:

# This file does not need to exist, if it does it can be used to influence machine specific
# configurations without copying the machine file.
include conf/machine/include/${MACHINE}.inc

Is this line still at the end of your local.conf? If yes, I think it will make a mess with your previous setup.

Although still unsure if using an old kernel is recommended, I would ask you to try creating a new machine conf file instead of dropping several machine-related variables on your local.conf.

This Custom meta layers, recipes and images in Yocto Project (hello-world examples) | Toradex Developer Center article shows how you can add machine conf file to your own layer.

About bblayers.conf

Did you add your new layer to build/conf/bblayers.conf?

Best regards,

Hi @henrique.tx and thankx for the quick reply !

I am maintaining a current solution (working on a apalis imx6q v1.1C) that is based on what I described. I had a problem tho when I “got” upgraded to v1.1D with the ethernet, which is not working, since they replaced the Gigabit Ethernet Transceiver: KSZ9031RNXIC with KSZ9131RNXI (information got from the release notes). If I manage to work this out, my current problem is solved!!!

That is correct

Once I am able to make this solution/project work with apalis imx6q v1.1D I will work on upgrading to the latest, but it will take a lot more time, time which I will have once this is solved :smile:

The problem is that I am stuck with this kernel version because the project that I’m working on is using some solutions that are strictly related to that kernel version.

It’s not exactly like this. Those are all the configs I’ve tried (in all combinations) in hoping that it will solve my issue. I am aware that it’s not the correct way of doing it but it’s all I could find on internet.

Yes, the line : include conf/machine/include/${MACHINE}.inc is still at the end of my local.conf

---->LATER EDIT<---- I commented this line and was able to build both the kernel and the image but this did not solve my problem with the networking of apalis imx6q v1.1D. I strongly believe that this is solvable using that ${MACHINE}.inc :frowning:

Yes, and bitbake-layers show-layers prints my layer on top, with the highest priority (1000)

Best regards,

Hi @Andre1!

From your last message, I understand that you didn’t find the issue, right?

Since, in your case, you are coming a long way with old stuff, it is hard to know where the issue might be.

If you need further help with Yocto, we can recommend some of Toradex’s partners that are Yocto experts and can support you with your specific setup. Let us know :slight_smile:

Best regards,