Why does the boot partition contain the Kernel Image and Devicetree?

Hi all

I’m using the meta-mender layer, branch zeus to generate an image using Mender. I noticed that the boot partition (/uboot when using U-Boot) contains the Kernel Image and Devicetree. They are identical to the image and Devicetree on the root partition, directory /boot.

After digging in the meta-mender layer I think mender_merge_bootfs_and_image_boot_files() in meta-mender/meta-mender-core/classes/mender-helpers.bbclass is responsible for that. So I assume this is done intentionally by Mender.

But why? Is this some kind of fall back for cases in which both root partitions are corrupted? I don’t see how the image on the boot partition would ever be loaded by U-Boot though. So what’s the purpose of those duplicates?

Thanks in advance
David

I think this comes from the IMAGE_BOOT_FILES variable, which is not set by Mender. The kernel should be removed from there, but the devicetree probably needs remain since the boot loader typically needs it. It depends on the exact boot loader configuration though.

You’re right, thanks. It’s set by my machine.conf.

@ddroe
sorry but how did you figure out that it’s set by machine.conf ?
and how did you remove it ?

Hi @andrew_brd,

Usually your best bet to look into such things is using bitbake-getvar -r core-image IMAGE_BOOT_FILES (with core-image being replaceable by your image in question) if you are on a recent Yocto distribution. This should give you the full evaluation history of the variable and how things end up there. On older releases, you‘ll have to resort to searching bitbake -e.

Generally speaking, Mender uses kernel and device tree from the A/B partitions unless the integration decides otherwise. If you can share which particular board and setup you are on, I can also have a look.

Greetz,
Josef

@TheYoctoJester
Thank you for reaching out and for your reply .
generally speaking The boot partition contains a kernel image that is put there by bitbake machinery
I noticed the name is kernel.img but it’s not obvious who is installing it into my rootfs
here ~/usr/lib/grub/x86_64-efi/kernel.img
I also noticed that grub and grub-efi recipes contain this kernel.img in their workdir
so I was wondering how can I remove it in this case ?