# Yocto Warrior build failing on do\_image\_sdimg for beaglebone

**URL:** <https://hub.mender.io/t/yocto-warrior-build-failing-on-do-image-sdimg-for-beaglebone/1706>\
**Category:** General Discussions\
**Created:** [March 27, 2020, 5:50pm UTC](https://hub.mender.io/t/yocto-warrior-build-failing-on-do-image-sdimg-for-beaglebone/1706 "2020-03-27T17:50:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikevoyt](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@mikevoyt](https://hub.mender.io/u/mikevoyt)\
**Post date:** [March 27, 2020, 5:50pm UTC](https://hub.mender.io/t/yocto-warrior-build-failing-on-do-image-sdimg-for-beaglebone/1706/1 "2020-03-27T17:50:08Z")

</div>

Hi there,

I’m trying to integrate Mender into a Yocto project based on Warrior. The target hardware is a BeagleBone Black. I was able to build the .sdimage following the tutorial on the Beaglebone Black board integration page. However, when I include the layers into my own project, I get the following error when it tries to generate the .sdimg:

```
| DEBUG: Executing shell function do_image_sdimg
| + mkdir -p /home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0
| + true
| + install -m 0644 /home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/../deploy/sundstrom-glibc/images/beaglebone/uboot.env /home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/
| ++ basename /dev/mmcblk1
| + ondisk_dev=mmcblk1
| + wks=/home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/mender-sdimg.wks
| + rm -f /home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/mender-sdimg.wks
| + '[' -n '' ']'
| + true
| + '[' -n 8388608 ']'
| ++ expr 8388608 / 1024
| + boot_env_align_kb=8192
| + cat
| ++ expr 8388608 % 1024
| ++ true
| + '[' 0 -ne 0 ']'
| ++ expr 8388608 / 1024
| + alignment_kb=8192
| + '[' msdos = gpt ']'
| + part_type_params=
| ++ echo ' '
| ++ sed -r 's/(^\s*)|(\s*$)//g'
| + IMAGE_BOOT_FILES_STRIPPED=
| + '[' 32 -ne 0 ']'
| + mender_merge_bootfs_and_image_boot_files
| + W=/home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/bootfs.image_sdimg
| + rm -rf /home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/bootfs.image_sdimg
| + cp -al /home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/rootfs//uboot /home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/bootfs.image_sdimg
| + image_boot_files=' '
| + cat
| + cat
| + '[' 0 -ne 0 ']'
| + cat
| + echo '### Contents of wks file ###'
| ### Contents of wks file ###
| + cat /home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/mender-sdimg.wks
| part --source rawcopy --sourceparams="file=/home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/uboot.env" --ondisk "mmcblk1" --align 8192 --no-table
| part --source rootfs --rootfs-dir /home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/bootfs.image_sdimg --ondisk "mmcblk1" --fstype=vfat --label boot --align 8192 --fixed-size 32 --active
| part --source rawcopy --sourceparams="file=/home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/deploy-core-image-base-image-complete/core-image-base-beaglebone.ext4" --ondisk "mmcblk1" --align 8192 --fixed-size 1540096k
| part --source rawcopy --sourceparams="file=/home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/deploy-core-image-base-image-complete/core-image-base-beaglebone.ext4" --ondisk "mmcblk1" --align 8192 --fixed-size 1540096k
| part --source rawcopy --sourceparams="file=/home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/deploy-core-image-base-image-complete/core-image-base-beaglebone.dataimg" --ondisk "mmcblk1" --align 8192 --fixed-size 1024 --mkfs-extraopts=''
| bootloader --ptable msdos
| + echo '### End of contents of wks file ###'
| ### End of contents of wks file ###
| + outimgname=/home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/deploy-core-image-base-image-complete/core-image-base-beaglebone-20200327173208.sdimg
| + wicout=/home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/deploy-core-image-base-image-complete/core-image-base-beaglebone-20200327173208-sdimg
| + BUILDDIR=/home/mikevoyt/ssd/Aclima/sundstrom-os/build
| + wic create /home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/mender-sdimg.wks --vars /home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/sysroots/beaglebone/imgdata/ -e core-image-base -o /home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/deploy-core-image-base-image-complete/core-image-base-beaglebone-20200327173208-sdimg/
| INFO: Creating image(s)...
| 
| WARNING: overhead-factor was specified, but size was not, so bitbake variables will be used for the size. In this case both IMAGE_OVERHEAD_FACTOR and --overhead-factor will be applied
| ERROR: _exec_cmd: export PATH=/home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/recipe-sysroot-native/sbin:/home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/recipe-sysroot-native/usr/sbin:/home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/recipe-sysroot-native/usr/bin:$PATH;mcopy -i /home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/deploy-core-image-base-image-complete/core-image-base-beaglebone-20200327173208-sdimg/tmp.wic.cm18v_0r/rootfs_boot.2.vfat -s /home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/bootfs.image_sdimg/* ::/ returned '1' instead of 0
| output: /home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/work/beaglebone-sundstrom-linux-gnueabi/core-image-base/1.0-r0/bootfs.image_sdimg/*: No such file or directory

```

Note that I’m setting this in my local.conf:

```
MENDER_FEATURES_ENABLE_append = " mender-uboot mender-image-sd"
MENDER_FEATURES_DISABLE_append = " mender-grub mender-image-uefi"

```

Any ideas where to look? I grepped around in the .bbclass code and cannot find where this step is done or why it can’t find rootfs\_boot.2.vfat. Note that file is in fact in the build, but it’s one directory level above tmp.wic.cm18v\_0r. Thanks!

---

<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:** [March 27, 2020, 5:54pm UTC](https://hub.mender.io/t/yocto-warrior-build-failing-on-do-image-sdimg-for-beaglebone/1706/2 "2020-03-27T17:54:43Z")

</div>

I suspect this might relate to the fact that `IMAGE_BOOT_FILES` is empty.

Could you try setting it in your local.conf to,

```auto
IMAGE_BOOT_FILES = "u-boot.bin"

```

Above means that it will copy `boot.bin` from the deploy directory to the boot vfat part and would be a dummy operation to satisfy the assumption that `IMAGE_BOOT_FILES` is not empty.

---

<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:** [March 27, 2020, 5:55pm UTC](https://hub.mender.io/t/yocto-warrior-build-failing-on-do-image-sdimg-for-beaglebone/1706/3 "2020-03-27T17:55:27Z")

</div>

You could also try to disable the boot part by setting,

```auto
MENDER_BOOT_PART_SIZE_MB = "0"

```

---

<div class="post-metadata">

**Author:** ![mikevoyt](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@mikevoyt](https://hub.mender.io/u/mikevoyt)\
**Post date:** [March 27, 2020, 6:37pm UTC](https://hub.mender.io/t/yocto-warrior-build-failing-on-do-image-sdimg-for-beaglebone/1706/4 "2020-03-27T18:37:42Z")

</div>

Thanks for the suggestion mirzak! I did see that you had these suggestions in the Solidrun Clearfog Pro integration page. I tried:

`IMAGE_BOOT_FILES = "u-boot.bin"`

But get the error:  
`| cp: cannot stat '/home/mikevoyt/ssd/Aclima/sundstrom-os/build/tmp-sundstrom-glibc/../deploy/sundstrom-glibc/images/beaglebone/u-boot.bin': No such file or directory`

(indeed nothing is there)

I also tried:

`MENDER_BOOT_PART_SIZE_MB = "0"`

But it still generates the original error I posted above (despite the fact that mender-bootimg.bbclas has this statement:` if [${MENDER_BOOT_PART_SIZE_MB} -ne 0]; then`  
which leads me to believe the error is being caused elsewhere).

---

<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:** [March 27, 2020, 8:01pm UTC](https://hub.mender.io/t/yocto-warrior-build-failing-on-do-image-sdimg-for-beaglebone/1706/5 "2020-03-27T20:01:49Z")

</div>

Can you share the full log when you had set,

```auto
MENDER_BOOT_PART_SIZE_MB = "0"

```

Also regarding `IMAGE_BOOT_FILES`, I might have not very clear in my response but this has to be set to a valid file name that exists in the deploy directory. I do not recall the exact file names on BBB.

---

<div class="post-metadata">

**Author:** ![mikevoyt](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@mikevoyt](https://hub.mender.io/u/mikevoyt)\
**Post date:** [March 27, 2020, 9:37pm UTC](https://hub.mender.io/t/yocto-warrior-build-failing-on-do-image-sdimg-for-beaglebone/1706/6 "2020-03-27T21:37:36Z")

</div>

Ah yes, the Beaglebone u-boot file appears to be named `u-boot.img`. Fixing the name does allow the build to proceed - thanks for your assistance!
