[yocto] SRC_URI_kernel in machine conf

Paul Eggleton paul.eggleton at linux.intel.com
Thu Sep 5 03:39:57 PDT 2013


Hi Lothar,

On Thursday 05 September 2013 12:09:57 lothar at denx.de wrote:
> Is it possible to declare a kernels' SRC_URI, as also certain functions,
> directly in the machine config, instead of the kernel .bb?
> 
> Example: currently I declare the following in a mykernel.bb (derrived
> from kernel.bbclass)
>      SRC_URI_mymachine = "git:my-git-repo"
>      do_compile_append_mymachine(){
>          rm somefile
>      }
> 
> ...is it possible now, to move this specific code into the
> mymachine.conf file, like
>      SRC_URI_mykernel = "git:my-git-repo"
>      do_compile_mykernel_append(){
>          rm somefile
>      }
> 
> Questions:
> 1) Is this possible at all?

I don't think this will work; and even if it does it is not advisable. You 
should do one of two things instead:

A) Make the switch within the kernel recipe using machine overrides (this is 
often done with linux-yocto)

B) Have a different recipe for each kernel and select the appropriate one with 
PREFERRED_PROVIDER_virtual/kernel in the machine configuration

> 2) Is it better to use suffix "_mykernel", "_kernel" or
> "_virtual/kernel"?

I don't think any of these will work in this instance.

> 3) I saw settings sometimes using the suffix "_kernelname" e.g.
> "_linux-yocto" and other times "_virtual/kernel" - what are the
> differences between them? When better use one, when better use the
> other?

"virtual/kernel" or "linux-yocto" (or any recipe name) as an override will 
only work with certain variables, e.g. PREFERRED_VERSION or PREFERRED_PROVIDER 
at the global level. Elsewhere it will not work. If you run bitbake -e | less 
and search for ^OVERRIDES= you will see the overrides that generally work for 
all variables based on your current configuration, as well as how the overrides 
are set up based on the values of other variables such as DISTRO, MACHINE, PN 
etc.

Cheers,
Paul


-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the yocto mailing list