rlakoda
rlakoda

Reputation: 33

Using custom kernel recipe with Yocto: Nothing RPROVIDES 'vmlinux'

I am trying to use the latest LTS kernel from kernel.org for a Yocto project. I am using an Olinuxino A20 board, for which I use meta-sunxi layer and its dependencies. I used the template in meta-skeleton/recipes-kernel/linux to create my own layer (meta-my-layer) and my own kernel recipe (linux-vanilla-lts.bb):

SUMMARY = "A new kernel recipe"
COMPATIBLE_MACHINE = "olinuxino-a20"

inherit kernel
require recipes-kernel/linux/linux-yocto.inc

SRC_URI = "http://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.1.38.tar.xz"
LINUX_VERSION ?= "6.1.38"
LINUX_VERSION_EXTENSION:append = "-custom"

PV = "${LINUX_VERSION}+git${SRCPV}"

I have all necessary layers enabled:

layer                 path                                      priority
==========================================================================
meta                  /path/to/yocto/poky/meta                           5
meta-poky             /path/to/yocto/poky/meta-poky                      5
meta-yocto-bsp        /path/to/yocto/poky/meta-yocto-bsp                 5
meta-oe               /path/to/yocto/poky/meta-openembedded/meta-oe      5
meta-python           /path/to/yocto/poky/meta-openembedded/meta-python  5
meta-arm-toolchain    /path/to/yocto/poky/meta-arm/meta-arm-toolchain    5
meta-arm              /path/to/yocto/poky/meta-arm/meta-arm              5
meta-sunxi            /path/to/yocto/poky/meta-sunxi                     8
meta-my-layer         /path/to/yocto/poky/meta-my-layer                  9

In the machine's configuration file, I added PREFERRED_PROVIDER_virtual/kernel = "linux-vanilla-lts". If I try to configure the kernel using bitbake -c menuconfig virtual/kernel, it fails. Confusingly, the error I get is not always the same. Sometimes, I get

ERROR: Nothing RPROVIDES ''vmlinux',' (but /path/to/yocto/poky/meta-my-layer/recipes-kernel/linux/linux-vanilla-lts.bb RDEPENDS on or otherwise requires it)

or

ERROR: Nothing RPROVIDES '${@oe.utils.conditional('KERNEL_IMAGETYPE',' (but /path/to/yocto/poky/meta-ssd1309/recipes-kernel/linux/linux-vanilla-lts.bb RDEPENDS on or otherwise requires it)

I tried to add RPROVIDES="vmlinux" to the recipe, but this does not help. Everything builds and boots fine if I use linux-mainline kernel within meta-sunxi.

Can someone please tell me what I am doing wrong?

Upvotes: 0

Views: 1156

Answers (1)

Tom S
Tom S

Reputation: 624

The '${@oe.utils.conditional(... is left over from an inline Python variable expansion that could not be expanded during parsing. This happens when one of the variables inside of the statement is unset.

The unexpanded statement ends up directly in the RDEPENDS variable where bitbake tries to parse it as a runtime dependency. Unfortunately this makes for confusing error messages.

The issue with your recipe is most likely related to the leftover ${SRCPV} in this line:

PV = "${LINUX_VERSION}+git${SRCPV}"

You changed your SRC_URI to a tarball downloaded via HTTP, which will not populate the SRCPV variable. You should set your PV variable from your LINUX_VERSION variable and, ideally, use the variable in your SRC_URI statement as well.

PV = "${LINUX_VERSION}"
SRC_URI = "http://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${LINUX_VERSION}.tar.xz"

Upvotes: 3

Related Questions