# armbian/build architecture

> Architecture diagram of the GitHub repository armbian/build, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/armbian/build
- Repository: https://github.com/armbian/build

## Overview

Armbian Build Framework produces customizable Debian- or Ubuntu-based images for SBCs and embedded devices. The documented workflow starts with an operator invoking a build, which assembles a Linux system from a kernel, bootloader, and root filesystem into an image. The sampled files expose supporting target and CI-matrix generation, patch application, and board-specific firmware components, but not the central build entry point or most image-assembly code. Accordingly, documented workflow links use README evidence; implementation links are limited to relationships visible in the supplied excerpts or source index.

Main entry points: [`lib/tools/patching.py`](https://github.com/armbian/build/blob/main/lib/tools/patching.py) (Patch orchestrator), [`lib/tools/info/targets-compositor.py`](https://github.com/armbian/build/blob/main/lib/tools/info/targets-compositor.py) (Target compositor), [`lib/tools/common/patching_config.py`](https://github.com/armbian/build/blob/main/lib/tools/common/patching_config.py) (Patch configuration), [`lib/tools/common/patching_parallel.py`](https://github.com/armbian/build/blob/main/lib/tools/common/patching_parallel.py) (Parallel patching)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_build["Image build"]
  node_framework["Armbian framework"]
  node_kernel["Linux kernel"]
  node_bootloader["Bootloader"]
  node_rootfs["Root filesystem"]
  node_image["OS image"]
end

subgraph group_targets["Target planning"]
  node_targetcompose["Target compositor"]
  node_boardinventory["Board inventory<br/>[board-inventory.py]"]
  node_gha_matrix["GitHub Actions matrix"]
  node_gha_workflow["Workflow output"]
end

subgraph group_patching["Patch management"]
  node_patch_orchestrator["Patch orchestrator<br/>[patching.py]"]
  node_parallel_patches["Parallel patching"]
  node_patch_config["Patch configuration<br/>[patching_config.py]"]
  node_dt_patcher["DT Makefile patcher"]
end

subgraph group_boards["Board support"]
  node_helios64["Helios64 U-Boot<br/>[helios64.c]"]
  node_sophgo_installer["Sophgo image installer<br/>[mkcimg.py]"]
  node_mmio["Sunxi MMIO access<br/>[mod_mmio.h]"]
end

subgraph group_reporting["Build reporting"]
  node_artifact_info["Artifact information tools"]
end

node_operator(("Operator"))

node_operator -->|"invokes build"| node_framework
node_framework -->|"builds kernel"| node_kernel
node_framework -->|"builds bootloader"| node_bootloader
node_framework -->|"builds rootfs"| node_rootfs
node_framework -->|"produces image"| node_image
node_targetcompose -->|"reads inventory"| node_boardinventory
node_gha_matrix -.->|"uses invocations"| node_targetcompose
node_gha_workflow -.->|"uses invocations"| node_targetcompose
node_patch_orchestrator -->|"dispatches patches"| node_parallel_patches
node_patch_orchestrator -->|"loads configuration"| node_patch_config
node_patch_orchestrator -->|"invokes patcher"| node_dt_patcher
node_parallel_patches -->|"reads options"| node_patch_config
node_dt_patcher -->|"reads settings"| node_patch_config
node_artifact_info -.->|"reports artifacts"| node_framework

click node_targetcompose "https://github.com/armbian/build/blob/main/lib/tools/info/targets-compositor.py"
click node_boardinventory "https://github.com/armbian/build/blob/main/lib/tools/info/board-inventory.py"
click node_gha_matrix "https://github.com/armbian/build/blob/main/lib/tools/info/output-gha-matrix.py"
click node_gha_workflow "https://github.com/armbian/build/blob/main/lib/tools/info/output-gha-workflow.py"
click node_patch_orchestrator "https://github.com/armbian/build/blob/main/lib/tools/patching.py"
click node_parallel_patches "https://github.com/armbian/build/blob/main/lib/tools/common/patching_parallel.py"
click node_patch_config "https://github.com/armbian/build/blob/main/lib/tools/common/patching_config.py"
click node_dt_patcher "https://github.com/armbian/build/blob/main/lib/tools/common/dt_makefile_patcher.py"
click node_helios64 "https://github.com/armbian/build/blob/main/patch/u-boot/v2026.07/board_helios64/board/helios64.c"
click node_sophgo_installer "https://github.com/armbian/build/blob/main/extensions/image-output-sophgo-emmc-installer/mkcimg.py"
click node_mmio "https://github.com/armbian/build/blob/main/packages/bsp/sunxi-temp/mod_mmio.h"
click node_artifact_info "https://github.com/armbian/build/blob/main/lib/tools/info/info-gatherer-image.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_framework,node_kernel,node_bootloader,node_rootfs,node_image toneBlue
class node_targetcompose,node_boardinventory,node_gha_matrix,node_gha_workflow toneAmber
class node_patch_orchestrator,node_parallel_patches,node_patch_config,node_dt_patcher toneMint
class node_helios64,node_sophgo_installer,node_mmio toneRose
class node_artifact_info,node_operator toneIndigo
```

## Components

### Image build

- **Armbian framework**
- **Linux kernel**
- **Bootloader**
- **Root filesystem**
- **OS image**

### Target planning

- [Target compositor](https://github.com/armbian/build/blob/main/lib/tools/info/targets-compositor.py): `lib/tools/info/targets-compositor.py`
- [Board inventory](https://github.com/armbian/build/blob/main/lib/tools/info/board-inventory.py): `lib/tools/info/board-inventory.py`
- [GitHub Actions matrix](https://github.com/armbian/build/blob/main/lib/tools/info/output-gha-matrix.py): `lib/tools/info/output-gha-matrix.py`
- [Workflow output](https://github.com/armbian/build/blob/main/lib/tools/info/output-gha-workflow.py): `lib/tools/info/output-gha-workflow.py`

### Patch management

- [Patch orchestrator](https://github.com/armbian/build/blob/main/lib/tools/patching.py): `lib/tools/patching.py`
- [Parallel patching](https://github.com/armbian/build/blob/main/lib/tools/common/patching_parallel.py): `lib/tools/common/patching_parallel.py`
- [Patch configuration](https://github.com/armbian/build/blob/main/lib/tools/common/patching_config.py): `lib/tools/common/patching_config.py`
- [DT Makefile patcher](https://github.com/armbian/build/blob/main/lib/tools/common/dt_makefile_patcher.py): `lib/tools/common/dt_makefile_patcher.py`

### Board support

- [Helios64 U-Boot](https://github.com/armbian/build/blob/main/patch/u-boot/v2026.07/board_helios64/board/helios64.c): `patch/u-boot/v2026.07/board_helios64/board/helios64.c`
- [Sophgo image installer](https://github.com/armbian/build/blob/main/extensions/image-output-sophgo-emmc-installer/mkcimg.py): `extensions/image-output-sophgo-emmc-installer/mkcimg.py`
- [Sunxi MMIO access](https://github.com/armbian/build/blob/main/packages/bsp/sunxi-temp/mod_mmio.h): `packages/bsp/sunxi-temp/mod_mmio.h`

### Build reporting

- [Artifact information tools](https://github.com/armbian/build/blob/main/lib/tools/info/info-gatherer-image.py): `lib/tools/info/info-gatherer-image.py`

### Other components

- **Operator**

## Connections

- Operator → Armbian framework: invokes build
- Armbian framework → Linux kernel: builds kernel
- Armbian framework → Bootloader: builds bootloader
- Armbian framework → Root filesystem: builds rootfs
- Armbian framework → OS image: produces image
- Target compositor → Board inventory: reads inventory (evidence: `lib/tools/info/targets-compositor.py`)
- GitHub Actions matrix → Target compositor: uses invocations
- Workflow output → Target compositor: uses invocations
- Patch orchestrator → Parallel patching: dispatches patches (evidence: `lib/tools/patching.py`)
- Patch orchestrator → Patch configuration: loads configuration (evidence: `lib/tools/patching.py`)
- Patch orchestrator → DT Makefile patcher: invokes patcher (evidence: `lib/tools/patching.py`)
- Parallel patching → Patch configuration: reads options (evidence: `lib/tools/common/patching_parallel.py`)
- DT Makefile patcher → Patch configuration: reads settings (evidence: `lib/tools/common/dt_makefile_patcher.py`)
- Artifact information tools → Armbian framework: reports artifacts
