@martin
I am running Xilinx Petalinux, and we implemented Mender on Zynq7. Our setup might be close, so I’ll do my best to explain what we did. We run a fitimage (device-tree,kernel,rootfs) in ramdisk. The fitImage is the only thing inside the mender image in EMMC aside from the uEnv, and our fpgabin. We use /data location as persistent disk partition area.
First, you have to get the fiIimage working. In our project.conf for our main image we have something like this:
KERNEL_CLASSES = “kernel-fitimage”
KERNEL_IMAGETYPES = “fitImage”
INITRAMFS_IMAGE_BUNDLE = “1”
INITRAMFS_IMAGE = “your-user-image”
INITRAMFS_MAXSIZE = “16777216”
Once we had that, test it by downloading it TFTP and make sure it works the way you like.
Next, I tried in many ways to get the mender image to build from the above image, but couldn’t get it to work. And I don’t think an image can depend on an image? So we created a second image recipe local-mender-image.bb. So, we have to do a 2-step build, and you have to remember to clean your local-mender-image each time, but it works. The trick is, how do you remove all the extra junk from the image. You don’t want a kernel image inside your mender image plus the fitImage!
Here’s some of the recipe so you can get an idea how we did that. Sorry if it’s not complete, I’m just hoping to point you down a path that may work.
my_postprocess_function() {
rm -rf {IMAGE_ROOTFS}/etc
rm -rf {IMAGE_ROOTFS}/var
rm -rf {IMAGE_ROOTFS}/usr
cp {DEPLOY_DIR_IMAGE}/fitImage-petalinux-user-image-plnx-zynq7-plnx-zynq7 {IMAGE_ROOTFS}/boot/
ln -sf fitImage-petalinux-user-image-plnx-zynq7-plnx-zynq7 {IMAGE_ROOTFS}/boot/fitImage
install -d {IMAGE_ROOTFS}/data/mender
install -d {IMAGE_ROOTFS}/data/u-boot
echo “/dev/mmcblk0 0x800000 0x4000” >> {IMAGE_ROOTFS}/data/u-boot/fw_env.config
echo "/dev/mmcblk0 0x1000000 0x4000" >> {IMAGE_ROOTFS}/data/u-boot/fw_env.config
}
my_preprocess_function() {
rm -rf ${IMAGE_ROOTFS}/var
}
ROOTFS_POSTPROCESS_COMMAND_append = “my_postprocess_function;”
IMAGE_PREPROCESS_COMMAND = " my_preprocess_function;"
inherit image
MACHINE_ESSENTIAL_EXTRA_RDEPENDS_remove_petalinux-user-image = " kernel-image kernel-devicetree"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS_remove_mender-image_arm = " kernel-image kernel-devicetree"
PREFERRED_PROVIDER_u-boot-fw-utils = “u-boot-fw-utils”
PREFERRED_RPROVIDER_u-boot-fw-utils = “u-boot-fw-utils”
BIF_PARTITION_ATTR = “fsbl u-boot”
BOOTBIN_BASE_NAME = “BOOT”
IMAGE_BOOT_FILES = “uEnv.txt”
MENDER_STORAGE_DEVICE = “/dev/mmcblk0”
MENDER_STORAGE_TOTAL_SIZE_MB = “7168”
MENDER_DATA_PART_SIZE_MB = “6608”
MENDER_FEATURES_ENABLE_append = " mender-image mender-uboot mender-image-sd"
MENDER_FEATURES_DISABLE_append = " mender-grub mender-image-uefi mender-systemd"
MENDER_ARTIFACT_NAME=“local-image”
Hope that helps in some way. There’s probably a better way, but it was consuming too much time trying to find an answer, so this works for us.