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

**URL:** <https://hub.mender.io/t/why-does-the-boot-partition-contain-the-kernel-image-and-devicetree/3927>\
**Category:** General Discussions\
**Tags:** yocto, zeus\
**Created:** [July 27, 2021, 12:19pm UTC](https://hub.mender.io/t/why-does-the-boot-partition-contain-the-kernel-image-and-devicetree/3927 "2021-07-27T12:19:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ddroe](https://avatars.discourse-cdn.com/v4/letter/d/58956e/32.png) [@ddroe](https://hub.mender.io/u/ddroe)\
**Post date:** [July 27, 2021, 12:19pm UTC](https://hub.mender.io/t/why-does-the-boot-partition-contain-the-kernel-image-and-devicetree/3927/1 "2021-07-27T12:19:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [August 2, 2021, 7:30am UTC](https://hub.mender.io/t/why-does-the-boot-partition-contain-the-kernel-image-and-devicetree/3927/2 "2021-08-02T07:30:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ddroe](https://avatars.discourse-cdn.com/v4/letter/d/58956e/32.png) [@ddroe](https://hub.mender.io/u/ddroe)\
**Post date:** [August 2, 2021, 1:45pm UTC](https://hub.mender.io/t/why-does-the-boot-partition-contain-the-kernel-image-and-devicetree/3927/3 "2021-08-02T13:45:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![andrew\_brd](https://avatars.discourse-cdn.com/v4/letter/a/f4b2a3/32.png) [@andrew\_brd](https://hub.mender.io/u/andrew_brd)\
**Post date:** [December 16, 2022, 10:51am UTC](https://hub.mender.io/t/why-does-the-boot-partition-contain-the-kernel-image-and-devicetree/3927/4 "2022-12-16T10:51:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [December 16, 2022, 11:07am UTC](https://hub.mender.io/t/why-does-the-boot-partition-contain-the-kernel-image-and-devicetree/3927/5 "2022-12-16T11:07:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![andrew\_brd](https://avatars.discourse-cdn.com/v4/letter/a/f4b2a3/32.png) [@andrew\_brd](https://hub.mender.io/u/andrew_brd)\
**Post date:** [December 19, 2022, 4:48pm UTC](https://hub.mender.io/t/why-does-the-boot-partition-contain-the-kernel-image-and-devicetree/3927/6 "2022-12-19T16:48:31Z")

</div>

@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 ?
