The task do_kernel_configme is defined in yocto base layers and added to by meta-raspberrypi. How do I override only the parts added by meta-raspberrypi using a bbappend file?
Current setup is something like:
meta-mylayer rpi-recipe.bbappend do_kernel_configme_prepend()
meta-raspberrypi rpi-recipe.bb do_kernel_configme_prepend()
<yocto base layers> some-recipe.bb do_kernel_configme()
When I run this, both additions are prepended which means the "mylayer" code is run first, then meta-raspberrypi, then base.
How do I completely override the meta-raspberrypi additions so only the "mylayer" code followed by base layer code is executed.
(The same question also applies to do_configure task.)
Related
I have some self written yocto recipes, which create issues with the yocto sstate-cache mechanism (like not rebuilding the recipe when dependencies have changed). Is there a way to disable sstate-caching on a per recipe basis?
Searching the interwebs I can only find very old and by now broken mechanisms:
https://patchwork.openembedded.org/patch/17039/
Or only partial disable functions:
https://patchwork.openembedded.org/patch/130719/
My Yocto version is Zeus and above.
Thanks and cheers!
In the recipe:
SSTATE_SKIP_CREATION = "1"
or, from outside the recipe (e.g. local.conf):
SSTATE_SKIP_CREATION_pn-recipefoo = "1"
SSTATE_SKIP_CREATION_pn-recipebar = "1"
You can verify if sstate exists for a recipe, using oe-check-sstate, e.g.:
oe-check-sstate yourimage | grep recipefoo
and you can remove sstate for a recipe using:
bitbake -c cleansstate recipefoo
However, it is concerning that your recipe interferes with the sstate mechanism. Ensure that you are correctly setting & updating the version and revision of your packages whenever the source code changes.
If your recipe source is stored alongside your Yocto metadata, consider using externalsrc to reference it, allowing Yocto to better track changes.
I am using cl-som-imx7 board, using gatesgarth branch to setup the yocto env.
I have changed the kernel configurations by
Executing the command
bitbake -c memuconfig virtual/kernel
Rename the .config to defconfig
I don't have any luck in including those changes inside my build. Any suggestion would be appreciated.
The following section of the Yocto Manual illustrates how to do that:
https://www.yoctoproject.org/docs/2.5/kernel-dev/kernel-dev.html#changing-the-configuration
You basically need to rename this .config file to defconfig and add it with your kernel recipe to be as follows
linux_x.x.bb
linux
|
|_ defconfig
and add the following lines to your recipe:
# This to add the package name directory to search paths (i.e. The recipe name which is linux in this example)
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://defconfig"
Working on a couple of recipe's that have file conflicts with base packages.I am trying to figure out how to force override the conflicts. In particular I am overwriting the /etc/network/interfaces file with a custom one within my recipe. How do I tell bitbake that the file(s) in my package are to take precedence over the file(s) from the base packages?
I am using RPM as the package management subsystem with in the build environment.
Running transaction test
Error: Transaction check error:
file /etc/network/interfaces conflicts between attempted installs of router-1.0-r0.noarch and init-ifupdown-1.0-r7.qemuarm64
file /etc/udhcpc.d/50default conflicts between attempted installs of router-1.0-r0.noarch and busybox-udhcpc-1.24.1-r0.aarch64
You can't. Either don't install one of the packages in the conflict or override the original recipe's file with a bbappend.
I am trying to build core-image-minimal receipe for iMx7 (Yocto project), the image gets successfully built but it has bluetooth, caam and lot of other stuff. How can I remove these from including in the minimal-image?
core-image-minimal should only have things required for just booting nothing else, somehow other packages are getting added. I didnt add anything in my local.config file.
MACHINE = "imx7dsabresd"
bluetooth and wifi are enabled here:
imx7dsabresd.conf
You can add the following to your local.conf to remove bluetooth:
MACHINE_FEATURES_remove = "bluetooth"
CAAM is enabled in the kernel config here:
defconfig
To change the kernel configuration you can either provide a new defconfig or use a configuration fragment. The following steps describe how to create a config fragment.
Run the following command and deselect the bluetooth related config options:
bitbake -c menuconfig virtual/kernel
Run the following command to generate fragment.cfg in ${WORKDIR}
bitbake -c diffconfig virtual/kernel
At this point if you do not have your own layer, create one by following this guide:
Creating Your Own Layer
Create the directory for the .bbappend and the configuration fragment:
mkdir -p ${PATH_TO_YOUR_LAYER}/recipes-kernel/linux/linux-fslc-imx/linux-fslc-imx/
Move fragment.cfg from ${WORKDIR} to ${PATH_TO_YOUR_LAYER}/recipes-kernel/linux/linux-fslc-imx/linux-fslc-imx/
Create a ${PATH_TO_YOUR_LAYER}/recipes-kernel/linux/linux-fslc-imx_%.bbappend (assuming linux-fslc-imx is the correct kernel recipe for this board) and place the following in it:
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://fragment.cfg"
Additionally, you may find the Creating Configuration Fragments section of the manual helpful.
For more information about bbappends see:
mega-manual
You do not mention which machine you are building for, but I suspect it has bluetooth enabled in the MACHINE_FEATURES. I also didn't look at the bb file for core-image-minimal closely, so could be something else.
I am trying to write a .bbappend file that will append to the initramfs-live-boot_1.0.bb which has a statement inside the do_install() that writes the contents of init-live.sh, a shell script that manages the boot procedure, to init, an initialisation script that runs upon boot. The purpose of my .bbappend file is to reference a modified version of the startup script to be copied in place of the original without changing the base openembedded-core and/or poky environments. The .bbappend file and my version of the script is therefore placed in my project directory with the rest of my own recipes to be built.
My initramfs-live-boot_1.0.bbappend looks like this:
SUMMARY = "Replacement recipe"
FILESEXTRAPATH_prepend := "${THISDIR}/files:"
SRC_URI += "file://init.sh"
do_install_append() {
install -m 0755 ${WORKDIR}/init.sh ${D}/init
}
I have a folder files in the same directory as the .bbappend file that contains the init.sh script it should be reading from.
The problem is when I try to build the image, it spits out this error:
WARNING: Failed to fetch URL file://init.sh, attempting MIRRORS if available
and then attempts to search through the poky directory for the missing files rather than in my project directory.
Have I written my .bbappend file wrong? How would I go about editing the initramfs scripts using the .bbappend file?
FILESEXTRAPATH_prepend := "${THISDIR}/files:" should be FILESEXTRAPATHS_prepend := "${THISDIR}/files:". Note the last S in FILESEXTRAPATHS.
That should make it work for you.
Another improvement would be to rename you file file from init.sh to init-live.sh. I.e. use the same name as the file in the original initramfs-live-bootrecipe. That would allow you to remove your do_install_append()-function as well as SRC_URI += "file://init.sh" from the bbappend. The recipe itself would handle those for you. Thus, the only line you'd actually need is the FILESEXTRAPATHS_prepend := "${THISDIR}/files:".