Yocto 2.7 - Warrior support

I am trying to upgrade to Yocto Warrior using the master branch of meta-mender.

I have it fully working on both grub (x86) and u-boot (raspberrypi).

There is only one problem with the mender -commit when booting in the warrior version:

time="2019-07-26T21:31:07Z" level=info msg="Loaded configuration file: /etc/mender/mender.conf" module=config
time="2019-07-26T21:31:07Z" level=info msg="No dual rootfs configuration present" module=main
time="2019-07-26T21:31:07Z" level=info msg="Update Module path \"/usr/share/mender/modules/v3\" could not be opened (open /usr/share/mender/modules/v3: no such file or directory). Update modules will not be available" module=modules
time="2019-07-26T21:31:07Z" level=error msg="Dual rootfs configuration not found when resuming update. Recovery may fail." module=installer
Committing Artifact...
time="2019-07-26T21:31:07Z" level=error msg="Commit failed: Stub module: Cannot execute ArtifactCommit" module=standalone
time="2019-07-26T21:31:07Z" level=error msg="Pretending to support rollback so that host can reboot and try to restore state" module="stub_installer"
Rolling back Artifact...
time="2019-07-26T21:31:07Z" level=error msg="Unable to roll back with a stub module, but will try to reboot to restore state" module="stub_installer"
time="2019-07-26T21:31:07Z" level=error msg="Error when executing ArtifactFailure state: Stub module: Cannot execute ArtifactFailure" module=standalone
time="2019-07-26T21:31:07Z" level=error msg="Error when executing Cleanup state: Stub module: Cannot execute Cleanup" module=standalone
time="2019-07-26T21:31:07Z" level=error msg="Stub module: Cannot execute ArtifactCommit" module=main

I’ve traced the problem to simply the /etc/mender/mender.conf file missing the following lines:

    "RootfsPartA": "/dev/mmcblk0p2",
    "RootfsPartB": "/dev/mmcblk0p3"

If I add these config manually, mender -commit works. I can upgrade and downgrade from Yocto thud without any errors.

These configuration seems to be generated from mender.inc or mender-setup.bbclass. I am not sure why under the master branch they are not getting added to the mender.conf file.

Hi @cveilleux

It’s great that you got it working based on warrior with a raspberry pi! I’m trying the same but am having some trouble. Is your project open-source so I could look at how you did it?

Regarding your question, could you look into your /data parition. There you should also find a set of config files, for me it’s in /data/mender/mender.conf.

So whenever I run mender, I always add the -data /data/mender -config /data/mender/mender.conf args.

Hi,

Thanks for the tip. Yes, I could point to a custom mender.conf.

Previous builds would automatically set the RootfsPart settings, so something must have changed with warrior.

Please find attached my patch to make meta-mender build with poky and meta-raspberrypy warrior branches.

I am applying it on top of meta-mender master.

I simply declared layer compatibility and removed a u-boot patch that is no longer required (upstreamed).

diff --git a/meta-mender-core/conf/layer.conf b/meta-mender-core/conf/layer.conf
index 855dc21..41a74f0 100644
--- a/meta-mender-core/conf/layer.conf
+++ b/meta-mender-core/conf/layer.conf
@@ -17,5 +17,5 @@ BBFILE_PRIORITY_mender = "6"
 
 INHERIT += "mender-setup"
 
-LAYERSERIES_COMPAT_mender = "thud"
+LAYERSERIES_COMPAT_mender = "thud warrior"
 LAYERDEPENDS_mender = "core"
diff --git a/meta-mender-core/recipes-bsp/u-boot/u-boot-mender-common.inc b/meta-mender-core/recipes-bsp/u-boot/u-boot-mender-common.inc
index f4f17df..3c1f08d 100644
--- a/meta-mender-core/recipes-bsp/u-boot/u-boot-mender-common.inc
+++ b/meta-mender-core/recipes-bsp/u-boot/u-boot-mender-common.inc
@@ -17,7 +17,6 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/patches:${THISDIR}/files:"
 SRC_URI_append_mender-uboot = " file://0001-Add-missing-header-which-fails-on-recent-GCC.patch"
 SRC_URI_append_mender-uboot = " file://0002-Generic-boot-code-for-Mender.patch"
 SRC_URI_append_mender-uboot = " file://0003-Integration-of-Mender-boot-code-into-U-Boot.patch"
-SRC_URI_append_mender-uboot = " file://0006-env-Kconfig-Add-descriptions-so-environment-options-.patch"
 
 SRC_URI_append_mender-uboot = "${@bb.utils.contains('MENDER_UBOOT_AUTO_CONFIGURE', \
                                                     '1', \
diff --git a/meta-mender-raspberrypi/conf/layer.conf b/meta-mender-raspberrypi/conf/layer.conf
index ed4626e..750fef0 100644
--- a/meta-mender-raspberrypi/conf/layer.conf
+++ b/meta-mender-raspberrypi/conf/layer.conf
@@ -14,7 +14,7 @@ BBFILE_PRIORITY_mender-raspberrypi = "10"
 
 LAYERDEPENDS_mender-raspberrypi = "mender raspberrypi"
 
-LAYERSERIES_COMPAT_mender-raspberrypi = "thud"
+LAYERSERIES_COMPAT_mender-raspberrypi = "thud warrior"
 
 # Raspberry Pi doesn't work with GRUB currently.
 _MENDER_IMAGE_TYPE_DEFAULT_rpi = "mender-image-sd"

As far as I know the mender client should automatically “probe” a couple of default locations for the mender.conf file, e.g

/etc/mender/mender.conf
/var/lib/mender/mender.conf (same as /data/mender/mender.conf by default in Yocto)

And the additional args should not be needed.

Can you check if these files are in place?

Can you also share which version of the Mender client you are running?