Re: Remove kernel image and modules from rootfs

Quentin Schulz

Hi Konstantin,

On 12/21/22 22:13, Konstantin Kletschke wrote:
I am creating a rootfs/bootloader/kernel to run on a beaglebone black
usually and it works great.
So I have in conf/local.conf
MACHINE ?= "beaglebone-yocto"
and an own layer meta-insidem2m which defines some image settings in
recipes-core/images/ among other recipes for packages and
package modification.
Now I wan't to create a rootfs without the kernel image and the kernel
modules to make it as small as possible to use it as a basis to run as a
docker image.
Now I wonder how to instruct bitbake to not put the kernel image (and
modules) into the rootfs.
I read this was done by
but this is now deprecated for kirkstone and should be done this way:
This makes sense, I'll send a patch updating the documentation to reflect this change. I thought we already had discussed about this and someone sent a patch but doesn't seem so :/

But rootfs always still is equipped with kernel and modules.
I tried all permutations of
#RDEPENDS_kernel-base = ""
#RDEPENDS_kernel-base = ""
#PREFERRED_PROVIDER_virtual/kernel = "linux-dummy"
# Don't include kernels in standard images
##RDEPENDS:kernel-base = ""
in my conf/local.conf but no avail...
How is this done correctly?
Are there any variables to check I might have (being) set preventing me
to do this? Or is it necessary to split out a new MACHINE, i.e. can this
only be done in an own created machine which has to be split out?
I thought setting such at the bottom of conf/local.conf always "wins".

So I believe you need to add:
MACHINE_EXTRA_RRECOMMENDS:beaglebone-yocto = ""
MACHINE_ESSENTIAL_EXTRA_RDEPENDS:remove:beaglebone-yocto = "kernel-image kernel-devicetree"
to your local.conf

I suggest you create your own machine configuration file which requires beaglebone-yocto.conf where you'll be able to set:

since one is not supposed to share their local.conf :)

You can check the value of a variable by running bitbake-getvar -r virtual/kernel MACHINE_EXTRA_RRECOMMENDS for example.


Join to automatically receive all group messages.