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 owncustom-fitimage.bbclass
to get around this. The xilinx-fitimage 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 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.