cancel
Showing results for 
Search instead for 
Did you mean: 

How to customize kernel configuration with OpenSTLinux and Yocto?

AJank.2
Associate III

Following the tutorial on How to customize the Linux kernel I made steps as below:

  1. Create a custom layer.
  2. Add it to the build configuration in bblayers.conf.
  3. Create a fragment.config with bitbake menuconfig and put it into my-layer/recipes-kernel/linux/linux-stm32mp/5.15/ as the kernel version is 5.15.
  4. Create a my-layer/recipes-kernel/linux/linux-stm32mp_%.bbappend file as advised in the tutorial:
FILESEXTRAPATHS:prepend := "${THISDIR}:${THISDIR}/${PN}:"
 
KERNEL_CONFIG_FRAGMENTS:append = "${WORKDIR}/fragments/${LINUX_VERSION}/fragment-custom.config"
SRC_URI:append = " file://${LINUX_VERSION}/fragment-custom.config;subdir=fragments "

It seems that the kernel configuration wasn't applied at all, is there something that I'm doing wrong?

Without the FILEXTRAPATHS line, the file couldn't be found, yocto didn't look into my-layer at all.

28 REPLIES 28

Well, if the file /tmp-glibc/work/stm32mp13_rt-ostl-linux-gnueabi/linux-stm32mp/5.15.67.rt49-stm32mp-r1-r0/build/.config is equivalent with the final configuration, then changing the layer priority didn't help at all.

OK I continue to test so.

By the way, I confirm that you need the

FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"

in your bbappend file, only way to ensure that the path is in the research path of Yocto.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Good to know, I think this should be included in your tutorial How to customize the Linux kernel: https://wiki.st.com/stm32mpu/wiki/How_to_customize_the_Linux_kernel

Yes, good remark, we will add it for sure.

By the way, I tested your layer on a standard weston image provided by ST.

It seems that the .config file is well modified in the build repository of Linux.

I give you my steps:

Put the attach layer under layers/meta-st

Then bitbake-layers add-layer ../layers/meta-st/meta-my-layer

Then bitbake linux-stm32mp

Finally, when I check <..>/build-openstlinuxweston-stm32mp15-disco/tmp-glibc/work/stm32mp15_disco-ostl-linux-gnueabi/.config it seems that your fragment is well taken into account.

Can you also double check from your side ?

Kind regards,

Erwan.

PS: I needed to adapt the layer.conf for my environment which is ST native delivery.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

I'll try that tomorrow, as today my work day is about to finish. There's one thing which I forgot to mention and may be quite important - instead of the disco image/distro/machine, I used the image with the RT patch, which means that meta-st-x-linux-rt layer with the stm32mp13-rt MACHINE were involved as well. Could it be so that the build behaves differently for the RT variant?

The other two things I get constantly are a WARNING message and a NOTE message as below, sorry for not mentioning about these before:

NOTE: ../layers/meta-st/meta-st-openstlinux/recipes-st/images/st-image-resize-initrd.bb: ENABLE_PARTITIONS_IMAGE not enabled2
WARNING: ../layers/meta-st/meta-st-stm32mp/recipes-kernel/linux/linux-stm32mp_5.15.bb:do_compile is tainted from a forced run

I'm not sure what "tainted" from a forced run means, this are messages run after bitbake st-image-weston.

Okay, thank you for your help, as mentioned already, I'll test your advice tomorrow.

OK thanx for the additional information.

Let me know tomorrow when you will have done your tests.

Kind regards,

Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

I just followed your steps and reproduced the fixes, indeed I can already see the config in tmp-glibc/work/stm32mp13_disco-ostl-linux-gnueabi/linux-stm32mp/5.15.67-stm32mp-r2-r0/build/.config. However I do have a few questions.

Beforehand I was building the st-image-weston, your advice says differently. Is there any benefit to using the linux-stm32mp image instead of st-image-weston, what's the difference between them? Actually, is that even an image? The contents of meta-st-stm32mp/recipes-kernel/linux/linux-stm32mp_5.15.bb do look like an image recipe, but it doesn't live in an image directory as it's usually the case. However there's plenty of images in meta-st-stm32mp layer, but in the meta-st-stm32mp/recipes-st/images directory. So I'm a bit confused, can you explain?

Also, how does that linux-stm32mp differ from the st-image-weston?

Hello @Antoni Jankowski​ ,

Sure, this is just to win some time :)

Indeed, I just build the Linux kernel recipe when I do this manipulation, because it saves me some time instead of compiling all the weston image. I just wanted to check and give you a quick answer.

Of course, building only the Linux recipe does not create you your final image. But when you compile st-image-weston it will also compile linux-stm32mp recipe.

So, in conclusion, you should be able to see the same .config generated when you do a bitbake st-image-weston (if not, there is an issue in the Yocto compilation).

Kind regards,

Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Okay, I'll check with the full st-image-weston and get back to you. There's a lot of checking to be happening today :(

Sure, let me know.

If you still does not see it at the very end, maybe make a try with putting your fragment in the x-linux-rt recipe to see if it changes something (because I do not have it on my baseline).

Kind regards,

Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.