ThePumkinMelon
ThePumkinMelon

Reputation: 107

How to have per MACHINE kernel configuration in Yocto?

I have a Yocto recipe for a Linux kernel fork, I need to change the defconfig for the different machines I need to support. One of the machines uses an in-tree defconfig, the others will need out-of-tree defconfigs (and devicetrees eventually). This is similar to This unanswered question.

The problem I'm running into is that with my file structure, bitbake cannot find the defconfig, when I make a machine specific SRC_URI.

recipe-folder
   |-files
   |   |-machineA
   |   |   |-machineA.patch
   |   |-machineB
   |   |   |-defconfig
   |   |   |-machineB.patch
   |-linux-recipe_0.1.bb

If I'm trying to build for machineB, and I do:

SRC_URI += "file://defconfig"

Yocto is able to find the defconfig and build, see This question.

But, If I want the recipe to support both machineA and B:

KBUILD_DEFCONFIG:machineA = "machineA_intree_defconfig"
SRC_URI:machineA += "file://machineA.patch"

SRC_URI:machineB += "file://defconfig file://machineB.patch"

And try and build machineB Yocto cannot find the defconfig file.

Even If I add the lines:

FILESEXTRAPATHS:prepend:machineA := "${THISDIR}/files/machineA:"
FILESEXTRAPATHS:prepend:machineB := "${THISDIR}/files/machineB:"

Yocto still cannot find the files.

How do I have SRC_URI work on a per-machine basis?

Upvotes: 1

Views: 380

Answers (1)

Badarinath Reddy
Badarinath Reddy

Reputation: 36

You should try something like this:

SRC_URI:machineA += "file://machineA/machineA.patch"

SRC_URI:machineB += "file://machineB/defconfig \
                     file://machineB/machineB.patch"

The filename you specify within the URL can be either an absolute or relative path to a file.

More details can be found here:

https://docs.yoctoproject.org/bitbake/2.0/bitbake-user-manual/bitbake-user-manual-fetching.html#local-file-fetcher-file

https://docs.yoctoproject.org/bitbake/2.0/bitbake-user-manual/bitbake-user-manual-ref-variables.html#term-FILESPATH

Upvotes: 1

Related Questions