# oe4t/meta-tegra architecture

> Architecture diagram of the GitHub repository oe4t/meta-tegra, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oe4t/meta-tegra
- Repository: https://github.com/oe4t/meta-tegra

## Overview

This project is a Yocto/OpenEmbedded Board Support Package (BSP) layer specifically designed for building Linux images for NVIDIA Jetson modules. The README clearly states its purpose—to support various Jetson hardware such as the AGX Orin, Orin NX, Orin Nano, etc.—and outlines the compatibility with JetPack and Linux release versions. The file tree further reinforces this, with a hierarchical structure including directories for classes, configuration (conf), and a vast number of recipes (for BSP, devtools, multimedia, kernel, and more) as well as external layers (meta-python, qt5, qt6, virtualization layers, etc.).

- Build System Core – At the top level, represent the Yocto build system (using Bitbake and openembedded-core) that orchestrates the build process.
- meta-tegra Layer – Represent the BSP layer itself. It contains:
- Board Configuration (conf/machine and its included files) that specify hardware-specific settings for each Jetson board.
- Recipe Classes and .bbclass files (in “classes” and “classes-recipe”) that define shared functionality and build logic.
- Recipes – Grouped by functionality (recipes-bsp, recipes-core, recipes-devtools, recipes-kernel, recipes-multimedia, etc.) which define how different software packages, drivers, firmware, and boot components are built.
- External Layers – Include other related layers such as meta-python, openembedded-layer, qt5-layer, qt6-layer, virtualization-layer, and sota. These bring in additional recipes and tools needed by the system (for example, CUDA toolchain support, Qt libraries, container support).

##### Relationships and interactions
- Board-specific configuration (in conf/machine) with the overall meta-tegra layer, showing that the machine configs provide target-specific build variables.
- Dependencies between common recipe classes (“.bbclass” files) used to share build instructions (like “cuda.bbclass”, “tegra-bup.bbclass”, etc.) and the individual recipes that invoke these classes.

##### Architectural Patterns and Design Principles
- Multi-layered Architecture: Emphasize that the system is built as a composition of multiple layers where meta-tegra customizes the generic OpenEmbedded build.
- Modularity: Separate components into distinct areas (core, BSP, devtools, multimedia, etc.) so that each part can be maintained or updated independently.
- Reusability via Classes: Showcase how the .bbclass files encapsulate reusable build logic that is shared across many recipes.
- Configuration Over Convention: With machine configurations and include files in the conf directory, indicate that the system is highly configurable for different Jetson board models.

##### Relevant Technologies and Frameworks
- Yocto/Bitbake as the build orchestration engine.
- GNU Make and underlying Linux toolchains (including specialized toolchains like gcc-for-nvcc for CUDA compatibility).
- Dependency on external layers such as meta-python, qt5/qt6 layers, and container-related layers to extend functionality.
- CUDA toolchain support, which is an important technical aspect noted in the README.

- Clear labels for each component: clearly tag the "Yocto Build Engine", "meta-tegra BSP Layer", "Configuration & Machine Files", "Recipes & Classes", and "External Layers".

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Top Layer: Yocto Build Engine
    BS("Yocto Build Engine"):::buildEngine

    %% Bottom Layer: Final Linux Image
    IMG("Final Linux Image"):::image

    %% Meta-tegra BSP Layer Subgraph
    subgraph "meta-tegra BSP Layer"
        direction TB
        BC("Board Configuration"):::config
        subgraph "Recipe Classes"
            GC("General Classes (.bbclass)"):::recipe
            RC("Recipe Classes (.bbclass)"):::recipe
        end
        subgraph "Recipes"
            BR("BSP Recipes"):::recipe
            CR("Core Recipes"):::recipe
            DR("Devtools Recipes"):::recipe
            EG("Extended & Graphics Recipes"):::recipe
            KR("Kernel Recipes"):::recipe
            MR("Multimedia Recipes"):::recipe
            SR("Security Recipes"):::recipe
            SUPR("Support Recipes"):::recipe
        end
    end

    %% External Layers Subgraph
    subgraph "External Layers"
        direction TB
        MP("meta-python Layer"):::external
        OEL("OpenEmbedded External Layer"):::external
        Q5("Qt5 Layer"):::external
        Q6("Qt6 Layer"):::external
        SOTA("SOTA Layer"):::external
        VIRT("Virtualization Layer"):::external
    end

    %% Connections from meta-tegra BSP Layer to Yocto Build Engine
    BC --> BS
    GC --> BS
    RC --> BS
    BR --> BS
    CR --> BS
    DR --> BS
    EG --> BS
    KR --> BS
    MR --> BS
    SR --> BS
    SUPR --> BS

    %% Connections from External Layers to Yocto Build Engine
    MP --> BS
    OEL --> BS
    Q5 --> BS
    Q6 --> BS
    SOTA --> BS
    VIRT --> BS

    %% Yocto Build Engine produces the Final Linux Image
    BS --> IMG

    %% Additional internal connection: Recipe Classes contribute to Recipes
    GC --> BR
    RC --> DR

    %% Click Events
    click BS "https://github.com/oe4t/meta-tegra/blob/master/conf/layer.conf"
    click BC "https://github.com/oe4t/meta-tegra/tree/master/conf/machine"
    click BC "https://github.com/oe4t/meta-tegra/tree/master/conf/machine/include"
    click GC "https://github.com/oe4t/meta-tegra/tree/master/classes"
    click RC "https://github.com/oe4t/meta-tegra/tree/master/classes-recipe"
    click BR "https://github.com/oe4t/meta-tegra/tree/master/recipes-bsp"
    click CR "https://github.com/oe4t/meta-tegra/tree/master/recipes-core"
    click DR "https://github.com/oe4t/meta-tegra/tree/master/recipes-devtools"
    click EG "https://github.com/oe4t/meta-tegra/tree/master/recipes-extended"
    click KR "https://github.com/oe4t/meta-tegra/tree/master/recipes-kernel"
    click MR "https://github.com/oe4t/meta-tegra/tree/master/recipes-multimedia"
    click SR "https://github.com/oe4t/meta-tegra/tree/master/recipes-security"
    click SUPR "https://github.com/oe4t/meta-tegra/tree/master/recipes-support"
    click MP "https://github.com/oe4t/meta-tegra/tree/master/external/meta-python"
    click OEL "https://github.com/oe4t/meta-tegra/tree/master/external/openembedded-layer"
    click Q5 "https://github.com/oe4t/meta-tegra/tree/master/external/qt5-layer"
    click Q6 "https://github.com/oe4t/meta-tegra/tree/master/external/qt6-layer"
    click SOTA "https://github.com/oe4t/meta-tegra/tree/master/external/sota"
    click VIRT "https://github.com/oe4t/meta-tegra/tree/master/external/virtualization-layer"

    %% Styles
    classDef buildEngine fill:#AED6F1,stroke:#1F618D,stroke-width:2px;
    classDef meta fill:#ABEBC6,stroke:#1D8348,stroke-width:2px;
    classDef external fill:#FAD7A0,stroke:#D35400,stroke-width:2px;
    classDef config fill:#F5CBA7,stroke:#E67E22,stroke-width:2px;
    classDef recipe fill:#D2B4DE,stroke:#7D3C98,stroke-width:2px;
    classDef image fill:#D5DBDB,stroke:#566573,stroke-width:2px;
```
