How is the yocto recipe for the Linux kernel selected?

I’m working on my own meta-layer for my beagleplay board, for some boot time projects I’m working on. I had made a linux-bb.org_git.bbappend file for some of my customizations. Then I did a ‘git pull’ on my meta-ti layer, and now when I do builds I’m using the linux-ti-staging-6.6.bb file (no longer using linux-bb.org).

I see a bunch of different kernel recipes under meta-ti/meta-ti-bsp/recipes-kernel/linux. Some of these I’d like to experiment with (particularly the linux-ti-mainline recipe).

How is the recipe for the kernel selected or determine by bitbake for an image build? How would I change it to one of my choosing. I apologize if this is more of a yocto question. I’m somewhat of a newbie with yocto.
Thanks.

1 Like

it would start with what bblayers.conf paths you have
then the meta-xxx/conf/machine that your building for
i.e. PREFERRED_PROVIDER_virtual/kernel = “linux-bb.org
you can override this, but you must provide the download location of the source in some .bbappend,
each version of yocto seems to do things a bit different

@amf99 Thanks. That got me headed in the right direction. Here’s what I found:

file <build-dir>/conf/local.conf has:
MACHINE = "beagleplay"

file meta-ti/meta-ti-bsp/conf/machine/beagleplay.conf has:
require conf/machine/include/k3.inc

file meta-ti/meta-ti-bsp/conf/machine/conf/machine/include/k3.inc has:
require conf/machine/include/ti-bsp.inc

file meta-ti/meta-ti-bsp/conf/machine/include/ti-bsp.inc has:

#  Supported options are: mainline, next, ti-6_6, ti-6_1, bb_org
TI_PREFERRED_BSP ??= "ti-6_6"

MACHINEOVERRIDES =. "bsp-${TI_PREFERRED_BSP}:"

BSP_KERNEL_PROVIDER:bsp-mainline = "linux-ti-mainline"
BSP_KERNEL_VERSION:bsp-mainline = "%"

# =========
# ti-6_6
# TI staging kernel 6.6, u-boot 2024.04
# =========
BSP_KERNEL_PROVIDER:bsp-ti-6_6 = "linux-ti-staging"
BSP_KERNEL_VERSION:bsp-ti-6_6 = "6.6%"
BSP_BOOTLOADER_PROVIDER:bsp-ti-6_6 = "u-boot-ti-staging"
BSP_BOOTLOADER_VERSION:bsp-ti-6_6 = "2024%"

PREFERRED_PROVIDER_virtual/kernel ?= "${BSP_KERNEL_PROVIDER}"
PREFERRED_VERSION_${BSP_KERNEL_PROVIDER} ?= "${BSP_KERNEL_VERSION}"

It appears that previously, the beagleplay.conf file required beagle.inc, which had
TI_PREFERRED_BSP ?= “bb_org”. But the ‘require conf/machine//include/beagle.inc’
line was removed in a recent commit, to change from using the “bb_org” BSP to the
“ti-6_6” (default, “linux-ti-staging”) virtual kernel recipe.

Quick followup question? I see TI_PREFERRED_BSP being set using the ?= and ??=
operators. Does this mean I can set it in my local.conf, to select one of the options
(mainline, next, etc.)?

Thanks.

should be able to, the bsp/recipes-kernel/linux will need to have the .bb for the version your wanting to build.