yocto support


Senthamilarasi mathiyan
 

Dear All

Good Morning!

In my project, I am trying to create one custom image recipe in my yocto build system.

 The reason of creating custom image is  -> having few specific configurations for kernel and some specific driver Makefile changes to enable coverage.

 I cannot go with .bbappend file, because we are maintaining a recipes-append folder in our meta-layer which is common for all the production build image recipes.

 My change is very specific it should not come as part of normal build images because it will affect the production build. 

 My use case:

1. I have one .cfg file for kernel - which has kernel specific configurations.

2. I have Makefile changes for driver file.

 I should bring the above changes to kernel and  driver Makefile during build time without using .bbappend file.

 I want to create a custom image recipe with the specific changes.

 For example : custom_image.bb =( This recipes should have core_image_minimal.bb + my specific changes)

 When i build bitbake custom_image.bb,  it should  build  with core_image_minimal.bb + my specific changes .

Other images recipes also should not affect by this changes.

My humble request. Can anyone please support how to proceed?

Kindly share your suggestions.

 Regards

Senthamilarasi. M


Alexander Kanavin
 

If the change is private to you, then you can make a simple layer and
make all the needed modifications there. Is this not possible?

Alex

On Tue, 28 Jun 2022 at 13:51, Senthamilarasi mathiyan
<arasilinux1086@...> wrote:

Dear All

Good Morning!

In my project, I am trying to create one custom image recipe in my yocto build system.

The reason of creating custom image is -> having few specific configurations for kernel and some specific driver Makefile changes to enable coverage.

I cannot go with .bbappend file, because we are maintaining a recipes-append folder in our meta-layer which is common for all the production build image recipes.

My change is very specific it should not come as part of normal build images because it will affect the production build.

My use case:

1. I have one .cfg file for kernel - which has kernel specific configurations.

2. I have Makefile changes for driver file.

I should bring the above changes to kernel and driver Makefile during build time without using .bbappend file.

I want to create a custom image recipe with the specific changes.

For example : custom_image.bb =( This recipes should have core_image_minimal.bb + my specific changes)

When i build bitbake custom_image.bb, it should build with core_image_minimal.bb + my specific changes .

Other images recipes also should not affect by this changes.

My humble request. Can anyone please support how to proceed?

Kindly share your suggestions.

Regards

Senthamilarasi. M




Senthamilarasi mathiyan
 

Hi Alexander, 

This is not my private change,so i cannot create my own layer. Without creating layer and .bbappend file should implement.

Can anyone please support? 

Regards
Senthamilarasi. M


On Tue, 28 Jun, 2022, 6:04 pm Alexander Kanavin, <alex.kanavin@...> wrote:
If the change is private to you, then you can make a simple layer and
make all the needed modifications there. Is this not possible?

Alex

On Tue, 28 Jun 2022 at 13:51, Senthamilarasi mathiyan
<arasilinux1086@...> wrote:
>
> Dear All
>
> Good Morning!
>
> In my project, I am trying to create one custom image recipe in my yocto build system.
>
>  The reason of creating custom image is  -> having few specific configurations for kernel and some specific driver Makefile changes to enable coverage.
>
>  I cannot go with .bbappend file, because we are maintaining a recipes-append folder in our meta-layer which is common for all the production build image recipes.
>
>  My change is very specific it should not come as part of normal build images because it will affect the production build.
>
>  My use case:
>
> 1. I have one .cfg file for kernel - which has kernel specific configurations.
>
> 2. I have Makefile changes for driver file.
>
>  I should bring the above changes to kernel and  driver Makefile during build time without using .bbappend file.
>
>  I want to create a custom image recipe with the specific changes.
>
>  For example : custom_image.bb =( This recipes should have core_image_minimal.bb + my specific changes)
>
>  When i build bitbake custom_image.bb,  it should  build  with core_image_minimal.bb + my specific changes .
>
> Other images recipes also should not affect by this changes.
>
> My humble request. Can anyone please support how to proceed?
>
> Kindly share your suggestions.
>
>  Regards
>
> Senthamilarasi. M
>
>
>
>


Alexandre Belloni
 

On 28/06/2022 17:21:22+0530, Senthamilarasi mathiyan wrote:
Dear All

Good Morning!

In my project, I am trying to create one custom image recipe in my yocto
build system.

The reason of creating custom image is -> having few specific
configurations for kernel and some specific driver Makefile changes to
enable coverage.

I cannot go with .bbappend file, because we are maintaining a
recipes-append folder in our meta-layer which is common for all the
production build image recipes.

My change is very specific it should not come as part of normal build
images because it will affect the production build.

My use case:

1. I have one .cfg file for kernel - which has kernel specific
configurations.

2. I have Makefile changes for driver file.

I should bring the above changes to kernel and driver Makefile during
build time without using .bbappend file.

I want to create a custom image recipe with the specific changes.

For example : custom_image.bb =( This recipes should have
core_image_minimal.bb + my specific changes)

When i build bitbake custom_image.bb, it should build with
core_image_minimal.bb + my specific changes .

Other images recipes also should not affect by this changes.

My humble request. Can anyone please support how to proceed?
You can't, a recipe can't affect any other recipe. When building
custom_image.bb, it is too late to introduce any kernel change.

Kindly share your suggestions.

*Regards*

*Senthamilarasi. M*




--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


Senthamilarasi mathiyan
 

Hi Alexandre, 

I am not pushing any changes to open source kernel. I want to enable few driver module in the kernel. That configuration want to have in file/ folder. 

My changes. 
Kern


On Wed, 29 Jun, 2022, 1:37 pm Alexandre Belloni, <alexandre.belloni@...> wrote:
On 28/06/2022 17:21:22+0530, Senthamilarasi mathiyan wrote:
> Dear All
>
> Good Morning!
>
> In my project, I am trying to create one custom image recipe in my yocto
> build system.
>
>  The reason of creating custom image is  -> having few specific
> configurations for kernel and some specific driver Makefile changes to
> enable coverage.
>
>  I cannot go with .bbappend file, because we are maintaining a
> recipes-append folder in our meta-layer which is common for all the
> production build image recipes.
>
>  My change is very specific it should not come as part of normal build
> images because it will affect the production build.
>
>  My use case:
>
> 1. I have one .cfg file for kernel - which has kernel specific
> configurations.
>
> 2. I have Makefile changes for driver file.
>
>  I should bring the above changes to kernel and  driver Makefile during
> build time without using .bbappend file.
>
>  I want to create a custom image recipe with the specific changes.
>
>  For example : custom_image.bb =( This recipes should have
> core_image_minimal.bb + my specific changes)
>
>  When i build bitbake custom_image.bb,  it should  build  with
> core_image_minimal.bb + my specific changes .
>
> Other images recipes also should not affect by this changes.
>
> My humble request. Can anyone please support how to proceed?
>

You can't, a recipe can't affect any other recipe. When building
custom_image.bb, it is too late to introduce any kernel change.

> Kindly share your suggestions.
>
>  *Regards*
>
> *Senthamilarasi. M*
>
> ​

>
>
>


--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


Senthamilarasi mathiyan
 

Hi Alexandre,

Good Morning! 


I am not introducing any change to kernel.

 

This is one of my project requirement to enable coverage support to kernel for specific build for my project.

 

In my project, Already we have few image recipes.

Ex: core_image_minimal.bb core_image_a.bb core_image_b.bb

 

These image recipes are using same kernel  with same configuration, Apart from default kernel configuration, I want to enable few driver support in kernel to enable coverage support for specific requirement.


To enable coverage support in kernel, I have added coverage.cfg in meta-layer.

Ex: /recipes-kernel/linux-msm/files/coverage.cfg

 

cat coverage.cfg

CONFIG_GCOV=y

CONFIG_DEBUG_FS=y

CONFIG_GCOV_KERNEL=y

 

If I add coverage.cfg in my kernel recipe(snippet below) - It will be taken for all the image build. Whenever do bitbake of following recipe - core_image_minimal.bbcore_image_a.bbcore_image_b.bb

 

The below changes will be added to the build, since this kernel is common for all the image recipes(core_image_minimal.bb core_image_a.bb core_image_b.bb).

 

Recipe content:

 

+++ b/recipes-kernel/linux-kernel/linux-kernel_5.x.bb

@@ -21,6 +21,7 @@ SRC_URI = "\

           file://audio-kpi.cfg \

           file://ptp-virtual.cfg \

           file://xfs.cfg \

+          file://coverage.cfg \

           ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' file://systemd.cfg', '', d)} \

           ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', ' file://virtualization.cfg', '', d)} \

      

 

 Similarly, I have patch for file other recipes.

 

 In my case, I should not add this change to all the image build.


My requirement: 

I want to create separate image recipe. Ex: core_image_myrecipe.bb

 

In this recipes 

- I should include "inherit core-image-minimal" + "My specific coverage_support changes".

As per project requirement, I should not create a separate meta layer to maintain this patches.

 

Can you please help for creating a separate image recipe with specific changes?


Regards

Senthamilarasi.M

 


On Thu, Jul 14, 2022 at 10:12 AM Senthamilarasi mathiyan <arasilinux1086@...> wrote:
Hi Alexandre, 

I am not pushing any changes to open source kernel. I want to enable few driver module in the kernel. That configuration want to have in file/ folder. 

My changes. 
Kern

On Wed, 29 Jun, 2022, 1:37 pm Alexandre Belloni, <alexandre.belloni@...> wrote:
On 28/06/2022 17:21:22+0530, Senthamilarasi mathiyan wrote:
> Dear All
>
> Good Morning!
>
> In my project, I am trying to create one custom image recipe in my yocto
> build system.
>
>  The reason of creating custom image is  -> having few specific
> configurations for kernel and some specific driver Makefile changes to
> enable coverage.
>
>  I cannot go with .bbappend file, because we are maintaining a
> recipes-append folder in our meta-layer which is common for all the
> production build image recipes.
>
>  My change is very specific it should not come as part of normal build
> images because it will affect the production build.
>
>  My use case:
>
> 1. I have one .cfg file for kernel - which has kernel specific
> configurations.
>
> 2. I have Makefile changes for driver file.
>
>  I should bring the above changes to kernel and  driver Makefile during
> build time without using .bbappend file.
>
>  I want to create a custom image recipe with the specific changes.
>
>  For example : custom_image.bb =( This recipes should have
> core_image_minimal.bb + my specific changes)
>
>  When i build bitbake custom_image.bb,  it should  build  with
> core_image_minimal.bb + my specific changes .
>
> Other images recipes also should not affect by this changes.
>
> My humble request. Can anyone please support how to proceed?
>

You can't, a recipe can't affect any other recipe. When building
custom_image.bb, it is too late to introduce any kernel change.

> Kindly share your suggestions.
>
>  *Regards*
>
> *Senthamilarasi. M*
>
> ​

>
>
>


--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


Quentin Schulz
 

Hi Senthamilarasi.M,

On 7/14/22 06:59, Senthamilarasi mathiyan wrote:
Hi Alexandre,
Good Morning!
I am not introducing any change to kernel.
This is one of my project requirement to enable coverage support to kernel
for specific build for my project.
In my project, Already we have few image recipes.
Ex: core_image_minimal.bb core_image_a.bb core_image_b.bb
These image recipes are using same kernel with same configuration, Apart
from default kernel configuration, I want to enable few driver support in
kernel to enable coverage support for specific requirement.
To enable coverage support in kernel, I have added coverage.cfg in
meta-layer.
Ex: /recipes-kernel/linux-msm/files/coverage.cfg
cat coverage.cfg
CONFIG_GCOV=y
CONFIG_DEBUG_FS=y
CONFIG_GCOV_KERNEL=y
If I add coverage.cfg in my kernel recipe(snippet below) - It will be taken
for all the image build. Whenever do bitbake of following recipe -
core_image_minimal.bb, core_image_a.bb, core_image_b.bb
The below changes will be added to the build, since this kernel is common
for all the image recipes(core_image_minimal.bb core_image_a.bb
core_image_b.bb).
Recipe content:
+++ b/recipes-kernel/linux-kernel/linux-kernel_5.x.bb
@@ -21,6 +21,7 @@ SRC_URI = "\
file://audio-kpi.cfg \
file://ptp-virtual.cfg \
file://xfs.cfg \
+ file://coverage.cfg \
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '
file://systemd.cfg', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', '
file://virtualization.cfg', '', d)} \
Similarly, I have patch for file other recipes.
In my case, I should not add this change to all the image build.
My requirement:
I want to create separate image recipe. Ex: core_image_myrecipe.bb
In this recipes
- I should include "inherit core-image-minimal" + "My specific
coverage_support changes".
As per project requirement, I should not create a separate meta layer to
maintain this patches.
Can you please help for creating a separate image recipe with specific
changes?
It is not possible to modify a recipe from another recipe. Meaning you cannot decide which config file to use for the kernel from the image recipe.

You have however two options:
- only include this configuration file for a given machine (you therefore need a new machine). This makes sense if the actual target HW is different,
- only include this configuration file for a given distro (you therefore need a new distro file). This makes sense if the actual target HW is the same for all configuration file of your kernel, just that they differ in terms of "policy".

If you're trying to build "a debug image", it is most likely a new distro you're after.

However, there could be a way to still do this with images and that is with the use of kernel modules. The plan would be to *always* build GCOV, DEBUG_FS and GCOV_KERNEL as modules (if even possible?). Yocto actually splits kernel modules in their own packages. Therefore, you could have the default configuration for your kernel used in all images, but have your special coverage image include also kernel-module-gcov/debug-fs/gcov-kernel/etc.. packages and modprobe/insmod them at boot when needed.

Cheers,
Quentin