# Build fails Apalis IMX8

**URL:** <https://hub.mender.io/t/build-fails-apalis-imx8/4260>\
**Category:** Yocto Project\
**Created:** [November 1, 2021, 3:13pm UTC](https://hub.mender.io/t/build-fails-apalis-imx8/4260 "2021-11-01T15:13:35Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![pgiangrossi](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/pgiangrossi/32/1247_2.png) [@pgiangrossi](https://hub.mender.io/u/pgiangrossi)\
**Post date:** [November 1, 2021, 3:13pm UTC](https://hub.mender.io/t/build-fails-apalis-imx8/4260/1 "2021-11-01T15:13:36Z")

</div>

I encounter the following build error:

`ERROR: File system image of partition None is larger (3297201 kB) than its allowed size 950272 kB`

If I revert the meta-mender-community layer to something before commit 475f3f8c “toradex: Support both 5.3.0 and 5.4.0 BSPs in Dunfell.”, then I do not get the error. I tried defining TORADEX\_BSP\_VERSION to 5.3.0 and 5.4.0, but get the error in either case.

Here is the error:

```auto
| + outimgname=/home/pagi/manus-linux/toradex-apalis-imx8/build/tmp/work/apalis_imx8-tdx-linux/tdx-reference-minimal-image/1.0-r0/deploy-tdx-reference-minimal-image-image-complete/Apalis-iMX8_Reference-Minimal-Image.sdimg
| + wicout=/home/pagi/manus-linux/toradex-apalis-imx8/build/tmp/work/apalis_imx8-tdx-linux/tdx-reference-minimal-image/1.0-r0/deploy-tdx-reference-minimal-image-image-complete/Apalis-iMX8_Reference-Minimal-Image-sdimg
| + BUILDDIR=/home/pagi/manus-linux/toradex-apalis-imx8/build wic create /home/pagi/manus-linux/toradex-apalis-imx8/build/tmp/work/apalis_imx8-tdx-linux/tdx-reference-minimal-image/1.0-r0/mender-sdimg.wks --vars /home/pagi/manus-linux/toradex-apalis-imx8/build/tmp/sysroots/apalis-imx8/imgdata/ -e Reference-Minimal-Image -o /home/pagi/manus-linux/toradex-apalis-imx8/build/tmp/work/apalis_imx8-tdx-linux/tdx-reference-minimal-image/1.0-r0/deploy-tdx-reference-minimal-image-image-complete/Apalis-iMX8_Reference-Minimal-Image-sdimg/ --no-fstab-update
| INFO: Creating image(s)...
| 
| ERROR: File system image of partition None is larger (3297201 kB) than its allowed size 950272 kB
| 
| + bb_exit_handler
| + ret=1
| + echo WARNING: exit code 1 from a shell command.
| WARNING: exit code 1 from a shell command.
| + exit 1
| 
ERROR: Task (/home/pagi/manus-linux/toradex-apalis-imx8/build/../layers/meta-toradex-demos/recipes-images/images/tdx-reference-minimal-image.bb:do_image_sdimg) failed with exit code '1'
ERROR: tdx-reference-minimal-image-1.0-r0 do_image_mender: Size of rootfs is greater than the calculated partition space (3376333824 > 973078528). This image won't fit on a device with the current storage configuration. Try reducing IMAGE_OVERHEAD_FACTOR if it is higher than 1.0, or raise MENDER_STORAGE_TOTAL_SIZE_MB if the device in fact has more storage.
ERROR: tdx-reference-minimal-image-1.0-r0 do_image_mender: Execution of '/home/pagi/manus-linux/toradex-apalis-imx8/build/tmp/work/apalis_imx8-tdx-linux/tdx-reference-minimal-image/1.0-r0/temp/run.do_image_mender.1142806' failed with exit code 1:
+ [-z manus-linux-apalis-imx8-release-0.0.16]
+ stat -Lc %s /home/pagi/manus-linux/toradex-apalis-imx8/build/tmp/work/apalis_imx8-tdx-linux/tdx-reference-minimal-image/1.0-r0/deploy-tdx-reference-minimal-image-image-complete/Reference-Minimal-Image-apalis-imx8.ext4
+ rootfs_size=3376333824
+ expr 950272 * 1024
+ calc_rootfs_size=973078528
+ [3376333824 -gt 973078528]
+ bbfatal Size of rootfs is greater than the calculated partition space (3376333824 > 973078528). This image won't fit on a device with the current storage configuration. Try reducing IMAGE_OVERHEAD_FACTOR if it is higher than 1.0, or raise MENDER_STORAGE_TOTAL_SIZE_MB if the device in fact has more storage.
+ [-p /home/pagi/manus-linux/toradex-apalis-imx8/build/tmp/work/apalis_imx8-tdx-linux/tdx-reference-minimal-image/1.0-r0/temp/fifo.1142806]
+ printf %b\0 bbfatal Size of rootfs is greater than the calculated partition space (3376333824 > 973078528). This image won't fit on a device with the current storage configuration. Try reducing IMAGE_OVERHEAD_FACTOR if it is higher than 1.0, or raise MENDER_STORAGE_TOTAL_SIZE_MB if the device in fact has more storage.
+ exit 1
+ bb_exit_handler
+ ret=1
+ echo WARNING: exit code 1 from a shell command.
WARNING: exit code 1 from a shell command.
+ exit 1

ERROR: Logfile of failure stored in: /home/pagi/manus-linux/toradex-apalis-imx8/build/tmp/work/apalis_imx8-tdx-linux/tdx-reference-minimal-image/1.0-r0/temp/log.do_image_mender.1142806
ERROR: Task (/home/pagi/manus-linux/toradex-apalis-imx8/build/../layers/meta-toradex-demos/recipes-images/images/tdx-reference-minimal-image.bb:do_image_mender) failed with exit code '1'
NOTE: Tasks Summary: Attempted 8158 tasks of which 5 didn't need to be rerun and 2 failed.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 5 seconds

Summary: 2 tasks failed:
  /home/pagi/manus-linux/toradex-apalis-imx8/build/../layers/meta-toradex-demos/recipes-images/images/tdx-reference-minimal-image.bb:do_image_sdimg
  /home/pagi/manus-linux/toradex-apalis-imx8/build/../layers/meta-toradex-demos/recipes-images/images/tdx-reference-minimal-image.bb:do_image_mender
Summary: There was 1 WARNING message shown.
Summary: There were 3 ERROR messages shown, returning a non-zero exit code.

```

---

<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:** [November 1, 2021, 5:41pm UTC](https://hub.mender.io/t/build-fails-apalis-imx8/4260/2 "2021-11-01T17:41:02Z")

</div>

What does the following show for you:

`$ bitbake -e tdx-reference-minimal-image | grep ^MENDER_STORAGE_TOTAL_SIZE_MB=`

---

<div class="post-metadata">

**Author:** ![pgiangrossi](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/pgiangrossi/32/1247_2.png) [@pgiangrossi](https://hub.mender.io/u/pgiangrossi)\
**Post date:** [November 2, 2021, 7:23am UTC](https://hub.mender.io/t/build-fails-apalis-imx8/4260/3 "2021-11-02T07:23:04Z")

</div>

That command produces:

MENDER\_STORAGE\_TOTAL\_SIZE\_MB=“2048”

---

<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:** [November 2, 2021, 11:42am UTC](https://hub.mender.io/t/build-fails-apalis-imx8/4260/4 "2021-11-02T11:42:53Z")

</div>

And do you get the same value when you revert to the older commit? That error generally means that you need to increase `MENDER_STORAGE_TOTAL_SIZE_MB`. I have not see this building locally. Do you have any extra packages or anything that you have installed in `local.conf`?

---

<div class="post-metadata">

**Author:** ![pgiangrossi](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/pgiangrossi/32/1247_2.png) [@pgiangrossi](https://hub.mender.io/u/pgiangrossi)\
**Post date:** [November 2, 2021, 11:58am UTC](https://hub.mender.io/t/build-fails-apalis-imx8/4260/5 "2021-11-02T11:58:21Z")

</div>

Same value when I revert to the older commit. Yes, I do have extra packages. But I do not understand why it builds with the older meta-mender-community commit.

---

<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:** [November 3, 2021, 2:41pm UTC](https://hub.mender.io/t/build-fails-apalis-imx8/4260/6 "2021-11-03T14:41:49Z")

</div>

Yeah me either. Unfortunately, I’m not able to reproduce your issue so I don’t really have anything to suggest. Let me know if you uncover anything interesting.  
Drew

---

<div class="post-metadata">

**Author:** ![pgiangrossi](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/pgiangrossi/32/1247_2.png) [@pgiangrossi](https://hub.mender.io/u/pgiangrossi)\
**Post date:** [November 5, 2021, 12:13pm UTC](https://hub.mender.io/t/build-fails-apalis-imx8/4260/7 "2021-11-05T12:13:41Z")

</div>

Thanks, Drew. I will investigate and document the findings here.

One thing that confuses me is what MENDER\_STORAGE\_TOTAL\_SIZE\_MB actually means.

I have 16 GB of flash. When I set MENDER\_STORAGE\_TOTAL\_SIZE\_MB to 2048, I used to get partitions like below (now, of course, the build fails, as described in this ticket):

```auto
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 49152 114687 65536 32M c W95 FAT32 (LBA)
/dev/mmcblk0p2 114688 12500991 12386304 5.9G 83 Linux
/dev/mmcblk0p3 12500992 24887295 12386304 5.9G 83 Linux
/dev/mmcblk0p4 24887296 31080447 6193152 3G 83 Linux

```

Could you clarify what this variable actually means and how a value of “2048” results in 6 GB for rootfs?

---

<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:** [November 5, 2021, 3:42pm UTC](https://hub.mender.io/t/build-fails-apalis-imx8/4260/8 "2021-11-05T15:42:16Z")

</div>

It specifies the total disk size to be allocated to all 4 partitions. You explicitly also set the size for the data and boot partitions, and the sdimg bbclass calculates the rootfs size based on the splitting the remaining in half.

I don’t know how you would get a 6G partition if the total size is only 2048. My best guess is that variable is somehow modified.

Drew

---

<div class="post-metadata">

**Author:** ![pgiangrossi](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/pgiangrossi/32/1247_2.png) [@pgiangrossi](https://hub.mender.io/u/pgiangrossi)\
**Post date:** [November 8, 2021, 7:35am UTC](https://hub.mender.io/t/build-fails-apalis-imx8/4260/9 "2021-11-08T07:35:45Z")

</div>

Thanks, I don’t know how it worked either. I have increased MENDER\_STORAGE\_TOTAL\_SIZE\_MB to 16 GB, which is the amount of flash in the Apalis. This works fine.

Shouldn’t this variable be set to 16GB in the meta-mender-community config files? According to the mender documentation, this variable is:

> Total size of the physical storage medium that mender partitioned images will be written to, expressed in MiB.

The physical storage medium on the Apalis IMX8 is 16GB eMMC on all variants.

```auto
https://www.toradex.com/computer-on-modules/apalis-arm-family/nxp-imx-8#features

```

---

<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:** [November 8, 2021, 1:57pm UTC](https://hub.mender.io/t/build-fails-apalis-imx8/4260/10 "2021-11-08T13:57:30Z")

</div>

Usually we set it to a smaller value to make for smaller artifacts and install times. The data partition can extend to fill the drive using the mender-growfs-data MENDER\_FEATURE so that usually is a better approach.

---

<div class="post-metadata">

**Author:** ![pgiangrossi](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/pgiangrossi/32/1247_2.png) [@pgiangrossi](https://hub.mender.io/u/pgiangrossi)\
**Post date:** [November 10, 2021, 6:53am UTC](https://hub.mender.io/t/build-fails-apalis-imx8/4260/11 "2021-11-10T06:53:30Z")

</div>

I do not see any large artifacts. I have MENDER\_STORAGE\_TOTAL\_SIZE\_MB = 16000 and the following artifacts:

```auto
4,5M	Apalis-iMX8_Reference-Minimal-Image.dataimg
2,4G	Apalis-iMX8_Reference-Minimal-Image.ext4
88K	Apalis-iMX8_Reference-Minimal-Image.manifest
774M	Apalis-iMX8_Reference-Minimal-Image.mender
4,0K	Apalis-iMX8_Reference-Minimal-Image.mender.bmap
1,3G	Apalis-iMX8_Reference-Minimal-Image.mender_tezi.tar
4,8G	Apalis-iMX8_Reference-Minimal-Image.sdimg
8,0K	Apalis-iMX8_Reference-Minimal-Image.sdimg.bmap
1,3G	Apalis-iMX8_Reference-Minimal-Image.sdimg.bz2
584K	Apalis-iMX8_Reference-Minimal-Image.testdata.json

```

---

<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:** [November 10, 2021, 5:07pm UTC](https://hub.mender.io/t/build-fails-apalis-imx8/4260/12 "2021-11-10T17:07:56Z")

</div>

That is strange. I made a build with your setting and see a file of the appropriate size:

```auto
<dmoseley@aruba> {/work/dmoseley/scratch/mender-toradex/build}
$ ls -l deploy/images/apalis-imx8/Apalis-iMX8_Reference-Minimal-Image.*
.rw-r--r-- 134M dmoseley 10 Nov 11:47 deploy/images/apalis-imx8/Apalis-iMX8_Reference-Minimal-Image.dataimg
.rw-r--r-- 8.3G dmoseley 10 Nov 11:47 deploy/images/apalis-imx8/Apalis-iMX8_Reference-Minimal-Image.ext4
.rw-r--r-- 47k dmoseley 10 Nov 11:47 deploy/images/apalis-imx8/Apalis-iMX8_Reference-Minimal-Image.manifest
.rw-rw-r-- 99M dmoseley 10 Nov 11:48 deploy/images/apalis-imx8/Apalis-iMX8_Reference-Minimal-Image.mender
.rw-r--r-- 2.3k dmoseley 10 Nov 11:48 deploy/images/apalis-imx8/Apalis-iMX8_Reference-Minimal-Image.mender.bmap
.rw-rw-r-- 149M dmoseley 10 Nov 11:48 deploy/images/apalis-imx8/Apalis-iMX8_Reference-Minimal-Image.mender_tezi.tar
.rw-r--r-- 17G dmoseley 10 Nov 11:48 deploy/images/apalis-imx8/Apalis-iMX8_Reference-Minimal-Image.sdimg
.rw-r--r-- 6.6k dmoseley 10 Nov 11:48 deploy/images/apalis-imx8/Apalis-iMX8_Reference-Minimal-Image.sdimg.bmap
.rw-r--r-- 130M dmoseley 10 Nov 11:48 deploy/images/apalis-imx8/Apalis-iMX8_Reference-Minimal-Image.sdimg.bz2
.rw-r--r-- 606k dmoseley 10 Nov 11:47 deploy/images/apalis-imx8/Apalis-iMX8_Reference-Minimal-Image.testdata.json

```

---

<div class="post-metadata">

**Author:** ![pgiangrossi](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/pgiangrossi/32/1247_2.png) [@pgiangrossi](https://hub.mender.io/u/pgiangrossi)\
**Post date:** [November 15, 2021, 7:42am UTC](https://hub.mender.io/t/build-fails-apalis-imx8/4260/13 "2021-11-15T07:42:46Z")

</div>

This is strange. It seems that my artifact size may change over time. Will this cause problems with mender updates? For example, if I have a system with a rootfs size of 6.1 GB, and I try to update it with one that increases to 6.3 GB, will the update fail?

How do I limit the rootfs size?
