Building Own Yocto image

Hi,
I am trying to build the Yocto base image using the instructions balenaOS - Docs.

I have tried both Ubuntu 20.04 & 22.04 - the instructions do not work. Something is missing.

We have a paid account for Balena account and we would like to start customising our build.

I am trying to build v2.88.v-rev4.

On the same machines, the standard Yocto builds perfectly fine. However, Balena OS version of it using BARYS fails.

Which OS should we be using (Ubuntu 22.04 or something else?)

What are the instructions to build v2.88.v-rev4?

Or is there a more up to date version of the doc?

1 Like

Hi @kumar-bala,

Let’s see if we can sort out the issue:

  • Can you share what hardware you are trying to build for?
  • When you say the instructions don’t work, can you share more details about which step in the process particularly doesn’t work and in what way (something doesn’t load? there is an error message? etc.)

We are building for Raspberry Pi CM4 IO board.

Build steps

git clone https://github.com/balena-os/balena-raspberrypi
cd balena-raspberrypi
git checkout tags/v2.94.4+rev1 -b v2.94.4+rev1
git submodule update --init --recursive
./balena-yocto-scripts/build/barys -m raspberrypicm4-ioboard

binutils native & cross both fail.

ERROR: Unpack failure for URL: ‘git://sourceware.org/git/binutils-gdb.git;branch=binutils-2_37-branch;protocol=git’. No up to date source found: clone directory not available or not up to date: /opt/balena/balena-raspberrypi/build/downloads/git2/sourceware.org.git.binutils-gdb.git; shallow clone not enabled

DEBUG: Executing python function do_unpack
DEBUG: Executing python function base_do_unpack
ERROR: Unpack failure for URL: ‘git://sourceware.org/git/binutils-gdb.git;branch=binutils-2_37-branch;protocol=git’. No up to date source found: clone directory not available or not up to date: /opt/balena/balena-raspberrypi/build/downloads/git2/sourceware.org.git.binutils-gdb.git; shallow clone not enabled
DEBUG: Python function base_do_unpack finished
DEBUG: Python function do_unpack finished

Hi, are you able to clone the binutils repository from the same host computer you are building from, like:

git clone git://sourceware.org/git/binutils-gdb.git

Yes - I can. I have removed the build directory and restarted the build. Just to check if it is an issue with the downloads folder on Yocto.

I have 300GB hard drive. I believe this build only needs about 150GB?

Hello @kumar-bala

if you use --rm-work it might be enough. Anyway, the build will fail with a clear not enough space errorif that’s not the case.