imx8mn configuration fragments not applied

cancel
Showing results for 
Search instead for 
Did you mean: 

imx8mn configuration fragments not applied

Jump to solution
192 Views
Contributor III

Hi there,

I try to implement a kernel configuration in yocto for imx8m nano evaluation kit.

Following steps of

Yocto Project Linux Kernel Development Manual 

5.6.2. Creating Configuration Fragments

I put a .cfg file in my own layer under recipes-kernel/linux/files

with content

CONFIG_ARCH_BCM2835=y

and called it in linux-imx_5.4.bbappend

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI += "file://bcm2835.cfg"

but in my work directory under linux-imx/5.4-r0/

it does neither appear in defconfig nor /build/.config

In build/.config there is

# CONFIG_ARCH_BCM2835 is not set

This happens to all configurations that I tried to make.

Is there anything I forgot to do?

Best regards,

Silke

Labels (1)
1 Solution
51 Views
NXP TechSupport
NXP TechSupport

Hello Silke,

My apologies, the path looks correct. And proof of that is that bitbake is seeing the .bbappend, as you said.

What I meant is that the bbappend you showed lists the location of the configuration fragment, but I don't see that the append is listing what to do with it, like adding this fragment to the original configuration

do_configure_append() {
         #this is run from
        #./tmp/work/<MACHINE>-poky-linux-gnueabi/linux-imx/3.14.52-r0/git
         cat ../*.cfg >> ${B}/.config
 }

(Example taken from https://community.nxp.com/docs/DOC-334088 , for an older BSP, but the logic should remain similar)

I hope this makes sense.


Regards,

View solution in original post

0 Kudos
6 Replies
51 Views
NXP TechSupport
NXP TechSupport

Hello Silke,

The steps followed are correct. However, since the file is not used it’s not being added to the final image. You would need to call the fragment file on the append to the kernel like it’s mentioned on this section:

https://www.yoctoproject.org/docs/3.0/dev-manual/dev-manual.html#using-bbappend-files

As a side note, the link you shared is for the 1.6 poky release. You can switch to the poky release you are using by changing the version on the URL. The latest BSPs are 3.0.

I hope this helps!

Regards,

51 Views
Contributor III

Hi gusarambula,

Perhaps I misunderstood the complete bitbake process.

I thought that I already did all that.

I made the linux-imx_5.4.bbappend for the linux-imx.bb file in meta-layer from nxp

meta-imx/meta-bsp/recipes-kernel/linux/linux-imx_5.4.bb,

because I thought, that these are the kernel-files from nxp to build on top of.

So, the structure is like:

...meta-imx/.../linux-imx_5.4.bb

...meta-own-layer/.../linux/linux-imx_5.4.bbappend

      with

      FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

      SRC_URI += "file://bcm2835.cfg"

...meta-own-layer/.../linux/files/bcm2835.cfg

      with

      CONFIG_ARCH_BCM2835=y

Did I use the wrong kernel? How can I find out, for wich kernel source I should make the bbappend file?

Thanks for the hint, that i used an outdated manual. I updated that :smileyhappy:

Best regards and have a nice weekend,

Silke

0 Kudos
51 Views
NXP TechSupport
NXP TechSupport

Hello Silke,

It appears that the path on the new layer is missing a /linux/ folder (although it wasn’t very clear to me as it is present on the second part where you give the location of the sources for the append)   . Bitbake looks for the append files on the same path of the original recipe. The layer priority is also important, as the layer should have a higher priority than the original layer so that it’s append is used with the highest priority.

The kernel you are using is correct, you just need to make sure that bitbake can find the append file. And the append file must have the instruction to add the required fragment to the configuration, as what you are appending is the recipe, not the kernel source. Which means, your recipe will have access to the fragment as you are adding it to the recipe, but you need to tell bitbake what to do with this new file.

I hope this helps!

Regards,

0 Kudos
51 Views
Contributor III

Hi gusarambula,

Sorry for the misunderstanding. I should have made that more clear.

Could you explain, where I miss the linux folder? As concerning the path for my append file,

it is

...meta-own-layer/recipes-kernel/linux/linux-imx_5.4.bbappend

which includes the linux folder, or am I wrong? The same as in the original path

...meta-imx/meta-bsp/recipes-kernel/linux/linux-imx_5.4.bb

When I run

bitbake-layers show-appends | grep linux-imx

my append file is displayed

linux-imx_5.4.bb:
/home/user/Builds/imx-yocto-bsp/sources/meta-own-layer/recipes-kernel/linux/linux-imx_5.4.bbappend

My level-priority is set to 10, which is more then all other layers

bitbake-layers show-layers
NOTE: Starting bitbake server...
layer path priority
==========================================================================
meta /home/user/Builds/imx-yocto-bsp/sources/poky/meta 5
...
meta-freescale-3rdparty /home/user/Builds/imx-yocto-bsp/sources/meta-freescale-3rdparty 4
meta-freescale-distro /home/user/Builds/imx-yocto-bsp/sources/meta-freescale-distro 4
meta-bsp /home/user/Builds/imx-yocto-bsp/sources/meta-imx/meta-bsp 8
meta-sdk /home/user/Builds/imx-yocto-bsp/sources/meta-imx/meta-sdk 8
meta-ml /home/user/Builds/imx-yocto-bsp/sources/meta-imx/meta-ml 8
... (I quit a few for readability)
meta-prologistik /home/user/Builds/imx-yocto-bsp/sources/meta-own-layer 10

and even the patches that I made are applyed, which I can see in the log file from the do_patch

~/Builds/imx-yocto-bsp/build-xwayland/tmp/work/imx8mnevk-poky-linux/linux-imx/5.4-r0/temp/log.do_patch

where the Build searches for the patches and applies them afterwards:

DEBUG: Executing python function extend_recipe_sysroot
NOTE: Direct dependencies are ['/home/silkoman/Builds/imx-yocto-bsp/sources/poky/meta/recipes-devtools/quilt/quilt-native_0.66.bb:do_populate_sysroot']
NOTE: Installed into sysroot: []
NOTE: Skipping as already exists in sysroot: ['quilt-native']
DEBUG: Python function extend_recipe_sysroot finished
DEBUG: Executing python function do_patch
DEBUG: Executing python function patch_do_patch
DEBUG: Searching for 0001-adding-spi-it8951-to-imx8mn.patch in paths:

...

(going through paths)

...

DEBUG: Searching for 0002-disable-dma-in-spi.patch in paths:

...

DEBUG: Searching for bcm2835.cfg in paths:

...

NOTE: Applying patch '0001-adding-spi-it8951-to-imx8mn.patch' (../sources/meta-prologistik/recipes-kernel/linux/linux-imx/0001-adding-spi-it8951-to-imx8mn.patch)
NOTE: Applying patch '0002-disable-dma-in-spi.patch' (../sources/meta-prologistik/recipes-kernel/linux/linux-imx/0002-disable-dma-in-spi.patch)

...

DEBUG: Python function patch_do_patch finished
DEBUG: Python function do_patch finished
DEBUG: Executing python function do_qa_patch
DEBUG: Python function do_qa_patch finished

So it seems like the patches are applyed but the .cfg is not applyed as a config change.

This is the normal way to do it, but it seems, that the meta-imx kernel recipe does not inherit the standard kernel.bbclass.

So I guess by saying " the append file must have the instruction to add the required fragment to the configuration" means, that this behaviour is not implemented and I have to find the way, the yocto guys do that normally, right?

Best regards and have a nice week,

Silke

0 Kudos
52 Views
NXP TechSupport
NXP TechSupport

Hello Silke,

My apologies, the path looks correct. And proof of that is that bitbake is seeing the .bbappend, as you said.

What I meant is that the bbappend you showed lists the location of the configuration fragment, but I don't see that the append is listing what to do with it, like adding this fragment to the original configuration

do_configure_append() {
         #this is run from
        #./tmp/work/<MACHINE>-poky-linux-gnueabi/linux-imx/3.14.52-r0/git
         cat ../*.cfg >> ${B}/.config
 }

(Example taken from https://community.nxp.com/docs/DOC-334088 , for an older BSP, but the logic should remain similar)

I hope this makes sense.


Regards,

View solution in original post

0 Kudos
51 Views
Contributor III

Hi gusarambula,

this makes absolutely sense and it is working like a charm.

Thanks a lot!!!

I included some additions/conditions, so that bitbake will not stop with error, when no .cfg file is present:

do_configure_append() {
   for i in ../*.cfg; do
      [ -f "$i" ] || break
      bbdebug 2 "applying $i file contents to .config"
      cat ../*.cfg >> ${B}/.config
   done
}

Tanks again and have a nice weekend :smileyhappy:

Silke

0 Kudos