Integrating Mender with poky warrior for Raspberry-pi Cm3

Hello,
Since Now I have an pretty good understanding about the MENDER project thanks to @drewmoseley .
I wanted to include MENDER in my poky project for Raspberry pi-Cm3
I am using Poky warrior branch and have downloaded meta-mender under the same branch.

I am following MENDER documentation. And I have completed the
Partition Configuration but setting up u-boot configuration is where I am facing some issues and was hoping to get some help.

When I run the below command:
bitbake -e core-image-minimal | egrep '^PREFERRED_PROVIDER_(virtual/bootloader|u-boot)='
It returns empty. So that means I have to create my own custom fork.

I have created my own recipe called
u-boot-my-fork_2019.01.bb
location:meta-rpi_custom/recipes-bsp
where meta-rpi-custom is my layer
content of u-boot-my-fork_2019.01.bb
#########
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
require recipes-bsp/u-boot/u-boot.inc require recipes-bsp/u-boot/u-boot-mender.inc PROVIDES += "u-boot" RPROVIDES_${PN} += "u-boot"
#############
These are my Mender Related variable in local.conf file

`## Mender Related Variables
INHERIT += "mender-full"

MENDER_ARTIFACT_NAME = "release-1"
MENDER_STORAGE_DEVICE = "/dev/mmcblk0"
MENDER_STORAGE_DEVICE_BASE = "${MENDER_STORAGE_DEVICE}"
MENDER_BOOT_PART = "${MENDER_STORAGE_DEVICE_BASE}1"
MENDER_DATA_PART = "${MENDER_STORAGE_DEVICE_BASE}4"
MENDER_ROOTFS_PART_A = "${MENDER_STORAGE_DEVICE_BASE}2"
MENDER_ROOTFS_PART_B = "${MENDER_STORAGE_DEVICE_BASE}3"

MENDER_FEATURES_ENABLE_append = " mender-uboot mender-image-sd" #might be redundant since I have already inherited mender-full
MENDER_FEATURES_DISABLE_append = " mender-grub mender-image-uefi"

PREFERRED_PROVIDER_u-boot = "u-boot-my-fork"

RPI_USE_U_BOOT = "1"
##############################`

When I run the bitbake command. I get the below error

ERROR: u-boot-my-fork-2019.01-r0 do_patch: Command Error: 'quilt --quiltrc /home/blue/yocto/rpi-qt5LandScape/build/tmp/work/raspberrypi_cm3-poky-linux-gnueabi/u-boot-my-fork/2019.01-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0  Output:
Applying patch 0001-Add-missing-header-which-fails-on-recent-GCC.patch
can't find file to patch at input line 14
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From 8b0b8f362964f42559b39488d0c529b6e2b99523 Mon Sep 17 00:00:00 2001
|From: Kristian Amlie <kristian.amlie@mender.io>
|Date: Mon, 15 Feb 2016 15:57:32 +0100
|Subject: [PATCH] Add missing header which fails on recent GCC.
|
|---
| tools/env/fw_env.c | 1 +
| 1 file changed, 1 insertion(+)
|
|diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
|index 3dc0d53..3aac340 100644
|--- a/tools/env/fw_env.c
|+++ b/tools/env/fw_env.c
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
Patch 0001-Add-missing-header-which-fails-on-recent-GCC.patch does not apply (enforce with -f)
ERROR: u-boot-my-fork-2019.01-r0 do_patch: 
ERROR: u-boot-my-fork-2019.01-r0 do_patch: Function failed: patch_do_patch
ERROR: Logfile of failure stored in: /home/blue/yocto/rpi-qt5LandScape/build/tmp/work/raspberrypi_cm3-poky-linux-gnueabi/u-boot-my-fork/2019.01-r0/temp/log.do_patch.16368
ERROR: Task (/home/blue/yacto/poky-warrior-21.0.1/meta-rpi_custom/recipes-bsp/u-boot-my-fork/u-boot-my-fork_2019.01.bb:do_patch) failed with exit code '1'

Now I have read the troubleshooting part of the documentation and it said that I had to create a bbappend file which I did
u-boot-my-fork_2019.01.bbappend and this is the content
SRC_URI_remove = "0006-env-Kconfig-Add-descriptions-so-environment-options-.patch"

But I am still receiving the same error

And this is where I am drawing a blank. I am trying to gather information but I am unable to come around a good solution.

I am providing my bblayer.conf file for reference.

##############This is my bblayer.conf
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
  /home/blue/yocto/poky-warrior-21.0.1/meta \
  /home/blue/yocto/poky-warrior-21.0.1/meta-poky \
  /home/blue/yocto/poky-warrior-21.0.1/meta-yocto-bsp \
  /home/blue/yocto/poky-warrior-21.0.1/meta-qt5-warrior \
  /home/blue/yocto/poky-warrior-21.0.1/meta-openembedded-warrior/meta-oe \
  /home/blue/yocto/poky-warrior-21.0.1/meta-raspberrypi-warrior \
  /home/blue/yocto/poky-warrior-21.0.1/meta-rpi_custom \
  /home/blue/yocto/poky-warrior-21.0.1/meta-openembedded-warrior/meta-python \
  /home/blue/yocto/poky-warrior-21.0.1/meta-openembedded-warrior/meta-networking \
  /home/blue/yocto/poky-warrior-21.0.1/meta-96boards-warrior \
  /home/blue/yocto/poky-warrior-21.0.1/meta-mender-warrior/meta-mender-core \
  /home/blue/yocto/poky-warrior-21.0.1/meta-mender-warrior/meta-mender-raspberrypi \
  "
############  

If I could receive some guidance it would really be helpfull

Hi @thesillywhat you should not need to be doing any custom integration as we already have Rasperry Pi support. See this link specifically for the CM3.

Drew

pardon me. If this feels like a silly question.
But I already have an poky environment with my own custom image recipe and everything.
Shouldn’t I be just downloading meta-mender layer and integrating that with my already existing project?

Yes. That link obviously will have you starting from scratch but you can add it to your build. You need meta-mender as well as meta-mender-raspberrypi and you should be mostly there. The u-boot steps that you are attempting here are done already in the meta-mender-raspberrypi layer. See https://github.com/mendersoftware/meta-mender/tree/master/meta-mender-raspberrypi for more dtails.

Drew

1 Like

Got it. I did face some other issues. But all of them got resolved using troubleshooting docs

Spoke too soon. Just encountered the yellow screen error. Looking into it

@drewmoseley It worked. I am now just trying to manipulate the partition size.