Re: MACHINE and inc files

Quentin Schulz

Hi Tomek,

On Sun, Jun 21, 2020 at 03:09:40PM +0200, Tomek The Messenger wrote:
The problem which I have is that this one below doesn't work (*):

The two kernel modules are autoloaded during linux startup only if I have
in bb recipe this one:
Because there is a misunderstanding on how _<override> works :)


does not mean that you add A in case of velismate machine is used.

You can have *many* variables that are override-able by machines (or
other OVERRIDES values).

In your example above you will actually have two variables for Yocto

You can check that by using `-e` after bitbake.

What you want is to **add** to KERNEL_MODULE_AUTOLOAD **only** for
velismate machine. That can be done with:
KERNEL_MODULE_AUTOLOAD_append_velismate = " A"

Note the leading space, and that it's _append_velismate and not

This will just work.

If I have like here (*), so kind of some mix, then kernel-moduleB isn't
On the other hand the below one works OK:
RPROVIDES_${PN}_velismate += "kernel-module-A"
RPROVIDES_${PN} += "kernel-module-B"
RPPROVIDES install in filesystem your kernel module and based on variable
AUTOLOAD some magic during building kernel image is done that after linux
startupu your module is loading.
So I try to pass the above by adding:
#include ${MACHINE}.inc and in *.inc file I will use KERNEL_MODULE_AUTOLOAD
without part "_something" as it is problematic when mixing.
so my recipe will looks like:
include ${MACHINE}.inc #here for machine velismate kernel module B will
be added
As per KERNEL_MODULE_AUTOLOAD documentation[1] you can actually put it
in the machine configuration file, which makes **a lot** more sense :)
Forget about all your "I'm pulling my hair"-tries and go with that,
trust me.


But the problem is that my MACHINE is:
not just 'velismate'
and how to ignore x11,x12 words and not do anything in if in future
machine velismate-x31 will appear.
It must be something like
include ${takeOnlyFirstWordOfMachine(${MACHINE})}.inc
so I probably need to implement function takeOnlyFirstWordOfMachine but
how, I don't know.
In makefile it is easy, You have:
ifeq ($(findstring velismate, $(MACHINE)), velismate)
but in bitbake I don't have idea how to done it in the most simplest way.
You want to use MACHINEOVERRIDES for that. Add your 'velismate'
"family" to it (AT THE CORRECT PLACE, use bitbake -e to check, rightmost
in MACHINEOVERRIDES has top priority). You just have to make sure
velismate is in your new machine configuration file.

IIRC, you would need to do:
MACHINEOVERRIDES =. ":velismate"
before all require/include in your machine configuration file.


Join to automatically receive all group messages.