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

The problem reappears with usage of meta-st-x-linux-rt layer, this time the layer doesn't even compile. The log error.log.do_configure.txt from the build process is attached to this message, maybe you could help with that somehow? There's constantly that message

WARNING: ../layers/meta-st/meta-st-stm32mp/recipes-kernel/linux/linux-stm32mp_5.15.bb:do_compile is tainted from a forced run

OK so it may be linked to the way x-linux-rt and your layer interact to overwrite kernel configuration.

I will bring the x-linux-rt myself this afternoon to see what happens.

By the way, I took a look at your logs and the path where Yocto is looking for your fragment is very strange, did you notice it ? (/home/AJank2/OpenSTLinux/build-openstlinuxweston-stm32mp13-rt/tmp-glibc/work/stm32mp13_rt-ostl-linux-gnueabi/linux-stm32mp/5.15.67.rt49-stm32mp-r1-r0/linux-5.15.67/arch/arm/configs/fragment-08-rt-mp13.config/home/AJank2/OpenSTLinux/build-openstlinuxweston-stm32mp13-rt/tmp-glibc/work/stm32mp13_rt-ostl-linux-gnueabi/linux-stm32mp/5.15.67.rt49-stm32mp-r1-r0/fragments/5.15/fragment-custom.config)

I ask myself if this path is not the result of a space missing at the end of a KERNEL_CONFIG_FRAGMENTS = "....." or KERNEL_CONFIG_FRAGMENTS:append = "......"

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 did, but have no idea why this is the path that comes up, why would it be combined with the other path? That's stupid, isn't it? It's the same layer that you sent me without any modifications. Maybe that is the real problem then?, either I messed up the paths somehow, or yocto messed them up, but how?

I edited my previous answer, I think there is a space missing somewhere at the end of a KERNEL_CONFIG_FRAGMENT, and as the first part of the path is from Linux-rt, I think this is the x-linux-rt layer that causes this

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.

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.

Okay, I'm about to try that now, that'll be rather hilarious if that's the real problem - classic "lack of semicolon" mistake. By the way, is that line:

SRC_URI:class-devupstream += "file://${LINUX_VERSION}/fragment-custom.config;subdir=fragments "

any helpful? I saw the SRC_URI:class-devupstream in meta-st/meta-st-stm32mp/recipes-kernel/linux/linux-stm32mp_5.15.bb when trying to fix things and decided to use it as well in my bbappend file, but does it make any sense to use it?

Thank you for your help, that white space was indeed the solution. If you don't mind, please include the information about that white space in the how to article, it may still help many people! If not many, then I will definitely look at it many more times :D

Great news,

Sometimes, the smallest mistakes are the most difficult to detect...

Can I let you put the topic as answered ?

Kind regards,

Erwan.

In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

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.

Yes, I think the topic can be closed now. Thank you again for your help!