Resin.image build failed

On Ubuntu 18.04

Build for raspberrypi 3 failed with following error

ERROR: resin-image-1.0-r0 do_rootfs: /home/wips/balena-raspberrypi/build/tmp/deploy/images/raspberrypi3/u-boot.bin is an invalid path referenced in RESIN_BOOT_PARTITION_FILES.
ERROR: resin-image-1.0-r0 do_rootfs: Function failed: resin_boot_dirgen_and_deploy (log file is located at /home/wips/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/resin-image/1.0-r0/temp/log.do_rootfs.20295)
ERROR: Logfile of failure stored in: /home/wips/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/resin-image/1.0-r0/temp/log.do_rootfs.20295
ERROR: Task (/home/wips/balena-raspberrypi/build/../layers/meta-balena/meta-balena-common/recipes-core/images/resin-image.bb:do_rootfs) failed with exit code '1'


Summary: 1 task failed:
  /home/wips/balena-raspberrypi/build/../layers/meta-balena/meta-balena-common/recipes-core/images/resin-image.bb:do_rootfs

============================================================
From Log fiile: build/tmp/work/raspberrypi3-poky-linux-gnueabi/resin-image/1.0-r0/temp/log.do_rootfs.20295

ERROR: /home/wips/balena-raspberrypi/build/tmp/deploy/images/raspberrypi3/u-boot.bin is an invalid path referenced in RESIN_BOOT_PARTITION_FILES.

============================================================
I used procedure from this link:

Then I manually copied u-boot.bin and boot.scr to desired location and build progressed from there but failed at following point.

Initialising tasks: 100% |##################################################################################################################################################################| Time: 0:00:05
Sstate summary: Wanted 105 Found 0 Missed 105 Current 1256 (0% match, 92% complete)
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: rpi-u-boot-scr-1.0-r0 do_deploy: The recipe rpi-u-boot-scr is trying to install files into a shared area when those files already exist. Those files and their manifest location are:
  /home/wips/balena-raspberrypi/build/tmp/deploy/images/raspberrypi3/boot.scr
    (not matched to any task)
Please verify which recipe should provide the above files.

The build has stopped, as continuing in this scenario WILL break things - if not now, possibly in the future (we've seen builds fail several months later). If the system knew how to recover from this automatically it would, however there are several different scenarios which can result in this and we don't know which one this is. It may be you have switched providers of something like virtual/kernel (e.g. from linux-yocto to linux-yocto-dev), in that case you need to execute the clean task for both recipes and it will resolve this error. It may be you changed DISTRO_FEATURES from systemd to udev or vice versa. Cleaning those recipes should again resolve this error, however switching DISTRO_FEATURES on an existing build directory is not supported - you should really clean out tmp and rebuild (reusing sstate should be safe). It could be the overlapping files detected are harmless in which case adding them to SSTATE_DUPWHITELIST may be the correct solution. It could also be your build is including two different conflicting versions of things (e.g. bluez 4 and bluez 5 and the correct solution for that would be to resolve the conflict. If in doubt, please ask on the mailing list, sharing the error and filelist above.
ERROR: rpi-u-boot-scr-1.0-r0 do_deploy: If the above message is too much, the simpler version is you're advised to wipe out tmp and rebuild (reusing sstate is fine). That will likely fix things in most (but not all) cases.
ERROR: rpi-u-boot-scr-1.0-r0 do_deploy: 
ERROR: rpi-u-boot-scr-1.0-r0 do_deploy: Function failed: sstate_task_postfunc
ERROR: Logfile of failure stored in: /home/wips/balena-raspberrypi/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/rpi-u-boot-scr/1.0-r0/temp/log.do_deploy.16395
ERROR: Task (/home/wips/balena-raspberrypi/build/../layers/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bb:do_deploy) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3444 tasks of which 3410 didn't need to be rerun and 1 failed.

Hi,

The build system is known to work with Ubuntu 16.04.

It may work on 18.04 too, depending on what board you are building for.

But we saw lots of errors when building the host tools on 18.04.

I also started a build on 18.04.2 to check if it works.

ok

please share the outcome as soon as you have.

Hi,

I successfully built the RPi3 image on Ubuntu 18.04.2.

From your error logs it’s possible that u-boot is not compiling.

It could be that you are missing some required host tools.

Is it possible for you to provide me a list of host tools.

I didn’t come across any list

Hi,

The default list of packages for Yocto is here: https://www.yoctoproject.org/docs/1.8/yocto-project-qs/yocto-project-qs.html#ubuntu.

You will also need jq, nodejs and docker installed.

You error seems to be related to u-boot.

Can you please check for compile errors is the u-boot compile log?

This can be found in build/tmp/work/raspberrypi3-poky-linux-gnueabi/u-boot/1_2019.01-r0/temp/log.do_compile

u-boot seems to have got built

prompt $$ find . -name u-boot.bin
./resin-image/1.0-r0/rootfs/boot/u-boot.bin
./u-boot/1_2019.01-r0/build/u-boot.bin
./u-boot/1_2019.01-r0/image/boot/u-boot.bin
prompt $$

Some other problem

Handling u-boot.bin:/kernel7.img .
6714 ERROR: /home/wips/balena-raspberrypi/build/tmp/deploy/images/raspberrypi3/u-boot.bin is an invalid path referenced in RESIN_BOOT_PARTITION_FILES.
6715 WARNING: exit code 1 from a shell command.

No u-boot.bin under /home/wips/balena-raspberrypi/build/tmp/deploy/images/raspberrypi3

Can you share the listing of all files in /home/wips/balena-raspberrypi/build/tmp/deploy/images/raspberrypi3 please?

Also, can you share the list from your build’s directory tmp/work/raspberrypi3-poky-linux-gnueabi/u-boot/1_2019.01-r0/deploy-u-boot/ please?

Hi,

I have the same issue in Ubuntu 16.04.6

./balena-yocto-scripts/build/barys -m raspberrypi3
Building JSON manifest...
audited 3 packages in 0.663s
found 0 vulnerabilities

...Done

  _____           _        _____   ____  
 |  __ \         (_)      /  _  \ / ___| 
 | |__) |___  ___ _ _ __  | | | || (___  
 |  _  // _ \/ __| | '_ \ | | | | \___ \ 
 | | \ \  __/\__ \ | | | || |_| |  ___) |
 |_|  \_\___||___/_|_| |_|\_____/ |____/ 
                                         
 ---------------------------------------- 

Resin specific images available:
	resin-image

Balena Fin (CM3)                         : $ MACHINE=fincm3 bitbake resin-image
NPE X500 M3                              : $ MACHINE=npe-x500-m3 bitbake resin-image
Raspberry Pi 2                           : $ MACHINE=raspberrypi2 bitbake resin-image
Raspberry Pi 3 (using 64bit OS) (EXPERIMENTAL) : $ MACHINE=raspberrypi3-64 bitbake resin-image
Raspberry Pi 3                           : $ MACHINE=raspberrypi3 bitbake resin-image
Raspberry Pi 4 (using 64bit OS) (EXPERIMENTAL) : $ MACHINE=raspberrypi4-64 bitbake resin-image
Raspberry Pi (v1 / Zero / Zero W)        : $ MACHINE=raspberrypi bitbake resin-image
Revolution Pi Core 3                     : $ MACHINE=revpi-core-3 bitbake resin-image

[000000003][LOG]BalenaOS build initialized in directory: build.
[000000003][LOG]Run build for raspberrypi3: MACHINE=raspberrypi3 bitbake resin-image 
[000000003][LOG]This might take a while ...
Loading cache: 100% |############################################| Time: 0:00:01
Loaded 3371 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "1.42.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "arm-poky-linux-gnueabi"
MACHINE              = "raspberrypi3"
DISTRO               = "balena-os"
DISTRO_VERSION       = "2.44.0"
TUNE_FEATURES        = "arm vfp cortexa7 neon vfpv4 thumb callconvention-hard"
TARGET_FPU           = "hard"
meta                 
meta-poky            = "HEAD:0e392026ffefee098a890c39bc3ca1f697bacb52"
meta-oe              
meta-filesystems     
meta-networking      
meta-python          = "HEAD:6fa72d587aab8e9d56d67a2552eb9cfbe25c86d2"
meta-raspberrypi     = "HEAD:0750d5d2bc9596f35d5d61bb0ff657be4b02bfdc"
meta-balena-common   
meta-balena-warrior  = "HEAD:7fed82f336568cdf3081e55d2b8c0eeea0650a44"
meta-balena-raspberrypi = "master:aa51ce9213ec610ec5a013ccf8d28c95b1745440"
meta-rust            = "HEAD:84710b341be53cc2af13ecc8ae87773cf84687bf"

Initialising tasks: 100% |#######################################################################################################| Time: 0:00:04
Sstate summary: Wanted 109 Found 0 Missed 109 Current 1264 (0% match, 92% complete)
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: resin-image-1.0-r0 do_rootfs: /home/balena/balena-raspberrypi/build/tmp/deploy/images/raspberrypi3/u-boot.bin is an invalid path referenced in RESIN_BOOT_PARTITION_FILES.
ERROR: resin-image-1.0-r0 do_rootfs: Function failed: resin_boot_dirgen_and_deploy (log file is located at /home/balena/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/resin-image/1.0-r0/temp/log.do_rootfs.2240)
ERROR: Logfile of failure stored in: /home/balena/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/resin-image/1.0-r0/temp/log.do_rootfs.2240
ERROR: Task (/home/balena/balena-raspberrypi/build/../layers/meta-balena/meta-balena-common/recipes-core/images/resin-image.bb:do_rootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3402 tasks of which 3401 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /home/balena/balena-raspberrypi/build/../layers/meta-balena/meta-balena-common/recipes-core/images/resin-image.bb:do_rootfs
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
[000000100][LOG]Build for raspberrypi3 failed. Check failed log in build/tmp/log/cooker/raspberrypi3 .
[000000100][LOG]If build for raspberrypi3 succeeded, final image should have been generated here:
[000000100][LOG]   build/tmp/deploy/images/raspberrypi3/resin-image-raspberrypi3.resinos-img
[000000100][LOG]Done.
balena@balena:~/balena-raspberrypi$ lsb_release -a 
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.6 LTS
Release:	16.04
Codename:	xenial

When I search for the file, I find it here

./build/tmp/work/raspberrypi3-poky-linux-gnueabi/u-boot/1_2019.01-r0/package/boot/u-boot.bin

./build/tmp/work/raspberrypi3-poky-linux-gnueabi/u-boot/1_2019.01-r0/packages-split/u-boot/boot/u-boot.bin

./build/tmp/work/raspberrypi3-poky-linux-gnueabi/u-boot/1_2019.01-r0/build/u-boot.bin

./build/tmp/work/raspberrypi3-poky-linux-gnueabi/u-boot/1_2019.01-r0/image/boot/u-boot.bin

./build/tmp/work/raspberrypi3-poky-linux-gnueabi/resin-image/1.0-r0/rootfs/boot/u-boot.bin

Same issue with boot.scr. Tried to fix it with copying to the dir

cp ./build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/rpi-u-boot-scr/1.0-r0/rpi-u-boot-scr-1.0/boot.scr ./build/tmp/deploy/images/raspberrypi3/boot.scr
log file