I’m using Openembedded to generate a full target image (boot/kernel/rootfs…)
I had my own meta directory with a “recipes-kernel/linux” directory. Here are the folder/files:
conf
layer.conf
machine
colibri-imx7.conf
recipes-kernel/
linux-toradex_4.1.15.bbappend
linux-toradex/
files/
- defconfig
In the linux-toradex_4.1.15.bbappend file, I add defconfig to the SRC_URI. If I remove the defconfig file, there is an error when trying to compile the kernel. But when the defconfig file is present, it is like it is not used. My modifications are not present in the config file of the build directory. Any idea what is wrong?
The meta priority is set to 90, highest in the project, so it should be used.
That is true. But easyest way to test configuration would be to make the
bitbake linux-toradex -c menuconfig
And then save the defconfig in my layer. Any idea why the defconfig used is always the Toradex one, even if I change the priority to 91?
Otherwise I will have to compare files, see what is removed, what is added… quite long just for tests…
The above source tree is sort of strange.
I would expect that the bbappend file would be the linux-toradex directory, not in recipes-kernel. (But of course your layer.conf could contain an unusual search pattern for bbappend files)
Then you’re bbappend need probably only contain the following line:
FILESEXTRAPATHS_prepend := “${THISDIR}/files:”
If you delete both your defconfig and the defconfig in meta-toradex-nxp you will get a bitbake error message with a list of directories search in turn for the defconfig file. That should contain your directory before any other one.
About directory, mine looks like meta-toradex-nxp.
Anyway, my defconfig is found by bitbake. If I remove it, I have an error “Failed to fetch…”
If I put it back, bitbake kernel compilation work fine. But when I check in the build directory, the .config file is generated from the Toradex defconfig, and not mine.
It is working like if Toradex recipe is applied after mine…
I came across the this issue today, while searching a possibility to customize the kernel config for colibri-imx6.
Basically I do like the idea of modifying the existing defconfig file as suggested in thecomments above. But I’ve found that do_configure_prepend() is not the right place to modify ${WORKDIR}/defconfig. Two working solutions for me are:
Either to modify ${WORKDIR}/defconfig in do_preconfigure_prepend()
Or to modify ${B}/.config in do_configure_prepend()
This is because do_preconfigure() copies ${WORKDIR}/defconfig to ${B}/.config.
I share your pain, OpenEmbedded drives me crazy sometimes too, I guess that is just the nature of such a complex beast…
That said, I created a layer ontop of our layer recently for our Low Power Demo, and it seemed to work there:
I think what happens here is that OE prefers the defconfig in the meta-toradex-nxp layer since that is inside a machine specific directory (in this case colibri-imx7). OE precedence ${MACHINE}/file over file. In a quick test it seems to even prefer machine specific files in a “lower layer” also when prepending a path which contains a non-machine specific file of the same name. So in your case, moving defconfig to meta-mymeta/recipes-kernel/linux/linux-toradex/colibri-imx7/defconfig should help…
Some useful tips:
Use bitbake-layers show-layers to make sure the layer got applied
Use bitbake-layers show-appends | grep -A 5 linux-toradex to check that the bbappend gets properly applied
Sometimes checking the environment generated by a recipe helps (use bitbake -e linux-toradex > /tmp/env and then check /tmp/env)
It seem that the problem was with the “files” directory. If I put the defconfig file directly in the linux-toradex directory, it work!
So my meta looks like that:
Here my defconfig file is found (I change SRC_URI += “file://file/defconfig” to SRC_URI += “file://defconfig” in the bbhappend file) and is used to compile kernel!
I just wanted to share my setup, because it has worked quite well for me. First, I have my own layer in the bblayers setup with priority 91. bitbake-layers show-layers:
Now, you run bitbake -c menuconfig virtual/kerenel. Make your changes. Then run bitbake -c savedefconfig virtual/kerenel. The output of savedefconfig tells you where to fetch the config. Copy that config back to your own layer recipe-kernel/linux-mainline. Then you can bitbake -fc compile virtual/kernel and bitbake virtual/kerenel. For further tuning, you just got back to menuconfig and do it again.
That might sound tricky, but I do not need to maintain a separate kernel to tune the defconfig outside openembedded, and it’s clear which file is being used for our defconfig. When you overwrite your own defconfig, Ive found it a good idea to rename as backup, instead of overwrite, or delete. That way you can backtrack if you need to. Hope that helps.