balena-os / balena-beaglebone

Balena support for Beaglebone boards
https://www.balena.io/os/
Apache License 2.0
21 stars 18 forks source link

Adding beagleplay support: ERROR in do_assemble_fitimage_initramfs() #579

Closed delhiryder closed 1 year ago

delhiryder commented 1 year ago

Good morning,

I am trying to add support for the new beagleplay board to Belana. The maintainers at ti have already added the relevant 'beagleplay*.conf' to the meta-ti-bsp layer (on the kirkstone branch), and a recently approved pull request has added support for yocto-kirstone to this repo (I was able to successfully build the 'balena-image'target for the 'beaglebone machine).

After many days of bug fixing a debugging, the build is (almost) complete (at around 99%). The failures appear to be happening in the signing/packaing stage.

Here's snippet of the cookerlog:

ERROR: linux-bb.org-5.10.162+gitAUTOINC+a2f5d5746b-r0 do_assemble_fitimage_initramfs: ExecutionError('/home/ubuntu/balena-beaglebone/build/tmp/work/beaglebone_play-poky-linux/linux-bb.org/5.10.162+gitAUTOINC+a2f5d5746b-r0/temp/run.do_assemble_fitimage_initramfs.438362', 255, None, None)
ERROR: Logfile of failure stored in: /home/ubuntu/balena-beaglebone/build/tmp/work/beaglebone_play-poky-linux/linux-bb.org/5.10.162+gitAUTOINC+a2f5d5746b-r0/temp/log.do_assemble_fitimage_initramfs.438362
NOTE: recipe linux-bb.org-5.10.162+gitAUTOINC+a2f5d5746b-r0: task do_assemble_fitimage_initramfs: Failed
ERROR: Task (/home/ubuntu/balena-beaglebone/build/../layers/meta-ti/meta-ti-bsp/recipes-kernel/linux/linux-bb.org_git.bb:do_assemble_fitimage_initramfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3965 tasks of which 3940 didn't need to be rerun and 1 failed.

And the actual error message from the failing task:

DEBUG: Executing shell function do_assemble_fitimage_initramfs
gzip
uboot-mkimage Can't add hashes to FIT blob: -93
Unsupported hash algorithm (sha512) for 'hash-1' hash node in 'kernel-1' image node
WARNING: exit code 255 from a shell command.

It appears that the versions of u-boot (and u-boot-tools) that I am picking up have a signing step (for the uboot image) which appears to fail.

The so called PREFERRED_PROVIDER for the virtual/kernel for the beagleplay device (which, per the meta-ti-bsp layer, is set as below in the beagleplay.conf file) is linux-bb.org:

PREFERRED_PROVIDER_virtual/kernel = "linux-bb.org"

Should I be using the custom linux-beagleboard target (which is explicitly set in the layer.conf file of this repo) instead ?

PREFERRED_PROVIDER_virtual/kernel:beaglebone = "linux-beagleboard"

The one key difference between the balena layer builds and the ones from the meta-ti-bsp repo appears to be related to the (relatively recent) signing of uboot (and perhaps rootfs) images (there may be other difference, but this is what I have surmised so far).

Thoughts and suggestions are welcome.

Regards,

Sidd

delhiryder commented 1 year ago

This issue was caused because the bitbake process repeatedly picked up a stale (old) version of the uboot-mkimage executable from my ${WORKDIR}.

I added the following (explicit) line to the beaglebone-play.conf file:

PREFERRED_VERSION_u-boot-tools ?= "2022.01"

Then, I deleted the entire tmp folder (calling the clean, cleanall tasks for u-boot-tools didn't seem to do the trick).

And this error stopped happening.

Onto the (next) error...

delhiryder commented 1 year ago

Closing for now.