Excluding the kernel and dtb files from the rootfs

Hello,

I’m using Yocto Dunfell and meta-mender to create an image for the Colibri IMX6ULL board. The default image (without mender) does not include the kernel in the file system, whereas the mender layer does. I need to exclude the kernel and dtb files from the root file system, but am struggling to figure out how turn that off in the mender layer. I’ve made sure to remove “kernel-image” and “kernel-devicetree” from MACHINE_ESSENTIAL_EXTRA_RDEPENDS (verified by running bitbake -e), but the files are still there in /boot. Completely removing the mender layer solves the issue, so it’s definitely something there. Any thoughts?

Hm, MACHINE_ESSENTIAL_EXTRA_RDEPENDS should enough,

Are you using one of the meta-mender-community layers as well?

Can you check your IMAGE_INSTALL?

Hi Mirza,

I’m removing kernel-image and kernel-devicetree from MACHINE_ESSENTIAL_EXTRA_RDEPENDS in my image recipe:

# Don't install the kernel and dts into the rootfs
MACHINE_ESSENTIAL_EXTRA_RDEPENDS_remove = "kernel-image kernel-devicetree"

Running bitbake idh-os-image -e shows that the variable is indeed being cleared (idh-os-image is my custom image recipe):

# $MACHINE_ESSENTIAL_EXTRA_RDEPENDS [7 operations]
#   set /workdir/build/../layers/openembedded-core/meta/conf/documentation.conf:277
#     [doc] "A list of required machine-specific packages to install as part of the image being built. Because this is a 'machine essential' variable, the list of packages are essential for the machine to boot."
#   set? /workdir/build/../layers/openembedded-core/meta/conf/bitbake.conf:823
#     ""
#   _append[mender-image_x86] /workdir/build/../layers/meta-mender/meta-mender-core/classes/mender-setup-image.inc:8
#     " kernel-image"
#   _append[mender-image_x86-64] /workdir/build/../layers/meta-mender/meta-mender-core/classes/mender-setup-image.inc:9
#     " kernel-image"
#   _append[mender-image_arm] /workdir/build/../layers/meta-mender/meta-mender-core/classes/mender-setup-image.inc:10
#     " kernel-image kernel-devicetree"
#   _append[mender-image_aarch64] /workdir/build/../layers/meta-mender/meta-mender-core/classes/mender-setup-image.inc:11
#     " kernel-image kernel-devicetree"
#   _remove /workdir/build/../layers/meta-precept/recipes-images/images/idh-os-image.bb:55
#     "kernel-image kernel-devicetree"
# pre-expansion value:
#   " kernel-image kernel-devicetree"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS="  "

IMAGE_INSTALL seems OK:

# $IMAGE_INSTALL [6 operations]
#   set /workdir/build/../layers/openembedded-core/meta/conf/documentation.conf:216
#     [doc] "Specifies the packages to install into an image. Image recipes set IMAGE_INSTALL to specify the packages to install into an image through image.bbclass."
#   _append /workdir/build/../layers/meta-mender/meta-mender-core/classes/mender-setup.bbclass:220
#     " mender-client"
#   set? /workdir/build/../layers/openembedded-core/meta/classes/core-image.bbclass:73
#     "${CORE_IMAGE_BASE_INSTALL}"
#   set? /workdir/build/../layers/openembedded-core/meta/classes/image.bbclass:80
#     ""
#   set /workdir/build/../layers/openembedded-core/meta/classes/image.bbclass:81
#     [type] "list"
#   append /workdir/build/../layers/meta-precept/recipes-images/images/idh-os-image.bb:43
#     "     packagegroup-boot     packagegroup-basic     packagegroup-base-tdx-cli     packagegroup-machine-tdx-cli     packagegroup-wifi-tdx-cli     packagegroup-wifi-fw-tdx-cli     udev-extraconf     ${CONMANPKGS}     ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'timestamp-service systemd-analyze', '', d)}     packagegroup-idh-os     packagegroup-precept "
# pre-expansion value:
#   "${CORE_IMAGE_BASE_INSTALL}      packagegroup-boot     packagegroup-basic     packagegroup-base-tdx-cli     packagegroup-machine-tdx-cli     packagegroup-wifi-tdx-cli     packagegroup-wifi-fw-tdx-cli     udev-extraconf     ${CONMANPKGS}     ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'timestamp-service systemd-analyze', '', d)}     packagegroup-idh-os     packagegroup-precept  mender-client"
IMAGE_INSTALL="    packagegroup-core-boot     packagegroup-base-extended                    packagegroup-boot     packagegroup-basic     packagegroup-base-tdx-cli     packagegroup-machine-tdx-cli     packagegroup-wifi-tdx-cli     packagegroup-wifi-fw-tdx-cli     udev-extraconf     connman connman-plugin-loopback connman-plugin-ethernet connman-plugin-wifi connman-client     timestamp-service systemd-analyze     packagegroup-idh-os     packagegroup-precept  mender-client"

Edit: I’m only using the meta-mender layer.

Just to confirm - the problem was the fact that I was clearing MACHINE_ESSENTIAL_EXTRA_RDEPENDS in my image recipe. Placing it in local.conf resolves the issue.

1 Like