# Using mender with barebox and ubifs coming from using RAUC

**URL:** <https://hub.mender.io/t/using-mender-with-barebox-and-ubifs-coming-from-using-rauc/1875>\
**Category:** General Discussions\
**Created:** [May 5, 2020, 9:11am UTC](https://hub.mender.io/t/using-mender-with-barebox-and-ubifs-coming-from-using-rauc/1875 "2020-05-05T09:11:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pboettch](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/pboettch/32/619_2.png) [@pboettch](https://hub.mender.io/u/pboettch)\
**Post date:** [May 5, 2020, 9:11am UTC](https://hub.mender.io/t/using-mender-with-barebox-and-ubifs-coming-from-using-rauc/1875/1 "2020-05-05T09:11:29Z")

</div>

We are using an IMX6UL with a Nand-flash directly attached to the SoC. Our vendor has done the footwork to use barebox as bootloader - hence we use it. We are using RAUC to do dual-system updates today. The partitioning of the NAND and related information/configuration (ubi + ubifs-volumes) is done with barebox scripts centralized in our own BSP-layer where.

Right now, we are studying whether Mender is suitable for our system or not.

To do this, we ideally replace RAUC with Mender on the system plus adding the barebox-bootchooser-scripts (barebox’s framework to switch systems) as described by Trent @tpiepho on other threads on the hub.

When starting to integrate meta-mender in our build, I’m stumbling directly on setting MTDIDS-variable and MTDPARTS. I imagine these are necessary to integrated with a full solution using U-Boot and creating everything from nothing via mender.

Is there are a way to simply have mender generate artifacts which are representing the rootfs (image-type ubifs) and use the client on the system to upgrade? How to have mender ignore the bootloader?

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [May 5, 2020, 9:29am UTC](https://hub.mender.io/t/using-mender-with-barebox-and-ubifs-coming-from-using-rauc/1875/2 "2020-05-05T09:29:44Z")

</div>

Hi @pboettch!

Please have a look at the features section in our docs,

[https://docs.mender.io/2.3/artifacts/yocto-project/image-configuration/features](https://docs.mender.io/2.3/artifacts/yocto-project/image-configuration/features)

I think what you are looking for is to disable `mender-uboot`, because you are not using U-Boot 🙂.

Based on your description you probably want to disable the following:

```auto
MENDER_FEATURES_DISABLE_append = " mender-uboot mender-grub mender-bios mender-image-ubi"

```

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [May 5, 2020, 9:32am UTC](https://hub.mender.io/t/using-mender-with-barebox-and-ubifs-coming-from-using-rauc/1875/3 "2020-05-05T09:32:03Z")

</div>

As you probably are using:

```auto
INHERIT += "mender-full-ubi"

```

It can be simplified to:

```auto
MENDER_FEATURES_DISABLE_append = " mender-uboot mender-image-ubi"

```

---

<div class="post-metadata">

**Author:** ![pboettch](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/pboettch/32/619_2.png) [@pboettch](https://hub.mender.io/u/pboettch)\
**Post date:** [May 5, 2020, 2:37pm UTC](https://hub.mender.io/t/using-mender-with-barebox-and-ubifs-coming-from-using-rauc/1875/4 "2020-05-05T14:37:45Z")

</div>

Adding the `MENDER_FEATURES_DISABLE_append` line of yours still makes it moan about `MENDER_MTDIDS must be defined`.

Adding `MENDER_MTDIDS="foo"` calms it down but there are warnings:

There as still some warnings (I’m using the zeus-next-branch):

```auto
WARNING: Could not find MENDER_IS_ON_MTDID () in MENDER_MTDIDS (asd).
WARNING: Unknown MTDID type , setting UBI block overhead to 0
WARNING: Could not find MENDER_IS_ON_MTDID () in MENDER_MTDIDS (asd).
WARNING: Unknown MTDID type , setting UBI overhead to 0
WARNING: Could not find MENDER_IS_ON_MTDID () in MENDER_MTDPARTS (). Returning UBI size of zero.
WARNING: Could not find MENDER_IS_ON_MTDID () in MENDER_MTDPARTS (). Returning UBI size of zero.
WARNING: Could not find MENDER_IS_ON_MTDID () in MENDER_MTDPARTS (). Returning UBI size of zero.
WARNING: Could not find MENDER_IS_ON_MTDID () in MENDER_MTDPARTS (). Returning UBI size of zero.
WARNING: Could not find MENDER_IS_ON_MTDID () in MENDER_MTDPARTS (). Returning UBI size of zero.
WARNING: Could not find MENDER_IS_ON_MTDID () in MENDER_MTDPARTS (). Returning UBI size of zero.
WARNING: Could not find MENDER_IS_ON_MTDID () in MENDER_MTDIDS (asd).
WARNING: Unknown MTDID type , setting UBI block overhead to 0
WARNING: Could not find MENDER_IS_ON_MTDID () in MENDER_MTDIDS (asd).
WARNING: Unknown MTDID type , setting UBI overhead to 0

```

---

<div class="post-metadata">

**Author:** ![pboettch](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/pboettch/32/619_2.png) [@pboettch](https://hub.mender.io/u/pboettch)\
**Post date:** [May 6, 2020, 9:30am UTC](https://hub.mender.io/t/using-mender-with-barebox-and-ubifs-coming-from-using-rauc/1875/5 "2020-05-06T09:30:32Z")

</div>

Well, I don’t get it, sorry.

How can I tell mender-core to just create an artifact out of the rootfs-ubifs-file the image-recipe produces? I have the feeling this is what I want. Without telling mender the partitioning of my storage-device?

I realize that there is also a config-file to be generated but is there no other way that to give mender the full picture?

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [May 6, 2020, 9:59am UTC](https://hub.mender.io/t/using-mender-with-barebox-and-ubifs-coming-from-using-rauc/1875/6 "2020-05-06T09:59:48Z")

</div>

The intention of the following:

```auto
MENDER_FEATURES_DISABLE_append = " mender-uboot mender-image-ubi"

```

should be

> How can I tell mender-core to just create an artifact out of the rootfs-ubifs-file the image-recipe produces

With that said, it does not mean that it is perfect and there might be assumptions made that you are building a full image even if you are specifying above. If you come across things like this, we would love to see this being resolved and fixed upstream. I do not know if anyone has tried this path before, so hiccups are expected.

One example is that it is enforced that `MENDER_MTDIDS` is defined, even if you only want to build a `ubifs` image and not an `ubi` image. This is because the `MENDER_MTDIDS` variable is parsed to get the size of the `ubifs` image, `MENDER_MTDIDS` is parsed to get a lot of other information. But this can probably be disabled as well.

If you take a look at [mender-setup-ubi.inc](https://github.com/mendersoftware/meta-mender/blob/zeus-next/meta-mender-core/classes/mender-setup-ubi.inc), you should get a better idea of what is going on.

So you have two additional options moving forward:

1. Define `MENDER_MTDIDS` to represent what you have on the device. Information in this variable will be used to create a correct `ubifs` image and it will not create an `ubi` image since the latter was disabled.

2. Provide all values manually, these (probably not all):

[https://github.com/mendersoftware/meta-mender/blob/zeus-next/meta-mender-core/classes/mender-setup-ubi.inc#L120-L151](https://github.com/mendersoftware/meta-mender/blob/zeus-next/meta-mender-core/classes/mender-setup-ubi.inc#L120-L151)

Actually there is a third option which would be very minimal. Remove everything you have Mender related so far and only add:

```auto
ARTIFACTIMG_FSTYPE = "ubifs"
IMAGE_CLASSES += "mender-artifactimg"

```

But above would not even install the Mender client, it will just build the Mender Artifact (`.mender`) file. Though never tested this and would be interesting to see if you get other problems.

---

<div class="post-metadata">

**Author:** ![pboettch](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/pboettch/32/619_2.png) [@pboettch](https://hub.mender.io/u/pboettch)\
**Post date:** [May 6, 2020, 11:39am UTC](https://hub.mender.io/t/using-mender-with-barebox-and-ubifs-coming-from-using-rauc/1875/7 "2020-05-06T11:39:17Z")

</div>

Thanks for getting back.

My rootfs partitions are created with `ubimkvol` and are of type `dynamic`.

Couldn’t mender just use the generated .ubifs-file and incorporate it in the artifact and then use `ubiupdatevol` not caring about the size (and the error blocks) of the partition.

Your third option sounds interesting. I actually like minimal approaches; helps a lot to understand how things work.

For the mender-client, I assume it is as simple as adding mender-client to `IMAGE_INSTALL`?

---

<div class="post-metadata">

**Author:** ![pboettch](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/pboettch/32/619_2.png) [@pboettch](https://hub.mender.io/u/pboettch)\
**Post date:** [May 7, 2020, 8:51am UTC](https://hub.mender.io/t/using-mender-with-barebox-and-ubifs-coming-from-using-rauc/1875/8 "2020-05-07T08:51:37Z")

</div>

Here is what I added to my image recipe to have it generate an artifact:

```auto
inherit mender-artifactimg

MENDER_ARTIFACT_NAME = "release-1"
ARTIFACTIMG_FSTYPE ='ubifs'
IMAGE_FSTYPES += 'mender'

```

Now I’m investigating how to elegantly create a config-file.
