Build Jetson Xavier Balena image from Yocto

Hi,

I am trying to build the balena os image from yocto build for the release tag v2.99.27+rev1.

I am following the following procedure to build.

  1. Clone the balena-jetson yocto source.
    $ git clone GitHub - balena-os/balena-jetson

  2. Download the needed dependencies (i.e) other yocto repositories needed for yocto build using following command.
    $ cd balena-jetson
    $ git submodule update --init --recursive

  3. Checkout to the release tag and create a temporary development branch.
    $ git checkout v2.99.27+rev1
    $ git checkout -b dev_branch

  4. Checkout to the tag v2.99.27 in the meta-balena source
    $ cd layers/meta-balena
    $ git checkout v2.99.27

  5. Move back to the balena-jetson directory.
    $ cd …/…/

  6. Build the Jetson xavier Balena OS image .
    $ balena-yocto-scripts/build/barys -b jetson_xavier_build --shared-downloads $HOME/downloads -m jetson-xavier

But I am facing the following issue in the yocto build.

ERROR: Traceback (most recent call last):
** File “/home/parthiban/Projects/Balena_Jetson/balena-jetson/layers/poky/bitbake/lib/bb/cookerdata.py”, line 162, in wrapped**
** return func(fn, args)*
** File “/home/parthiban/Projects/Balena_Jetson/balena-jetson/layers/poky/bitbake/lib/bb/cookerdata.py”, line 187, in parse_config_file**
** return bb.parse.handle(fn, data, include)**
** File “/home/parthiban/Projects/Balena_Jetson/balena-jetson/layers/poky/bitbake/lib/bb/parse/init.py”, line 107, in handle**
** return h[‘handle’](fn, data, include)**
** File “/home/parthiban/Projects/Balena_Jetson/balena-jetson/layers/poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py”, line 118, in handle**
** abs_fn = resolve_file(fn, data)**
** File “/home/parthiban/Projects/Balena_Jetson/balena-jetson/layers/poky/bitbake/lib/bb/parse/init.py”, line 133, in resolve_file**
** raise IOError(errno.ENOENT, “file %s not found” % fn)**
FileNotFoundError: [Errno 2] file /home/parthiban/Projects/Balena_Jetson/balena-jetson/nilecam25_jetson_xavier/…/layers/meta-rust/conf/layer.conf not found

ERROR: Unable to parse /home/parthiban/Projects/Balena_Jetson/balena-jetson/nilecam25_jetson_xavier/…/layers/meta-rust/conf/layer.conf: [Errno 2] file /home/parthiban/Projects/Balena_Jetson/balena-jetson/nilecam25_jetson_xavier/…/layers/meta-rust/conf/layer.conf not found
[000000010][LOG]Build for jetson-xavier failed. Check failed log in nilecam25_jetson_xavier/tmp/log/cooker/jetson-xavier .
[000000010][LOG]If build for jetson-xavier succeeded, final image should have been generated here:
[000000010][LOG] nilecam25_jetson_xavier/tmp/deploy/images/jetson-xavier/balena-image-jetson-xavier.balenaos-img
[000000010][LOG]Done.

When I searched the “balena-jetson/layers/meta-rust” there is no files present inside the directory.

Is there anything we are missing in the build? We need to build jetson xavier balena image for the L4T32.7.1

Thanks,
Arul.

Hi,

Any update on the above question?

Thanks,
Arul.

Hi,

We are trying to move up in the release tag v2.105.2+rev3 and could able to proceed with the build. But we face issues while unpacking tegra-firmware debian packages. Attached the error log (balena_error_log.txt) for your reference. Kindly help us to resolve this issue.

Thanks,
Arul.
balena_error_log.txt (9.2 KB)

Hi @koilarulraj-s,

We just wanted to acknowledge your message and say that we’ve pinged our Devices engineers to give it a look. But We’re wondering why you are trying to build this yourself though - the Jetson device-types are some of our most complex to design, so we’re hoping to better understand why you would choose to build it in this case? Is it to support a custom carrier board, or maybe some other reason?

Hi @the-real-kenna,

Thanks for your reply.

We are trying the build balena image from source to integrate our camera support to the Jetson AGX xavier source.

We have found the reason for the build issue. To extract the .zst tar files, layers/poky/bitbake/lib/bb/fetch2/init.py file needed additional command as given below. And this command is missed in the latest poky init scripts.

if datafile.endswith(‘.tzst’) or datafile.endswith(‘.tar.zst’):
cmd = ‘ar x %s %s && tar --use-compress-program=unzstd --no-same-owner -xpf %s && rm %s’ % (file, datafile, datafile, datafile)

Attached the updated file as a text file for your reference. init .txt|attachment (68.5 KB)

Kindly do the needful.

Thanks,
Arul

Hi Arul, in order to do local builds successfully it’s best to use ubuntu 18.04. We use the following Docker environment but a standalone ubuntu 18.04 setup works too: balena-yocto-scripts/Dockerfile_yocto-build-env at master · balena-os/balena-yocto-scripts · GitHub
Since you were able get so far in the build I assume you’re setup is compatible.

Next, when switching branches or tags in the main repository, please make sure to do a git submodule update --init --recursive so that all submodules are at the right revision.

Alo, if you wish to do a development build with enhanced logging, you can add the -d flag to barys: balena-yocto-scripts/build/barys -b jetson_xavier_build --shared-downloads $HOME/downloads -m jetson-xavier -d

Now, regarding the last build issue you encountered: before Kirkstone support was added to meta-balena, we used the same workaround you mention in the poky submodule: bitbake: Add fetch workaround for L4T 32.7.1 debs unpack · balena-os/poky@f9bcb85 · GitHub
which can be applied by doing:

cd layers/poky && git checkout jetson_32_7_1_debs_honister

However, in the latest revision of balena-jetson we updated the entire repository to use poky kirkstone and that workaround in our poky mirror is no longer necessary.

Hi @koilarulraj-s,

I realized we replied quite a few days after your last response, so wanted to ping you directly and make sure you saw that Alexandru replied to your question. Let us know if this gets you through your hurdles. :slight_smile: