<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Oliver's Dev Journal]]></title><description><![CDATA[Oliver's Dev Journal]]></description><link>https://oliverbatista.com</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 17:19:00 GMT</lastBuildDate><atom:link href="https://oliverbatista.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[iot observing with atalaia k8s]]></title><description><![CDATA[xcfghu-9y[=]]></description><link>https://oliverbatista.com/iot-observing-with-atalaia-k8s</link><guid isPermaLink="true">https://oliverbatista.com/iot-observing-with-atalaia-k8s</guid><category><![CDATA[iot]]></category><category><![CDATA[k8s]]></category><category><![CDATA[observability]]></category><category><![CDATA[gke]]></category><category><![CDATA[gcloud-cli]]></category><category><![CDATA[kubectl]]></category><dc:creator><![CDATA[Oliver M. Batista]]></dc:creator><pubDate>Tue, 02 Dec 2025 21:42:56 GMT</pubDate><content:encoded><![CDATA[<p>xcfghu-9y[=</p>
]]></content:encoded></item><item><title><![CDATA[Fix cedilha Fedora 42 Gnome 48]]></title><description><![CDATA[I am Brazilian, so I am often typing in Portuguese, and in the last 15 years as a Linux user configuring keyboard and keyboard layouts in Linux to have the ability of easily typing this character was always a ritual to be performed every time I insta...]]></description><link>https://oliverbatista.com/fix-cedilha-fedora-42-gnome-48</link><guid isPermaLink="true">https://oliverbatista.com/fix-cedilha-fedora-42-gnome-48</guid><category><![CDATA[cedilha]]></category><category><![CDATA[fix]]></category><category><![CDATA[Fedora]]></category><category><![CDATA[Gnome]]></category><category><![CDATA[portuguese]]></category><dc:creator><![CDATA[Oliver M. Batista]]></dc:creator><pubDate>Sun, 23 Nov 2025 14:24:22 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/HeWi6J5AN8o/upload/41a2ac4ca892b3dd48d0e32fe521c9ee.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I am Brazilian, so I am often typing in Portuguese, and in the last 15 years as a Linux user configuring keyboard and keyboard layouts in Linux to have the ability of easily typing this character was always a ritual to be performed every time I installed a fresh Linux OS.</p>
<p>Today is the day to face this challenge with my current OS of choice, Bluefin Project, which is not an OS… well it’s complicated. Anyway, let’s start the search with the latest Google model, Gemini 3.0.</p>
<p>The first suggestion is the creation of <code>~/.config/environment.d/cedilha.conf</code> and adding a couple of lines to “force” use of the cedilla module. This method did not work.</p>
<p>Second suggestion was about editing a <code>.XCompose</code> file. The name of the file got me suspicious since I am running <code>wayland</code> it sounded like an old way of fixing but I found out that this method <strong>do work</strong>. The library that manages the keyboard on <code>wayland</code> still maintain support for the <code>.XCompose</code> from <code>X11</code>. On top of that we have <code>Gnome</code> that ignores <code>.XCompose</code> by deafult. So we need to force <code>Gnome</code> and <code>QT</code> to use <code>xim</code> (X Input Method) and then have the <code>.XCompose</code> setup to replace the keystrokes <code>’+c</code> into <code>ç</code>.</p>
<h3 id="heading-force-xim">Force <code>xim</code></h3>
<pre><code class="lang-bash">mkdir -p ~/.config/environment.d &amp;&amp; <span class="hljs-built_in">printf</span> <span class="hljs-string">"GTK_IM_MODULE=xim\nQT_IM_MODULE=xim\n"</span> &gt; ~/.config/environment.d/cedilha.conf
</code></pre>
<h3 id="heading-config-xcompose">Config <code>.XCompose</code></h3>
<pre><code class="lang-bash"><span class="hljs-built_in">printf</span> <span class="hljs-string">'include "%%L"\n&lt;dead_acute&gt; &lt;c&gt; : "ç" Ccedilla\n&lt;dead_acute&gt; &lt;C&gt; : "Ç" Ccedilla\n'</span> &gt; ~/.XCompose
</code></pre>
<h2 id="heading-next-stes">Next stes?</h2>
<p>I guess the best would be to have my own <code>CI/CD action</code> building my system <code>.iso</code> which is how Project Bluefin operates to create the image I used to install this current system. And to my understand anyone can do the same even using their repository as base and adding on top of it.</p>
<p>🤔</p>
<p>Well, maybe a project idea for the next article. For now, I need to go back to <strong>C++&lt;</strong>insert a version<strong>\&gt;.</strong></p>
]]></content:encoded></item><item><title><![CDATA[Dive back into YOCTO]]></title><description><![CDATA[Don’t think, just type.
I am starting fresh with the journey to create a YOCTO development environment, building a linux to run on my BealgeY-AI board with the layers to try out the Arm Truezone feature. Next, I would like to have RAUC, hardened secu...]]></description><link>https://oliverbatista.com/dive-back-into-yocto</link><guid isPermaLink="true">https://oliverbatista.com/dive-back-into-yocto</guid><category><![CDATA[beaglebone]]></category><category><![CDATA[Texas Instruments]]></category><category><![CDATA[#yocto]]></category><category><![CDATA[Distrobox]]></category><category><![CDATA[ARM]]></category><category><![CDATA[TrustZone]]></category><dc:creator><![CDATA[Oliver M. Batista]]></dc:creator><pubDate>Fri, 07 Nov 2025 23:34:02 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/wkH63fOsWwM/upload/9d98bba9c902bf38229fff8d8a9828b9.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Don’t think, just type.</p>
<p>I am starting fresh with the journey to create a YOCTO development environment, building a linux to run on my BealgeY-AI board with the layers to try out the Arm Truezone feature. Next, I would like to have RAUC, hardened security, and monitoring, but let’s start with the distrobox.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1761597166107/3ac28e56-2635-46c2-9cda-d27ffa157808.png" alt class="image--center mx-auto" /></p>
<p>I run Project Bluefin (Fedora 42, GNOME 48) and it comes with everything to play around with distrobox and this is what I am going to use to create a separate environment from my host. From what I have seen so far the Ubuntu 22.04 LTS is the most used and recommended as base distro for running YOCTO tools and all it needs.</p>
<pre><code class="lang-bash">distrobox create --name yocto-box --image ubuntu:22.04
</code></pre>
<p>It will probably ask if you want to pull the image now. It shows <code>[Y/n]</code>, Y is capitalized meaning it is the default, just hit ENTER. And then:</p>
<pre><code class="lang-bash">distrobox enter yocto-box
</code></pre>
<p>It will take a bit of time, but you’ll see this:</p>
<pre><code class="lang-bash">Starting container...                        [ OK ]
Installing basic packages...                 [ OK ]
Setting up devpts mounts...                  [ OK ]
Setting up read-only mounts...               [ OK ]
Setting up read-write mounts...              [ OK ]
Setting up host<span class="hljs-string">'s sockets integration...     [ OK ]
Integrating host'</span>s themes, icons, fonts...     [ OK ]
Setting up distrobox profile...              [ OK ]
Setting up sudo...                           [ OK ]
Setting up user<span class="hljs-string">'s group list...              [ OK ]

Container Setup Complete!
📦[aviler@yocto-box Code]$</span>
</code></pre>
<p>After container is setup it will “login” us in. I am user <code>aviler</code> at the distrobox just created named <code>yocto-box</code>. The <code>Code</code> you see there is the current folder I am at in the disk, which is the equivalent of <code>~/Code/</code>.</p>
<p>Let’s install the packages we need for YOCTO, first required packages:</p>
<pre><code class="lang-bash">sudo apt update &amp;&amp; sudo apt upgrade -y &amp;&amp; sudo apt install -y gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev xterm python3-subunit mesa-common-dev zstd liblz4-tool python3-distutils python3-git python3-jinja2 python3-pexpect
</code></pre>
<p>Before cloning <code>poky</code> getting all files in place and starting <code>bitbaking</code> let’s do a recap.</p>
<h2 id="heading-what-is-yocto">What is YOCTO?</h2>
<blockquote>
<p>The Yocto Project is not a Linux distribution - it's a framework for creating custom Linux distributions for embedded devices. Think of it as a "Linux distro factory" rather than a pre-made distro itself</p>
</blockquote>
<p>At its core, Yocto Project provides:</p>
<ul>
<li><p><strong>Build System</strong>: OpenEmbedded-Core + BitBake engine</p>
</li>
<li><p><strong>Metadata</strong>: Recipes, configurations, and layers that define <em>what</em> to build</p>
</li>
<li><p><strong>Tools</strong>: For cross-compilation, packaging, and system generation</p>
</li>
<li><p><strong>Methodology</strong>: A collaborative, standards-based approach to embedded Linux yoctoproject</p>
</li>
</ul>
<p>The project follows a Layer Model. Each layer adds specific capabilities without modifying others. This is critical for maintainability and future-proofing. Most of the layers starts with “meta-” on their name, with the exception of “poky”, also a layer but no “meta-poky”.</p>
<p><strong>Layers</strong> (everything starting with "meta-"):</p>
<ul>
<li><p><code>meta-arm</code> - Arm architecture support</p>
</li>
<li><p><code>meta-ti</code> - TI processor support (includes BeagleY-AI)</p>
</li>
<li><p><code>meta-beagle</code> - BeagleBoard specific configurations</p>
</li>
<li><p><code>meta-forte</code> - Our custom layer for TrustZone</p>
</li>
</ul>
<p><strong>Recipes</strong> in the project:</p>
<ul>
<li><p>Recipes in the folder are instructions that build on components from the layers you added</p>
</li>
<li><p>You can create <code>.bbappend</code> files to extend existing recipes from other layers</p>
</li>
<li><p>You can create new <code>.bb</code> files that use components from the added layers</p>
</li>
</ul>
<p>So the <code>meta-forte</code> layer would contain:</p>
<ul>
<li><p><code>recipes-bsp/trusted-firmware-a/</code> - Extends TF-A from meta-arm</p>
</li>
<li><p><code>recipes-security/optee/</code> - Extends OP-TEE from meta-arm</p>
</li>
<li><p><code>conf/machine/beagley-ai.conf</code> - Your machine configuration</p>
</li>
</ul>
<p>Recipes don't replace the upstream ones - they customize them for your TrustZone implementation.</p>
<h2 id="heading-using-kas">Using Kas</h2>
<p>After struggling with <code>west</code> tool for no reason, I crossed with <code>kas</code>. The <code>kas</code> tool is the way to go. No git submodules, YAML file that can also pass down custom configs, simple and CI/CD friendly.</p>
<pre><code class="lang-bash"><span class="hljs-comment"># without kas</span>
git submodule init
git submodule update
<span class="hljs-built_in">source</span> oe-init-build-env
bitbake image

<span class="hljs-comment"># with kas</span>
kas build kas-project.yml
</code></pre>
<h2 id="heading-folder-structure">Folder structure</h2>
<p>After some “wasted” time researching about it, I settled for this blueprint:</p>
<pre><code class="lang-bash">meta-forte/                       (GitHub repository)
├── README.md                     (documents ENTIRE process)
├── .gitignore
├── kas.yml                       (main config)
├── kas/
│   ├── dev.yml                   (build with debug)
│   ├── prod.yml                  (optimized build)
│   └── sdk.yml                   (generates SDK)
├── layers/
│   └── meta-forte/               (your custom layer)
│       ├── conf/
│       │   ├── layer.conf
│       │   ├── machine/
│       │   │   └── beagley-ai.conf  (<span class="hljs-keyword">if</span> customization needed)
│       │   └── distro/
│       │       └── forte-distro.conf (your custom distro)
│       ├── recipes-kernel/
│       │   └── linux/            (kernel patches)
│       ├── recipes-security/
│       │   └── optee/            (TrustZone/OP-TEE recipes)
│       ├── recipes-core/
│       │   └── images/
│       │       └── forte-image.bb
│       ├── recipes-apps/
│       │   └── hello-trustzone/  (example app)
│       └── README.md
├── sources/                      (cloned by Kas - NOT versioned)
│   ├── poky/
│   ├── meta-openembedded/
│   ├── meta-arm/
│   ├── meta-ti/
│   └── meta-beagle/
├── build/                        (created by Kas - NOT versioned)
│   ├── conf/
│   └── tmp/
├── docs/                         
│   ├── 01-setup.md
│   ├── 02-build-process.md
│   ├── 03-trustzone-integration.md
│   └── architecture.png
└── scripts/                      (optional automation)
    ├── setup.sh
    └── flash-image.sh
</code></pre>
<p>The comments on the structure above say it all but I want to point out to things I like in it. The kas structure is very straightforward and again great when it comes to CI/CD tasks. Our layer is separated from the <code>sources</code> directory. The layer is considering having a trustzone <code>hello-world</code> example app, which is a next step for this project here.</p>
<p>From now on I will only make references and point it to files in the repo. I will make a separate article just for this base blueprint creation with steps and line commands. Here’s the link <a target="_blank" href="https://oliverbatista.com/yocto-blueprint">https://oliverbatista.com/yocto-blueprint</a>.</p>
<h3 id="heading-todo-start-the-git-project-using-the-yocto-blueprint">TODO: start the git project using the Yocto Blueprint.</h3>
<h3 id="heading-update-kas-is-ok-but-i-am-going-through-the-fixing-dependencies-misplace-comments-and-other-things-will-return-to-it-tomorrow">Update: kas is ok but I am going through the fixing dependencies, misplace comments and other things. Will return to it tomorrow.</h3>
<h3 id="heading-update2">Update2</h3>
<p>Finally came back to write in this article. The <a target="_blank" href="https://oliverbatista.com/yocto-blueprint">yocto blueprint</a> is building 🎉 I need to get the <code>git</code> repository setup and with all the changes I made to have the <code>yocto</code> procjet working.</p>
]]></content:encoded></item><item><title><![CDATA[Git inside distrobox]]></title><description><![CDATA[I ran this command from inside a distrobox. Because of old habits I installed git inside the distrobox. This message made me wonder how to approach this situtaion. Should I config everything in the host machine and have it somehow transfered to the d...]]></description><link>https://oliverbatista.com/git-inside-distrobox</link><guid isPermaLink="true">https://oliverbatista.com/git-inside-distrobox</guid><category><![CDATA[Git]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[Distrobox]]></category><category><![CDATA[ssh-keys]]></category><category><![CDATA[ssh-agent]]></category><dc:creator><![CDATA[Oliver M. Batista]]></dc:creator><pubDate>Fri, 07 Nov 2025 12:19:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/IEiAmhXehwE/upload/d44f24b7fe2ddeed529947196372849c.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1762466356486/b7e0d632-e2a6-4891-aca9-eade505072dd.png" alt class="image--center mx-auto" /></p>
<p>I ran this command from inside a distrobox. Because of old habits I installed git inside the distrobox. This message made me wonder how to approach this situtaion. Should I config everything in the host machine and have it somehow transfered to the distrobox when needed? Or let go with doing <code>git</code> inside distroboxes?</p>
<blockquote>
<p>Because Distrobox mounts the host's $HOME, running git config --global modifies the single, shared ~/.gitconfig file used by both the container and the host.</p>
</blockquote>
<p>Ok, cool. We can move on as if we were on the same machine. What about SSH keys?</p>
<p>Well, we already know that the whole <code>$HOME</code> is passed on, so the keys at <code>~/.ssh</code> are also available to the distrobox. It seems that we need to ensure that the host’s <code>ssh-agent</code> is running then:</p>
<blockquote>
<p>Distrobox typically passes required variables automatically, including <code>$SSH_AUTH_SOCK</code>, when you use the <code>distrobox enter</code> command.</p>
</blockquote>
<p>I could also write yet another post on how to deal with keys but these links below will help:</p>
<ul>
<li><p><a target="_blank" href="https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent">https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent</a></p>
<ul>
<li><p>I usually create one key per user/device instead of doing it “per service”.</p>
</li>
<li><p>I don’t use my email to create the key, instead: <code>ssh-keygen -t ed25519 -C "username@hostname"</code></p>
</li>
</ul>
</li>
<li><p><a target="_blank" href="https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account">https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account</a></p>
</li>
</ul>
<p>OK! I created a key and will try to use it inside a distrobox now.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1762517288928/f1562f25-4b32-42aa-9960-508c2d0f6e28.png" alt class="image--center mx-auto" /></p>
<p>It just works! Out of the box, well, in this case… anyways. I only had to answer <code>yes</code> to add <code>github.com</code> to my <code>knowhosts</code> file and is working. Time for me to go back to the parent article of this one.</p>
<p>Ops, forgot to add some important configuration. For the <code>user.name</code> I use the same from <code>github.com</code> but I believe you can use anything you want. And for the <code>user.email</code> I recommend enabling the private email option on <code>github.com</code> settings page(see below) and use that <code>@users.noreply.github.com</code> email they provide.</p>
<pre><code class="lang-bash">git config --global user.name <span class="hljs-string">"aviler"</span> &amp;&amp; git config --global user.email <span class="hljs-string">"399399+aviler@users.noreply.github.com"</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1762519996263/2c8177a3-89e2-408e-8ea3-7b579f930aef.png" alt class="image--center mx-auto" /></p>
]]></content:encoded></item><item><title><![CDATA[Yocto blueprint]]></title><description><![CDATA[Just some helpers/notes to start a new project with some passionate opinions.
Here's the complete setup process:
Step 1: Initial Repository Setup
mkdir meta-forte && cd meta-forte && git init -b main

Step 2: Create Directory Structure
mkdir -p layer...]]></description><link>https://oliverbatista.com/yocto-blueprint</link><guid isPermaLink="true">https://oliverbatista.com/yocto-blueprint</guid><category><![CDATA[optee]]></category><category><![CDATA[Linux]]></category><category><![CDATA[embedded]]></category><category><![CDATA[embedded linux]]></category><category><![CDATA[kas]]></category><category><![CDATA[#yocto]]></category><category><![CDATA[Blueprint]]></category><dc:creator><![CDATA[Oliver M. Batista]]></dc:creator><pubDate>Sun, 02 Nov 2025 15:03:07 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/URnyBZCnlIs/upload/9f53a7eb13517353d68000f88617db75.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Just some helpers/notes to start a new project with some passionate opinions.</p>
<p>Here's the complete setup process:</p>
<h2 id="heading-step-1-initial-repository-setup">Step 1: Initial Repository Setup</h2>
<pre><code class="lang-bash">mkdir meta-forte &amp;&amp; <span class="hljs-built_in">cd</span> meta-forte &amp;&amp; git init -b main
</code></pre>
<h2 id="heading-step-2-create-directory-structure">Step 2: Create Directory Structure</h2>
<pre><code class="lang-bash">mkdir -p layers/meta-forte/conf/{machine,distro} &amp;&amp; mkdir -p layers/meta-forte/recipes-{kernel/linux,security/optee,core/images,apps/hello-trustzone} &amp;&amp; mkdir -p kas docs scripts
</code></pre>
<p>You can check using <code>tree</code> command:</p>
<pre><code class="lang-plaintext">📦[aviler@yocto-box meta-forte]$ tree
.
├── docs
├── kas
├── layers
│   └── meta-forte
│       ├── conf
│       │   ├── distro
│       │   └── machine
│       ├── recipes-apps
│       │   └── hello-trustzone
│       ├── recipes-core
│       │   └── images
│       ├── recipes-kernel
│       │   └── linux
│       └── recipes-security
│           └── optee
└── scripts

16 directories, 0 files
</code></pre>
<h2 id="heading-step-3-create-gitignore">Step 3: Create .gitignore</h2>
<pre><code class="lang-bash">cat &gt; .gitignore &lt;&lt; <span class="hljs-string">'EOF'</span>
<span class="hljs-comment"># Kas artifacts</span>
sources/

<span class="hljs-comment"># Build outputs</span>
build/
downloads/
sstate-cache/
tmp/

<span class="hljs-comment"># Editor files</span>
*.swp
*~
.vscode/
.idea/

<span class="hljs-comment"># Python</span>
__pycache__/
*.pyc
EOF
</code></pre>
<h2 id="heading-step-4-create-main-kasyml">Step 4: Create Main kas.yml</h2>
<pre><code class="lang-bash">cat &gt; kas.yml &lt;&lt; <span class="hljs-string">'EOF'</span>
header:
  version: 14

machine: beagley-ai
distro: forte-distro

repos:
  poky:
    url: https://git.yoctoproject.org/git/poky
    branch: scarthgap
    layers:
      meta:
      meta-poky:

  meta-openembedded:
    url: git@github.com:openembedded/meta-openembedded.git
    branch: scarthgap
    layers:
      meta-oe:
      meta-python:
      meta-networking:

  meta-arm:
    url: https://git.yoctoproject.org/git/meta-arm
    branch: scarthgap
    layers:
      meta-arm:
      meta-arm-toolchain:

  meta-ti:
    url: git@github.com:TexasInstruments/meta-ti.git
    branch: scarthgap
    layers:
      meta-ti-bsp:
      meta-ti-extras:

  meta-forte:
    path: layers/meta-forte

bblayers_conf_header:
  forte: |
    <span class="hljs-comment"># Forte BeagleY-AI TrustZone Build Configuration</span>
    BBMASK += <span class="hljs-string">""</span>

local_conf_header:
  forte: |
    <span class="hljs-comment"># Build optimizations</span>
    BB_NUMBER_THREADS = <span class="hljs-string">"8"</span>
    PARALLEL_MAKE = <span class="hljs-string">"-j 8"</span>

    <span class="hljs-comment"># Package management</span>
    PACKAGE_CLASSES = <span class="hljs-string">"package_ipk"</span>

    <span class="hljs-comment"># Base features</span>
    EXTRA_IMAGE_FEATURES += <span class="hljs-string">"ssh-server-openssh tools-debug"</span>

    <span class="hljs-comment"># TrustZone/OP-TEE support (CORREÇÃO: hardware-specific)</span>
    MACHINE_FEATURES += <span class="hljs-string">"optee"</span>
    PREFERRED_PROVIDER_virtual/crypt = <span class="hljs-string">"optee-os"</span>
    ARM_TF_FLAGS += <span class="hljs-string">"TRUSTED_BOARD_BOOT=1"</span>

    <span class="hljs-comment"># TI AM62x specific</span>
    MACHINE_ESSENTIAL_EXTRA_RDEPENDS += <span class="hljs-string">"ti-sci-fw"</span>

target:
  - forte-image
EOF
</code></pre>
<details><summary>Updates on the kas.yml</summary><div data-type="detailsContent">The key <code>refspec</code> was deprecated so replaced with <code>branch</code> to avoid warning messages. Removed deprecated <code>meta-beagle</code> layer. Update <code>github</code> URLS to fix authenticate issues with HTTPS.</div></details>

<h2 id="heading-step-5-create-kas-variants">Step 5: Create Kas Variants</h2>
<pre><code class="lang-bash">cat &gt; kas/dev.yml &lt;&lt; <span class="hljs-string">'EOF'</span>
header:
  version: 14
  includes:
    - ../kas.yml

local_conf_header:
  dev: |
    <span class="hljs-comment"># Development build settings</span>
    EXTRA_IMAGE_FEATURES += <span class="hljs-string">"debug-tweaks tools-sdk tools-debug"</span>

    <span class="hljs-comment"># Enable core dumps and debug symbols</span>
    IMAGE_FEATURES += <span class="hljs-string">"dbg-pkgs dev-pkgs"</span>

    <span class="hljs-comment"># Keep debug info</span>
    INHIBIT_PACKAGE_STRIP = <span class="hljs-string">"1"</span>

    <span class="hljs-comment"># Serial console access</span>
    SERIAL_CONSOLES = <span class="hljs-string">"115200;ttyS0"</span>
EOF
</code></pre>
<pre><code class="lang-bash">cat &gt; kas/prod.yml &lt;&lt; <span class="hljs-string">'EOF'</span>
header:
  version: 14
  includes:
    - ../kas.yml

local_conf_header:
  prod: |
    <span class="hljs-comment"># Production build settings</span>
    EXTRA_IMAGE_FEATURES:remove = <span class="hljs-string">"debug-tweaks"</span>

    <span class="hljs-comment"># Size optimization</span>
    IMAGE_FEATURES += <span class="hljs-string">"read-only-rootfs"</span>

    <span class="hljs-comment"># Strip debug symbols</span>
    INHIBIT_PACKAGE_DEBUG_SPLIT = <span class="hljs-string">"1"</span>

    <span class="hljs-comment"># Security hardening</span>
    EXTRA_IMAGE_FEATURES += <span class="hljs-string">"secure-core-image"</span>
EOF
</code></pre>
<pre><code class="lang-bash">cat &gt; kas/sdk.yml &lt;&lt; <span class="hljs-string">'EOF'</span>
header:
  version: 14
  includes:
    - ../kas.yml

target:
  - forte-image
  - meta-toolchain
EOF
</code></pre>
<h2 id="heading-step-6-create-layer-configuration">Step 6: Create Layer Configuration</h2>
<pre><code class="lang-bash">cat &gt; layers/meta-forte/conf/layer.conf &lt;&lt; <span class="hljs-string">'EOF'</span>
<span class="hljs-comment"># We have a conf and classes directory, add to BBPATH</span>
BBPATH .= <span class="hljs-string">":<span class="hljs-variable">${LAYERDIR}</span>"</span>

<span class="hljs-comment"># We have recipes-* directories, add to BBFILES</span>
BBFILES += <span class="hljs-string">"<span class="hljs-variable">${LAYERDIR}</span>/recipes-*/*/*.bb \
            <span class="hljs-variable">${LAYERDIR}</span>/recipes-*/*/*.bbappend"</span>

BBFILE_COLLECTIONS += <span class="hljs-string">"meta-forte"</span>
BBFILE_PATTERN_meta-forte = <span class="hljs-string">"^<span class="hljs-variable">${LAYERDIR}</span>/"</span>
BBFILE_PRIORITY_meta-forte = <span class="hljs-string">"10"</span>

<span class="hljs-comment"># CORREÇÃO ESSENCIAL: dependências explícitas</span>
LAYERDEPENDS_meta-forte = <span class="hljs-string">"poky meta-arm meta-ti meta-beagle meta-openembedded"</span>
LAYERSERIES_COMPAT_meta-forte = <span class="hljs-string">"scarthgap"</span>
EOF
</code></pre>
<h2 id="heading-step-7-create-distro-configuration">Step 7: Create Distro Configuration</h2>
<pre><code class="lang-bash">cat &gt; layers/meta-forte/conf/distro/forte-distro.conf &lt;&lt; <span class="hljs-string">'EOF'</span>
require conf/distro/poky.conf

DISTRO = <span class="hljs-string">"forte-distro"</span>
DISTRO_NAME = <span class="hljs-string">"Forte Linux (Yocto Project based Distro)"</span>
DISTRO_VERSION = <span class="hljs-string">"1.0"</span>
DISTRO_CODENAME = <span class="hljs-string">"scarthgap"</span>

MAINTAINER = <span class="hljs-string">"Oliver M. Batista &lt;code.monitor759@aleeas.com&gt;"</span>

<span class="hljs-comment"># TrustZone/OP-TEE support</span>
DISTRO_FEATURES:append = <span class="hljs-string">" optee"</span>

<span class="hljs-comment"># TI-specific optimizations</span>
DISTRO_FEATURES:append = <span class="hljs-string">" sgx"</span>  <span class="hljs-comment"># GPU acceleration</span>
DISTRO_FEATURES:append = <span class="hljs-string">" virtualization"</span> <span class="hljs-comment"># KVM support</span>

<span class="hljs-comment"># TI SDK compatibility</span>
PREFERRED_PROVIDER_virtual/mesa = <span class="hljs-string">"mesa-pvr"</span>
PREFERRED_PROVIDER_virtual/libgles1 = <span class="hljs-string">"ti-sgx-ddk-um"</span>
PREFERRED_PROVIDER_virtual/libgles2 = <span class="hljs-string">"ti-sgx-ddk-um"</span>
PREFERRED_PROVIDER_virtual/egl = <span class="hljs-string">"ti-sgx-ddk-um"</span>

<span class="hljs-comment"># Systemd preferred</span>
VIRTUAL-RUNTIME_init_manager = <span class="hljs-string">"systemd"</span>
EOF
</code></pre>
<h2 id="heading-step-75-create-machine-configuration">Step 7.5: Create machine configuration</h2>
<pre><code class="lang-bash">cat &gt; layers/meta-forte/conf/machine/beagley-ai.conf &lt;&lt; <span class="hljs-string">'EOF'</span>
<span class="hljs-comment"># @NAME: BeagleY-AI Machine Configuration</span>
include conf/machine/include/ti-am62x.inc

MACHINE = <span class="hljs-string">"beagley-ai"</span>
MACHINE_FEATURES += <span class="hljs-string">"screen gpu wifi bluetooth cryptoprocessor"</span>

<span class="hljs-comment"># Firmware requirements</span>
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += <span class="hljs-string">" \
    trustzone-standalonefw \
    optee-os-ti \
"</span>

<span class="hljs-comment"># Device tree and kernel config</span>
KERNEL_DEVICETREE = <span class="hljs-string">"ti/k3-am625-beagley-a1.dtb"</span>
UBOOT_MACHINE = <span class="hljs-string">"am62x_evm_a53_defconfig"</span>

<span class="hljs-comment"># TrustZone specific</span>
OPTEE_PLATFORM = <span class="hljs-string">"k3-am62x"</span>
OPTEE_EXTRA_BUILDARGS = <span class="hljs-string">"PLATFORM=ti-k3"</span>
EOF
</code></pre>
<h2 id="heading-step-8-create-minimal-image-recipe">Step 8: Create Minimal Image Recipe</h2>
<pre><code class="lang-bash">cat &gt; layers/meta-forte/recipes-core/images/forte-image.bb &lt;&lt; <span class="hljs-string">'EOF'</span>
SUMMARY = <span class="hljs-string">"Forte minimal image with TrustZone support"</span>
LICENSE = <span class="hljs-string">"MIT"</span>

inherit core-image

<span class="hljs-comment"># Base image features</span>
IMAGE_INSTALL:append = <span class="hljs-string">" \
    kernel-modules \
    openssh \
    optee-os-ti \                 # TI-specific
    optee-client \
    optee-test \
    ti-sgx-ddk-um \               # GPU drivers
    trustzone-standalonefw \      # TrustZone
    ti-sci-fw \                   # Firmware management
"</span>

<span class="hljs-comment"># Security packages</span>
IMAGE_INSTALL:append = <span class="hljs-string">" \
    packagegroup-security-optee \
    tpm2-tools \
    swtpm \
"</span>

<span class="hljs-comment"># Root filesystem extra space (MB)</span>
IMAGE_ROOTFS_EXTRA_SPACE = <span class="hljs-string">"500"</span>

<span class="hljs-comment"># Image types (WB: Beagle-specific)</span>
IMAGE_FSTYPES = <span class="hljs-string">"wic wic.bmap tar.xz"</span>
WKS_FILE = <span class="hljs-string">"beaglebone-yocto.wks"</span>
EOF
</code></pre>
<h2 id="heading-step-9-create-layer-readme">Step 9: Create Layer README</h2>
<pre><code class="lang-bash">cat &gt; layers/meta-forte/README.md &lt;&lt; <span class="hljs-string">'EOF'</span>
<span class="hljs-comment"># meta-forte Layer</span>

Custom Yocto layer <span class="hljs-keyword">for</span> BeagleY-AI with TrustZone/OP-TEE support.

<span class="hljs-comment">## Layer Dependencies</span>
- meta (poky)
- meta-arm
- meta-ti
- meta-beagle
- meta-oe (meta-openembedded)

<span class="hljs-comment">## Recipes</span>
- **recipes-core/images**: Custom image definitions
- **recipes-kernel/linux**: Kernel patches and configurations
- **recipes-security/optee**: OP-TEE trusted applications
- **recipes-apps**: Example applications

<span class="hljs-comment">## Distro</span>
- **forte-distro**: Custom distribution with TrustZone support

<span class="hljs-comment">## Machine</span>
- **beagley-ai**: BeagleY-AI board configuration (uses meta-beagle defaults)

<span class="hljs-comment">## Verification Commands</span>
```bash
bitbake-layers show-layers | grep <span class="hljs-string">"meta-forte"</span>
bitbake-layers show-recipes <span class="hljs-string">"optee-*"</span>
```

<span class="hljs-comment">## Secure Boot Flow (need to verify)</span>
- ARM TF-A (BL1/BL2) <span class="hljs-keyword">in</span> secure world
- OP-TEE OS initializes secure partitions
- U-Boot (BL33 <span class="hljs-keyword">in</span> non-secure world)
- Linux kernel with OP-TEE drivers
EOF
</code></pre>
<h2 id="heading-step-10-create-main-readme">Step 10: Create Main README</h2>
<pre><code class="lang-bash">cat &gt; README.md &lt;&lt; <span class="hljs-string">'EOF'</span>
<span class="hljs-comment"># BeagleY-AI TrustZone Yocto Study Project</span>

Study project demonstrating a custom Yocto build <span class="hljs-keyword">for</span> BeagleY-AI with 
TrustZone/OP-TEE integration using modern, scalable practices.

<span class="hljs-comment">## 🎯 Objectives</span>
- Learn Yocto with professional approach
- Custom build <span class="hljs-keyword">for</span> BeagleY-AI (TI AM62x)
- TrustZone/OP-TEE security integration
- Kas integration <span class="hljs-keyword">for</span> reproducibility
- Document complete process

<span class="hljs-comment">## 🚀 Quick Start</span>

<span class="hljs-comment">### Prerequisites</span>
```bash
<span class="hljs-comment"># Install Kas</span>
pip3 install kas

<span class="hljs-comment"># Install dependencies (Ubuntu/Debian)</span>
sudo apt-get install gawk wget git diffstat unzip texinfo \
  gcc build-essential chrpath socat cpio python3 python3-pip \
  python3-pexpect xz-utils debianutils iputils-ping python3-git \
  python3-jinja2 libegl1-mesa libsdl1.2-dev pylint xterm \
  python3-subunit mesa-common-dev zstd liblz4-tool
```

<span class="hljs-comment">### Build Commands</span>
```bash
<span class="hljs-comment"># Clone repository</span>
git <span class="hljs-built_in">clone</span> https://github.com/aviler/meta-forte.git
<span class="hljs-built_in">cd</span> meta-forte

<span class="hljs-comment"># Development build</span>
kas build kas.yml:kas/dev.yml

<span class="hljs-comment"># Production build</span>
kas build kas.yml:kas/prod.yml

<span class="hljs-comment"># Generate SDK</span>
kas build kas.yml:kas/sdk.yml
```

<span class="hljs-comment">### Flash to SD Card</span>
```bash
<span class="hljs-comment"># Find your SD card device (e.g., /dev/sdX)</span>
lsblk

<span class="hljs-comment"># Flash image (replace sdX with your device)</span>
sudo dd <span class="hljs-keyword">if</span>=build/tmp/deploy/images/beagley-ai/forte-image-beagley-ai.wic \
        of=/dev/sdX bs=4M status=progress &amp;&amp; sync
```

<span class="hljs-comment">## 🏗️ Architecture</span>

<span class="hljs-comment">### Layer Stack</span>
```
meta-forte (custom)
    ↓
meta-beagle (BeagleBoard configs)
    ↓
meta-ti (TI AM62x BSP)
    ↓
meta-arm (ARM architecture + TrustZone)
    ↓
meta-openembedded (additional recipes)
    ↓
poky (base Yocto)
```

<span class="hljs-comment">### Key Technologies</span>
- **Yocto Project**: Embedded Linux build system
- **Kas**: Declarative build configuration
- **OP-TEE**: Trusted Execution Environment
- **TI AM62x**: ARM Cortex-A53 + Cortex-M4F processor
- **BeagleY-AI**: Development board

<span class="hljs-comment">## 📚 Documentation</span>
- [Setup Guide](docs/01-setup.md) - Initial environment setup
- [Build Process](docs/02-build-process.md) - Understanding the build
- [TrustZone Integration](docs/03-trustzone-integration.md) - OP-TEE setup

<span class="hljs-comment">## 📝 Key Learnings</span>
- Modern Kas approach vs traditional git submodules
- Custom layer structuring and dependencies
- BSP integration <span class="hljs-keyword">for</span> TI AM62x platform
- TrustZone/OP-TEE security architecture
- Build variant management (dev/prod/sdk)
- Reproducible build environments

<span class="hljs-comment">## 👤 Author</span>
Oliver M. Batista - [Blog](https://olivermbatista.com) - [LinkedIn](https://www.linkedin.com/<span class="hljs-keyword">in</span>/oliver-batista/)
EOF
</code></pre>
<h2 id="heading-step-12-create-helper-scripts">Step 12: Create Helper Scripts</h2>
<pre><code class="lang-bash">cat &gt; scripts/setup.sh &lt;&lt; <span class="hljs-string">'EOF'</span>
<span class="hljs-comment">#!/bin/bash</span>
<span class="hljs-comment"># Quick setup script</span>

<span class="hljs-built_in">echo</span> <span class="hljs-string">"Installing Kas..."</span>
pip3 install --user kas

<span class="hljs-built_in">echo</span> <span class="hljs-string">"Checking dependencies..."</span>
kas --version

<span class="hljs-built_in">echo</span> <span class="hljs-string">"Setup complete! Run 'kas build kas.yml:kas/dev.yml' to build"</span>
EOF
</code></pre>
<pre><code class="lang-bash">chmod +x scripts/setup.sh
</code></pre>
<pre><code class="lang-bash">cat &gt; scripts/flash-image.sh &lt;&lt; <span class="hljs-string">'EOF'</span>
<span class="hljs-comment">#!/bin/bash</span>
<span class="hljs-comment"># Flash image to SD card</span>

<span class="hljs-keyword">if</span> [ -z <span class="hljs-string">"<span class="hljs-variable">$1</span>"</span> ]; <span class="hljs-keyword">then</span>
    <span class="hljs-built_in">echo</span> <span class="hljs-string">"Usage: <span class="hljs-variable">$0</span> /dev/sdX"</span>
    <span class="hljs-built_in">echo</span> <span class="hljs-string">"Available devices:"</span>
    lsblk -d -o NAME,SIZE,TYPE | grep disk
    <span class="hljs-built_in">exit</span> 1
<span class="hljs-keyword">fi</span>

IMAGE=<span class="hljs-string">"build/tmp/deploy/images/beagley-ai/forte-image-beagley-ai.wic"</span>

<span class="hljs-keyword">if</span> [ ! -f <span class="hljs-string">"<span class="hljs-variable">$IMAGE</span>"</span> ]; <span class="hljs-keyword">then</span>
    <span class="hljs-built_in">echo</span> <span class="hljs-string">"Error: Image not found at <span class="hljs-variable">$IMAGE</span>"</span>
    <span class="hljs-built_in">echo</span> <span class="hljs-string">"Run a build first: kas build kas.yml:kas/dev.yml"</span>
    <span class="hljs-built_in">exit</span> 1
<span class="hljs-keyword">fi</span>

<span class="hljs-built_in">echo</span> <span class="hljs-string">"Flashing <span class="hljs-variable">$IMAGE</span> to <span class="hljs-variable">$1</span>..."</span>
sudo dd <span class="hljs-keyword">if</span>=<span class="hljs-variable">$IMAGE</span> of=<span class="hljs-variable">$1</span> bs=4M status=progress &amp;&amp; sync
<span class="hljs-built_in">echo</span> <span class="hljs-string">"Done!"</span>
EOF
</code></pre>
<pre><code class="lang-bash">chmod +x scripts/flash-image.sh
</code></pre>
<h2 id="heading-step-13-initial-git-commit">Step 13: Initial Git Commit</h2>
<pre><code class="lang-bash">git add . &amp;&amp; git commit -m <span class="hljs-string">"Initial project structure with Kas configuration"</span>
</code></pre>
<p>Had to branch out another article because I tried the command above on a super fresh new machine missing some <code>git</code> configuration, check it here <a target="_blank" href="https://oliverbatista.com/git-inside-distrobox">Git inside Distrobox</a>.</p>
<h2 id="heading-step-14-verify-structure">Step 14: Verify Structure</h2>
<pre><code class="lang-bash">tree -L 3 -a
</code></pre>
<h2 id="heading-step-15-install-and-check-kas-configuration">Step 15: Install and check Kas Configuration</h2>
<p>Oh snap, forgot to install kas:</p>
<pre><code class="lang-bash">pip3 install kas
</code></pre>
<details><summary>Update</summary><div data-type="detailsContent">The comand below would initialy bring some issues with repository addresses declared on the <code>kas.yml</code> file I already update file contents above. I’ll leave a image here that show the issue. Added <code>meta-beagle</code> layer to <code>meta-ti</code>.</div></details>

<pre><code class="lang-bash">kas dump kas.yml
</code></pre>
<p>We should see that everything went good and in the end of the log <code>kas</code> just rewrites the <code>kas.yml</code> file.</p>
<h2 id="heading-what-kas-will-populate">What Kas Will Populate</h2>
<p>When you run <code>kas build kas.yml</code>, Kas will automatically:</p>
<ol>
<li><p><strong>Clone all repositories</strong> into <code>sources/</code>:</p>
<ul>
<li><p>poky</p>
</li>
<li><p>meta-arm</p>
</li>
<li><p>meta-ti</p>
</li>
<li><p>meta-openembedded</p>
</li>
</ul>
</li>
<li><p><strong>Create build directory</strong> with:</p>
<ul>
<li><p><code>build/conf/local.conf</code> (from your kas.yml config)</p>
</li>
<li><p><code>build/conf/bblayers.conf</code> (from layer definitions)</p>
</li>
<li><p><code>build/tmp/</code> (build artifacts)</p>
</li>
</ul>
</li>
<li><p><strong>Download sources</strong> into <code>downloads/</code></p>
</li>
<li><p><strong>Create sstate cache</strong> in <code>sstate-cache/</code></p>
</li>
</ol>
<h2 id="heading-final-structure-after-first-build">Final Structure After First Build</h2>
<pre><code class="lang-bash">meta-forte/
├── layers/meta-forte/        (you created)
├── kas.yml                    (you created)
├── kas/                       (you created)
├── docs/                      (you created)
├── scripts/                   (you created)
├── sources/                   (Kas clones this)
├── build/                     (Kas creates this)
├── downloads/                 (Kas creates this)
└── sstate-cache/             (Kas creates this)
</code></pre>
<h2 id="heading-summary-of-manual-vs-automated">Summary of Manual vs Automated</h2>
<p><strong>You create manually</strong> (Steps 1-13):</p>
<ul>
<li><p>Directory structure</p>
</li>
<li><p>Configuration files (kas.yml, layer.conf, etc.)</p>
</li>
<li><p>Your custom recipes</p>
</li>
<li><p>Documentation</p>
</li>
<li><p>Helper scripts</p>
</li>
</ul>
<p><strong>Kas creates automatically</strong> (when you run <code>kas build</code>):</p>
<ul>
<li><p><code>sources/</code> - All dependency layers</p>
</li>
<li><p><code>build/</code> - Build configuration and outputs</p>
</li>
<li><p><code>downloads/</code> - Source tarballs</p>
</li>
<li><p><code>sstate-cache/</code> - Shared state cache</p>
</li>
</ul>
<p>This gives you a <strong>production-ready project structure</strong> that's fully reproducible! 🚀</p>
<hr />
<h2 id="heading-follow-up-from-steps-above">Follow up from steps above</h2>
<p>Just created all the files required and run it <code>kas dump kas.yml</code> with success. I mean with still some small issues that I recorded above. Let’s try to build now.</p>
<p>The building attempts have resulted in the errors below</p>
<p>This is a summary of the recent BitBake errors encountered and the corresponding fixes:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Error #</strong></td><td><strong>Description</strong></td><td><strong>Root Cause</strong></td><td><strong>Resolution</strong></td></tr>
</thead>
<tbody>
<tr>
<td><strong>1 (ParseError)</strong></td><td>BitBake failed to parse <code>forte-distro.conf</code>.</td><td>An inline comment (<code># GPU acceleration</code>) was placed on the same line as a variable assignment (<code>DISTRO_FEATURES:append = ...</code>). BitBake requires comments to be on separate lines.</td><td>The comment was moved or removed from the assignment line.</td></tr>
<tr>
<td><strong>2 (Host Tool Missing)</strong></td><td>BitBake failed to start due to missing system tools.</td><td>The essential host utility <code>file</code> (specified by <code>HOSTTOOLS</code>) was not found in the host system's <code>$PATH</code>.</td><td>The <code>file</code> utility package was installed on the host operating system.</td></tr>
<tr>
<td><strong>3 (Layer Dependency)</strong></td><td><code>meta-forte</code> reported dependency errors (e.g., "depends on layer 'poky', but this layer is not enabled").</td><td>The layers were enabled in <code>bblayers.conf</code>, but the local layer (<code>meta-forte/conf/layer.conf</code>) used the wrong dependency names (full repository names like <code>poky</code> or <code>meta-ti</code>).</td><td>The dependency definition (<code>LAYERDEPENDS_meta-forte</code>) was corrected to use the required short collection names (e.g., <code>core</code>, <code>meta-oe</code>, <code>ti-bsp</code>) found in each sublayer's <code>conf/layer.conf</code>.</td></tr>
</tbody>
</table>
</div><h3 id="heading-lets-try-again">Let’s try again</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1762610736362/4e77e286-ae22-403b-a04a-97a53defb653.png" alt class="image--center mx-auto" /></p>
<p>Ok, oh by the way, today we are searching with <code>Deepseek R1T2 Chimera</code>. The errors were about dependencies declared in <code>meta-forte/conf/layer.conf</code> but missing from the <code>kas</code> config.</p>
<p>Ok had a new error because I was adding <code>yocto</code> to the key/value below from meta-forte/conf/layer.conf</p>
<pre><code class="lang-bash">LAYERDEPENDS_meta-forte = <span class="hljs-string">"yocto core meta-ti-extras meta-ti-bsp meta-beagle meta-python openembedded-layer networking-layer arm-toolchain meta-arm"</span>
</code></pre>
<p>Thing is that we are creating a custom meta-layer and in this sense <code>yocto</code> in <code>LAYERDEPENDS_</code> is wrong. The <code>meta-poky</code> is a reference/example layer, it can’t be used as dependency for other custom layers like how we are creating <code>meta-forte</code> to be. We don’t need <code>meta-poky</code> as dependency for <code>meta-forte</code> layer but we still need to declare it in the <code>kas.yml</code> file so we use some base configurations in our distro. We define a distro ourselves at<code>meta-forte/layers/meta-forte/conf/distro/forte-distro.conf</code>.</p>
<p>Well the error message changed:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1762643418893/ae2411d8-864c-4271-aba7-9ab3663fe9ef.png" alt class="image--center mx-auto" /></p>
<p>After researching I have a guess that this might be related with my attempt to create a custom <code>machine</code> to wrapper the official one. Made some mistakes in the file <code>meta-forte/conf/machine/beagley-ai.conf</code> and will try to make the changes below and try again.</p>
<pre><code class="lang-bash">require conf/machine/beagley-ai.conf

<span class="hljs-comment"># @NAME: BeagleY-AI Machine Configuration</span>

<span class="hljs-comment"># No need to define we get it from the requite in the top of this file</span>
<span class="hljs-comment">#MACHINE = "beagley-ai"</span>
MACHINE_FEATURES += <span class="hljs-string">"screen gpu wifi bluetooth cryptoprocessor"</span>

<span class="hljs-comment"># Rest of the file remains how it was</span>
</code></pre>
<h3 id="heading-new-error-during-build">New error during build</h3>
<p>And also some weird behaviour from this blog editor from hashnode.com 😒 I guess I need to go back to old habits like typing <code>CTRL+S</code> every 3-5 words. So I am facing this bundle of <code>warnings</code> ending in as <code>error</code> and it’s all related.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1762720840094/198f8e37-8b52-4bc8-b6e5-afa21d8c48c0.png" alt class="image--center mx-auto" /></p>
<p>Is a Python <code>RecursionError</code> generated by this endless loop of self include in the <code>layers/meta-forte/conf/machine/beagley-ai.conf</code> we let it happen. The file requires a beagly-ai.conf. Then <code>bitbake</code> go search this file. It finds the same but includes anyways, repeting until it reaches its limit. So I removed the “self” inclusion, added two new <code>require</code> entries and did some cleaning compared to the original.</p>
<pre><code class="lang-bash"><span class="hljs-comment"># layers/meta-forte/conf/machine/beagley-ai.conf</span>

<span class="hljs-comment"># Get the base for BeagleY-AI (SoC J722S)</span>
require conf/machine/include/j722s.inc
require conf/machine/include/beagle-bsp.inc

<span class="hljs-comment"># Add desired features</span>
MACHINE_FEATURES += <span class="hljs-string">"screen gpu wifi bluetooth cryptoprocessor"</span>

<span class="hljs-comment"># Add firmware dependency for TrustZone/OP-TEE</span>
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += <span class="hljs-string">" \
    trustzone-standalonefw \
    optee-os-ti \
"</span>

<span class="hljs-comment"># TrustZone specific</span>
<span class="hljs-comment"># Still need to check if these values are correct</span>
OPTEE_PLATFORM = <span class="hljs-string">"k3-am62x"</span>
OPTEE_EXTRA_BUILDARGS = <span class="hljs-string">"PLATFORM=ti-k3"</span>
</code></pre>
<p>And it worked because at least the layer resolution got solved by <code>bitbake</code> and now I see some sort of parsing issue.</p>
<pre><code class="lang-bash">ERROR: /var/home/aviler/Code/meta-forte/build/../poky/meta/recipes-core/packagegroups/packagegroup-rust-cross-canadian.bb: Please ensure that your setting of VIRTUAL-RUNTIME_init_manager (systemd) matches the entries enabled <span class="hljs-keyword">in</span> DISTRO_FEATURES
ERROR: /var/home/aviler/Code/meta-forte/build/../poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb: Please ensure that your setting of VIRTUAL-RUNTIME_init_manager (systemd) matches the entries enabled <span class="hljs-keyword">in</span> DISTRO_FEATURES

Summary: There were 58 ERROR messages, returning a non-zero <span class="hljs-built_in">exit</span> code.
2025-11-09 21:58:34 - ERROR    - Command <span class="hljs-string">"/var/home/aviler/Code/meta-forte/poky/bitbake/bin/bitbake -c build forte-image"</span> failed with error 1
📦[aviler@yocto-box meta-forte]$
</code></pre>
<p>The amazing thing about Yocto is that you not only need many files but you also need to be consistent in between configuration files. So, I wanted to have <code>systemd</code> so I added the key <code>VIRTUAL-RUNTIME_init_manager = "systemd"</code>, but for this to work, I also need to explicitly ask for the feature with <code>DISTRO_FEATURES:append = " systemd"</code>. And, that solves. Ok! Next error 😂</p>
<p>And I fall again for the misplaced <code>#</code> comment in files:</p>
<pre><code class="lang-bash">ERROR: ParseError at .../forte-image.bb:10: unparsed line: <span class="hljs-string">'IMAGE_INSTALL:append = " ... optee-os-ti \ # TI-specific'</span>
</code></pre>
<p>Just went to <code>forte-image.bb</code> file and removed the comments written in the end of the line. I can say it worked because my laptop fans are going crazy parsing the recipes here. All recipes parsed but still other errors, let’s fix it!</p>
<h3 id="heading-and-we-are-back-at-it">And we are back at it</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1762778343748/650d2ab1-5967-4921-a16f-f1c5a2a83f53.png" alt class="image--center mx-auto" /></p>
<p>The above error list is about a missing <code>UBOOT_MACHINE</code> declaration. I thought the previously added dependencies would define it, but I was wrong.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1762778742435/e0fded21-f6e5-483d-ae2e-c0d8f19899b2.png" alt class="image--center mx-auto" /></p>
<p>Still don’t get why we can’t just “include” this file and accept whatever it says and on our custom layer we just declare things that we would like to override. So, I added the <code>UBOOT_MACHINE</code> config and that fix it.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1762781493884/aad13d34-75bf-4a6a-8799-ec82be2cc9d9.png" alt class="image--center mx-auto" /></p>
<p>The <code>optee</code> things are not on the <code>meta-ti</code> layer but in the <code>meta-arm</code> one. Will update package name from <code>optee-os-ti</code> to <code>optee-os</code> at the files <code>forte-image.bb</code> and in our custom machine definition <code>beagley-ai.conf</code>.</p>
<p>Ok, so my first draft for this project was based on <code>beaglebone-black</code> examples which of course would not work with <code>beagley-ai</code>. I am removing references of <code>ti-sgx-ddk-um</code> and other graphics related. Hopefully, a correct configuration will be finded by <code>bitbake</code> if not is ok since I don’t need any graphics related stuff for now.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1762785723053/fc664a8d-6dde-4079-a747-b854d7750132.png" alt class="image--center mx-auto" /></p>
<p>Another wrong package name, replacing <code>trustzone-standalonefw</code> with <code>arm-trusted-firmware</code>. It didn’t work, same error but now about <code>arm-trusted-firmware</code>.</p>
<p>Removed more clutter like below. Beagley-ai has no TPM components so I got a bulding error about the <code>tpm2-tools</code> package/feature so I just removed the whole section below:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Security packages</span>
IMAGE_INSTALL:append = <span class="hljs-string">" \
    tpm2-tools \
    swtpm \
"</span>
</code></pre>
<h3 id="heading-after-some-more-tries">After some more tries</h3>
<p>I had to solve more issues with outdated package names, removing features completely because my board can’t support TPM 😅, and other details. The building process seems to be happening.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1762807663874/c4fb9dcd-ec33-415d-a2f7-1f85d414925c.png" alt class="image--center mx-auto" /></p>
<p>So yeah, this is the real deal. And it is even slowing me down while typing this paragraph. The laptop fans are singing the song of their people.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">🤖</div>
<div data-node-type="callout-text">BEGIN AI Summary</div>
</div>

<p>When you see BitBake starting to execute tasks like this, it means:</p>
<ol>
<li><p><strong>All configurations are valid.</strong></p>
</li>
<li><p><strong>All layers are correctly loaded.</strong></p>
</li>
<li><p><strong>All dependencies have been successfully resolved.</strong></p>
</li>
<li><p><strong>BitBake now has a complete, valid plan to build your entire Linux distribution from source.</strong></p>
</li>
</ol>
<h3 id="heading-whats-happening-now">What's Happening Now?</h3>
<p>You are now in the actual <strong>build phase</strong>. BitBake is executing tasks in order for hundreds of packages. You'll see it go through stages for each package:</p>
<ul>
<li><p>do_fetch (downloading source code)</p>
</li>
<li><p>do_unpack</p>
</li>
<li><p>do_patch</p>
</li>
<li><p>do_configure</p>
</li>
<li><p>do_compile (This is the long part)</p>
</li>
<li><p>do_install</p>
</li>
<li><p>do_package</p>
</li>
</ul>
<p><strong>A Word of Warning:</strong> The very first build from scratch is a marathon. Depending on your machine's CPU, RAM, and internet speed, this will take a <strong>long time</strong>—anywhere from an hour to several hours.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">🤖</div>
<div data-node-type="callout-text">END AI Summary</div>
</div>

<h2 id="heading-conclusion">Conclusion?</h2>
<p>This article started as just notes to draft a blueprint for a YOCTO project. It started with too big goals, maybe, but here we are. Great learning challenge so far. But now it is making me suffer by making it impossible to use this laptop. I need to buy “server”… yeah this <code>distrobox</code> should be a <code>VPS</code> on someone else's computer. It would be a good topic for a follow-up article.</p>
]]></content:encoded></item></channel></rss>