Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

modifying kernel config in Yocto

I have tried for a long time to modify the kernel config without luck. :-(

There is a BSP in meta-xxx-yyy/ with recipes-kernel/linux/linux_git.bb. I try to override the kernel config in my layer named meta-xxx-mylayer where I have recipes-kernel/linux/linux_git.bbappend and recipes-kernel/linux/files/frag.cfg

frag.cfg:

# CONFIG_NETFILTER is not set
CONFIG_AUTOFS4_FS=y 

linux_git.bbappend:

COMPATIBLE_MACHINE_my_mach = "my_mach"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += "file://frag.cfg"

linux_git.bb: (just a part of the file)

KERNEL_RELEASE = "3.10"
PV = "3.10"
PR = "r10"
S = "${WORKDIR}/git"
COMPATIBLE_MACHINE = "(my_mach)"

meta-xxx-yyy/conf/machine/my_mach.conf: (there is no meta-xxx-mylayer/conf/machine/my_mach.conf)

PREFERRED_PROVIDER_virtual/kernel = "linux"
UBOOT_MACHINE = "socfpga_cyclone5_config"
KERNEL_MACHINE = "socfpga"

Build commands:

bitbake linux -c cleansstate -f
bitbake linux -c configure -f
bitbake linux -c compile -f
bitbake linux -c deploy -f

Everything builds, but when I inspect /proc/config.gz I can see that CONFIG_AUTOFS4_FS is not enabled.

I have another recipe in the meta-xxx-mylayer layer which builds and installs into rootfs just fine so I know that the layer is enabled.

The frag.cfg file is copied to ./tmp/work/my_mach-poky-linux-gnueabi/linux/3.10-r10/ during build, while the rest of the files are in ./tmp/work/my_mach-poky-linux-gnueabi/linux/3.10-r10/git/. Is that a problem?

What am I doing wrong???

like image 685
Michal Koziel Avatar asked Jun 24 '15 20:06

Michal Koziel


People also ask

How do I change kernel config?

To configure the kernel, change to /usr/src/linux and enter the command make config. Choose the features you want supported by the kernel. Usually, There are two or three options: y, n, or m. m means that this device will not be compiled directly into the kernel, but loaded as a module.

What is kernel in yocto?

3.2. Using Kernel Metadata in a Recipe. The kernel sources in the Yocto Project contain kernel Metadata, which is located in the meta branches of the kernel source Git repositories. This Metadata defines Board Support Packages (BSPs) that correspond to definitions in linux-yocto recipes for the same BSPs.


2 Answers

It is difficult to answer without seeing the real kernel recipe but what is probably happening is that the kernel recipe for the socfpga only inhertis kernel and not linux-yocto. If that is the case, then you can't change the configuration using fragments, you have to provide a full defconfig.

like image 74
Alexandre Belloni Avatar answered Sep 25 '22 09:09

Alexandre Belloni


maybe it is late but...

The kernel development have its own way for making changes. I put one post here yesterday but I understood I am wrong so I erased it immediately. I will not put the exact steps. Just short description. You should find them in yocto dev manual, because it is not something special.

The kernel changes should be made directly on the sources (usually in /workdir/tmp/). And then use git to make patches. If you make changes in configuration using bitbake -c menuconfig virtual/kernel, or other way, put it directly in kernel .bbappend file as you did. That definitely works. I tried with devtool almost the same and the patches were left not merged.

like image 39
Georgi Georgiev Avatar answered Sep 21 '22 09:09

Georgi Georgiev