# Building Own Yocto image

**URL:** <https://forums.balena.io/t/building-own-yocto-image/359826>\
**Category:** balenaOS\
**Created:** [July 20, 2022, 7:00pm UTC](https://forums.balena.io/t/building-own-yocto-image/359826 "2022-07-20T19:00:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kumar-bala](https://avatars.discourse-cdn.com/v4/letter/k/97f17d/32.png) [@kumar-bala](https://forums.balena.io/u/kumar-bala)\
**Post date:** [July 20, 2022, 7:00pm UTC](https://forums.balena.io/t/building-own-yocto-image/359826/1 "2022-07-20T19:00:01Z")

</div>

Hi,  
I am trying to build the Yocto base image using the instructions [balenaOS - Docs](https://www.balena.io/os/docs/custom-build/).

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?

---

<div class="post-metadata">

**Author:** ![the-real-kenna](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/the-real-kenna/32/9598_2.png) [@the-real-kenna](https://forums.balena.io/u/the-real-kenna)\
**Post date:** [July 28, 2022, 12:38am UTC](https://forums.balena.io/t/building-own-yocto-image/359826/2 "2022-07-28T00:38:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kumar-bala](https://avatars.discourse-cdn.com/v4/letter/k/97f17d/32.png) [@kumar-bala](https://forums.balena.io/u/kumar-bala)\
**Post date:** [July 29, 2022, 3:28pm UTC](https://forums.balena.io/t/building-own-yocto-image/359826/5 "2022-07-29T15:28:28Z")

</div>

We are building for Raspberry Pi CM4 IO board.

Build steps

```auto
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

---

<div class="post-metadata">

**Author:** ![alexgg](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@alexgg](https://forums.balena.io/u/alexgg)\
**Post date:** [August 5, 2022, 4:42pm UTC](https://forums.balena.io/t/building-own-yocto-image/359826/6 "2022-08-05T16:42:37Z")

</div>

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

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

```

---

<div class="post-metadata">

**Author:** ![kumar-bala](https://avatars.discourse-cdn.com/v4/letter/k/97f17d/32.png) [@kumar-bala](https://forums.balena.io/u/kumar-bala)\
**Post date:** [August 5, 2022, 5:18pm UTC](https://forums.balena.io/t/building-own-yocto-image/359826/8 "2022-08-05T17:18:09Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [August 18, 2022, 11:48am UTC](https://forums.balena.io/t/building-own-yocto-image/359826/11 "2022-08-18T11:48:30Z")

</div>

Hello @kumar-bala

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