# Integrating Mender with poky warrior for Raspberry-pi Cm3

**URL:** <https://hub.mender.io/t/integrating-mender-with-poky-warrior-for-raspberry-pi-cm3/2229>\
**Category:** General Discussions\
**Tags:** yocto, raspberrypi-cm3, warrior\
**Created:** [July 23, 2020, 3:00pm UTC](https://hub.mender.io/t/integrating-mender-with-poky-warrior-for-raspberry-pi-cm3/2229 "2020-07-23T15:00:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![thesillywhat](https://avatars.discourse-cdn.com/v4/letter/t/57b2e6/32.png) [@thesillywhat](https://hub.mender.io/u/thesillywhat)\
**Post date:** [July 23, 2020, 3:00pm UTC](https://hub.mender.io/t/integrating-mender-with-poky-warrior-for-raspberry-pi-cm3/2229/1 "2020-07-23T15:00:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [July 23, 2020, 6:57pm UTC](https://hub.mender.io/t/integrating-mender-with-poky-warrior-for-raspberry-pi-cm3/2229/2 "2020-07-23T18:57:13Z")

</div>

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](https://hub.mender.io/t/raspberry-pi-compute-module-3/110/3).

Drew

---

<div class="post-metadata">

**Author:** ![thesillywhat](https://avatars.discourse-cdn.com/v4/letter/t/57b2e6/32.png) [@thesillywhat](https://hub.mender.io/u/thesillywhat)\
**Post date:** [July 23, 2020, 7:35pm UTC](https://hub.mender.io/t/integrating-mender-with-poky-warrior-for-raspberry-pi-cm3/2229/3 "2020-07-23T19:35:46Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [July 23, 2020, 8:54pm UTC](https://hub.mender.io/t/integrating-mender-with-poky-warrior-for-raspberry-pi-cm3/2229/4 "2020-07-23T20:54:46Z")

</div>

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](https://github.com/mendersoftware/meta-mender/tree/master/meta-mender-raspberrypi) for more dtails.

Drew

---

<div class="post-metadata">

**Author:** ![thesillywhat](https://avatars.discourse-cdn.com/v4/letter/t/57b2e6/32.png) [@thesillywhat](https://hub.mender.io/u/thesillywhat)\
**Post date:** [July 24, 2020, 2:12pm UTC](https://hub.mender.io/t/integrating-mender-with-poky-warrior-for-raspberry-pi-cm3/2229/5 "2020-07-24T14:12:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![thesillywhat](https://avatars.discourse-cdn.com/v4/letter/t/57b2e6/32.png) [@thesillywhat](https://hub.mender.io/u/thesillywhat)\
**Post date:** [July 24, 2020, 3:16pm UTC](https://hub.mender.io/t/integrating-mender-with-poky-warrior-for-raspberry-pi-cm3/2229/6 "2020-07-24T15:16:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![thesillywhat](https://avatars.discourse-cdn.com/v4/letter/t/57b2e6/32.png) [@thesillywhat](https://hub.mender.io/u/thesillywhat)\
**Post date:** [July 24, 2020, 5:23pm UTC](https://hub.mender.io/t/integrating-mender-with-poky-warrior-for-raspberry-pi-cm3/2229/7 "2020-07-24T17:23:59Z")

</div>

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