SD Card + Mender Yocto Image Nitrogen8mm

I am working with a nitrogen8mm and have a yocto image that successfully flashes via SD card. I am looking to add mender support for this image via the mender layer. Previously, I had used the kirkstone release docs here to flash the produced image via Mender, but this image assumes flashing via eMMC, not SD card. Mender Kirkstone Release for i.MX8 platforms - Boundary Devices

I was told that the mender layer would need to be adjusted to be able to support an image that flashes via the SD card, as the default flashes via eMMC. How would I adjust the mender layer in my yocto image to allow it to flash via SD card and also be able to be flashed with mender?

Hi @mld,

Thanks for reaching out! Adjusting to a different storage device might be as simple as setting MENDER_STORAGE_DEVICE accordingly, as it is done for the mp-variant here for example: meta-mender-community/kas/nitrogen8mp.yml at kirkstone · mendersoftware/meta-mender-community · GitHub

Maybe @texierp also has experience with that.

Greets,
Josef

Hi @TheYoctoJester ,

MENDER_STORAGE_DEVICE looks promising. I was assuming that if MENDER_STORAGE_DEVICE=/dev/sda or something, there would need to be some repartitioning with some other config as well. I see there is a “mender-convert” option which looks like it could be helpful as well, but there are only a few different platforms officially supported with this. (not arm64 like I am looking for)

@texierp if you have any more information that you’d be able to share too, that’d be greatly appreciated!

Thanks

@mld

The MENDER_STORAGE_DEVICE variable should in practice only affect the configuration files which are shipped with the image, e.g. /etc/mender/mender.conf and eventually u-boot scripts.

If you’ve given it a try, please let us know if it works for you so others can benefit too.

Thanks,
Josef

@TheYoctoJester Sorry, got pulled away from this topic for a bit but I am back on it now. I am going to test this out here shortly. I see in the mender docs it mentions that MENDER_UBOOT_STORAGE_DEVICE should hold all partitions (rootfs, boot, data), which makes me think it should stay as /dev/mmcblk1?
https://docs.mender.io/operating-system-updates-yocto-project/variables#mender_storage_device

FYI - I got a response from Boundary about this same inquiry. Their proposed solution was:

  1. add MENDER_UBOOT_STORAGE_DEVICE = “1” to local.conf
  2. Modify whatever defconfig you are using in uboot and add CONFIG_SYS_MMC_ENV_DEV=1 to it. You will need to modify patches to do so:
    meta-mender-community/meta-mender-nxp/recipes-bsp/u-boot/u-boot-boundary at kirkstone · mendersoftware/meta-mender-community · GitHub

I attempted to change these two things in my yocto build and it broke the build with the following error:
Failed to load ‘/boot/imx8mm-nitrogen8mm_rev2.dtb’
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
No FDT memory address configured. Please configure
the FDT address via “fdt addr ” command.
Aborting!