14
votes

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???

5
Did you ever figure it out? I have the same problem. The patch file is applied, the cfg file is ignored.izak

5 Answers

6
votes

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.

4
votes

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.

4
votes

The simple way to make modifying kernel config using menuconfig in Yocto is :-

bitbake -c menuconfig virtual/kernel
3
votes

I agree with Alexandre Belloni, but with a small correction. If your kernel recipe (linux_git.bb) only inherits from kernel and not kernel-yocto, then you cannot use configuration fragments.

Unfortunately, I was not able to see any explanation of this in the docs, but looking at

kernel-yocto.bbclass:

# returns all the elements from the src uri that are .scc files
def find_sccs(d):
    sources=src_patches(d, True)
    sources_list=[]
    for s in sources:
        base, ext = os.path.splitext(os.path.basename(s))
        if ext and ext in [".scc", ".cfg"]:
            sources_list.append(s)
        elif base and base in 'defconfig':
            sources_list.append(s)

    return sources_list



    sccs="$sccs ${@" ".join(find_sccs(d))}"
    patches="${@" ".join(find_patches(d))}"
    feat_dirs="${@" ".join(find_kernel_feature_dirs(d))}"



    # updates or generates the target description
    updateme ${updateme_flags} -DKDESC=${KMACHINE}:${LINUX_KERNEL_TYPE} \
                         ${includes} ${addon_features} ${ARCH} ${KMACHINE} ${sccs} ${patches}

you can see that any file with the extension .cfg gets added to the sccs variable, which gets used in the updateme kernel tool.

0
votes

are the dependencies for your kernel configuration flag resolved properly ? I guess this would be the problem in this case