# Xilinx Zynq - change mender to have rootfs inside fit image

**URL:** <https://hub.mender.io/t/xilinx-zynq-change-mender-to-have-rootfs-inside-fit-image/1559>\
**Category:** General Discussions\
**Tags:** thud\
**Created:** [February 18, 2020, 8:41pm UTC](https://hub.mender.io/t/xilinx-zynq-change-mender-to-have-rootfs-inside-fit-image/1559 "2020-02-18T20:41:02Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![samlewis](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/samlewis/32/393_2.png) [@samlewis](https://hub.mender.io/u/samlewis)\
**Post date:** [February 19, 2020, 11:10am UTC](https://hub.mender.io/t/xilinx-zynq-change-mender-to-have-rootfs-inside-fit-image/1559/2 "2020-02-19T11:10:47Z")

</div>

I took a similar approach in using a FIT image to boot from and use as my update artifact. A few notes that might be helpful:

- The bitbake support in yocto/oe isn’t great and (from memory) the `kernel-fitimage.bbclass` class doesn’t let you bundle in an initramfs/squashfs image rootfs. I ended up making my own `custom-fitimage.bbclass` to get around this. The [xilinx-fitimage](https://github.com/Xilinx/meta-xilinx/blob/61e3825585a5616a01de9a2570b81cf9c8a91bb3/classes/xilinx-fitimage.bbclass) is a decent starting point for this. I now generate a FIT image with a kernel, device tree blob and squashfs blob.
- If you’re including a kernel binary (uImage or zImage) in the FIT image, I don’t think there’s any reason to also install them into the rootfs. I had to patch the Mender recipes to not install these (the line responsible is `MACHINE_ESSENTIAL_EXTRA_RDEPENDS_append_mender-image_arm = " kernel-image kernel-devicetree"`). I’m not familiar with Petalinux but there might be some other recipes that cause kernel images to be installed to `/boot/` on the rootfs - I’d just grep through the recipe files and see if you can modify the recipe or avoid invoking it all.
- You will need to patch the Mender uboot patches to work with FIT images. Some of the stuff the Mender uboot functions try to do by default, like loading the kernel from disk and changing the cmdline parameters to boot with a rootfs directly on a disk partition, obviously needs to be different.
- You might also need to patch the Mender daemon code so that it can successfully recognise the correct partition to flash if you’re going to run with an initramfs out of RAM. See [this thread](https://hub.mender.io/t/updating-when-rootfs-is-in-ram/1127/5) for some more details.

I’d like to eventually contribute some of this work back upstream, but unfortunately it’s time consuming to structure it in a generic way that doesn’t interfere with other use cases.

---

_[View the full topic](https://hub.mender.io/t/xilinx-zynq-change-mender-to-have-rootfs-inside-fit-image/1559)._
