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.

1 ACCEPTED SOLUTION

Accepted Solutions

Maybe you can try this instead in your layer:

KERNEL_CONFIG_FRAGMENTS:append = " \
    ${WORKDIR}/fragments/${LINUX_VERSION}/fragment-custom.config \
"

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.

View solution in original post

28 REPLIES 28
Erwan SZYMANSKI
ST Employee

Hello @Antoni Jankowski​ ,

That is strange that you need this FILESEXTRAPATHS.

Did you already check if your layer was well parsed by Yocto with doing the following command ?

PC $> bitbake-layers show-layers

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.
AJank.2
Associate III

Yes, the layer is visible and actually the first on the list of bitbake-layers show-layers. When trying without the FILESEXTRAPATHS below warning is displayed, which later turns into an error:

WARNING: /layers/meta-st/meta-st-stm32mp/recipes-kernel/linux/linux-stm32mp_5.15.bb: Unable to get checksum for linux-stm32mp SRC_URI entry fragment-custom.config: file could not be found

Erwan SZYMANSKI
ST Employee

@Antoni Jankowski​ ,

Is it possible for you to give me a tarball containing your my-layer ? I would like to reproduce from my side to understand the issue.

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.
AJank.2
Associate III

Sure, checkout my-layer.tar in the attachment. To replicate the issue, check the kernel config options set in my-layer/recipes-kernel/linux/linux-stm32mp/5.15/fragment-custom.config and then when the image is build and running check /proc/config.gz and compare them. In my case the options set in the fragment-custom.config are missing from the final running config.

Kind regards,

Antoni

Hello @Antoni Jankowski​ ,

Thanx for sharing, I will reproduce from my side.

Just to be sure to not face a typo issue, can you modify the name of your layer with adding "meta-" at the beginning ?

I think Yocto needs it in major situations, but I do not know in details how it can react if it does not find this prefix on a layer.

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.
AJank.2
Associate III

I think this is just the naming convention. I had to script the layer down out of all the proprietary names before sharing it with you. Anyway, I did my own fixing in the meantime, it could be so that the layer priority was at fault, as it was set to be the same as the original meta-st layers - at 6. Perhaps that through Yocto off the track. Let me know if you find something and I'll keep looking for errors as well.

I think this is just the naming convention. I had to script the layer down out of all the proprietary names before sharing it with you. Anyway, I did my own fixing in the meantime, it could be so that the layer priority was at fault, as it was set to be the same as the original meta-st layers - at 6. Perhaps that through Yocto off the track. Let me know if you find something and I'll keep looking for errors as well.

Interesting, so when you change the priority of "my-layer" to align it with the one of layer containing ST kernel, you do not have trouble anymore ?

Rgs,

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'm still waiting for the build to finish, will let you know once tested, hopefully in about an hour.