Yocto Warrior build failing on do_image_sdimg for beaglebone

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!

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

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

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.

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

MENDER_BOOT_PART_SIZE_MB = "0"

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).

Can you share the full log when you had set,

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.

1 Like

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!