# cnlohr/buildroot architecture

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

- Interactive diagram: https://gitdiagram.com/cnlohr/buildroot
- Repository: https://github.com/cnlohr/buildroot

## Overview

Buildroot generates embedded Linux systems by configuring a target and package set, cross-compiling it, and producing images. The README documents this user workflow and the resulting kernel, bootloader, and root filesystem, but the supplied tree is a selected-file snapshot rather than the build-system implementation. The graph therefore uses documented edges for the main workflow and shows sampled Kconfig, toolchain, and image-utility components without assuming their unsampled call relationships. Package checks and test infrastructure are separate supporting branches.

Main entry points: [`support/kconfig/qconf.cc`](https://github.com/cnlohr/buildroot/blob/master/support/kconfig/qconf.cc) (Qt configuration), [`support/kconfig`](https://github.com/cnlohr/buildroot/tree/master/support/kconfig) (Kconfig engine), [`support/testing/infra/emulator.py`](https://github.com/cnlohr/buildroot/blob/master/support/testing/infra/emulator.py) (QEMU emulator), [`board/zynqmp`](https://github.com/cnlohr/buildroot/tree/master/board/zynqmp) (Board configurations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_config["Configuration"]
  node_kconfig_ui["Kconfig interfaces"]
  node_kconfig_gui["Qt configuration<br/>[qconf.cc]"]
  node_kconfig_core["Kconfig engine"]
  node_board_config["Board configurations"]
end

subgraph group_build["Cross-compilation"]
  node_buildroot["Buildroot build"]
  node_cross_toolchain["Toolchain wrapper"]
  node_package_build["Package compilation"]
end

subgraph group_images["System outputs"]
  node_image_outputs["Kernel, bootloader, rootfs"]
  node_device_nodes["Device-node creation<br/>[makedevs.c]"]
  node_pimage["Pimage utility<br/>[mkpimage.c]"]
end

subgraph group_quality["Checks and tests"]
  node_package_checks["Package checks"]
  node_symbol_checks["Symbol checks"]
  node_test_builder["Test builder<br/>[builder.py]"]
  node_test_emulator["QEMU emulator<br/>[emulator.py]"]
end

node_user(("Build user"))
node_qemu(("QEMU"))

node_user -->|"configures target"| node_kconfig_ui
node_user -->|"configures target"| node_kconfig_gui
node_kconfig_ui -.->|"sets configuration"| node_kconfig_core
node_kconfig_gui -->|"sets configuration"| node_kconfig_core
node_kconfig_gui -->|"uses interfaces"| node_kconfig_core
node_user -->|"starts build"| node_buildroot
node_buildroot -.->|"cross-compiles"| node_cross_toolchain
node_buildroot -->|"builds packages"| node_package_build
node_buildroot -->|"produces images"| node_image_outputs
node_board_config -.->|"selects board"| node_buildroot
node_package_build -.->|"uses utility"| node_device_nodes
node_package_build -.->|"uses utility"| node_pimage
node_package_checks -.->|"checks separately"| node_symbol_checks
node_test_builder -->|"runs tests with"| node_test_emulator
node_test_emulator -->|"starts"| node_qemu

click node_kconfig_ui "https://github.com/cnlohr/buildroot/tree/master/support/kconfig"
click node_kconfig_gui "https://github.com/cnlohr/buildroot/blob/master/support/kconfig/qconf.cc"
click node_kconfig_core "https://github.com/cnlohr/buildroot/tree/master/support/kconfig"
click node_cross_toolchain "https://github.com/cnlohr/buildroot/blob/master/toolchain/toolchain-wrapper.c"
click node_board_config "https://github.com/cnlohr/buildroot/tree/master/board/zynqmp"
click node_device_nodes "https://github.com/cnlohr/buildroot/blob/master/package/makedevs/makedevs.c"
click node_pimage "https://github.com/cnlohr/buildroot/blob/master/package/mkpimage/mkpimage.c"
click node_package_checks "https://github.com/cnlohr/buildroot/tree/master/utils/checkpackagelib"
click node_symbol_checks "https://github.com/cnlohr/buildroot/tree/master/utils/checksymbolslib"
click node_test_builder "https://github.com/cnlohr/buildroot/blob/master/support/testing/infra/builder.py"
click node_test_emulator "https://github.com/cnlohr/buildroot/blob/master/support/testing/infra/emulator.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_kconfig_ui,node_kconfig_gui,node_kconfig_core,node_board_config,node_user toneBlue
class node_buildroot,node_cross_toolchain,node_package_build toneAmber
class node_image_outputs,node_device_nodes,node_pimage toneMint
class node_package_checks,node_symbol_checks,node_test_builder,node_test_emulator toneRose
class node_qemu toneIndigo
```

## Components

### Configuration

- [Kconfig interfaces](https://github.com/cnlohr/buildroot/tree/master/support/kconfig): `support/kconfig`
- [Qt configuration](https://github.com/cnlohr/buildroot/blob/master/support/kconfig/qconf.cc): `support/kconfig/qconf.cc`
- [Kconfig engine](https://github.com/cnlohr/buildroot/tree/master/support/kconfig): `support/kconfig`
- [Board configurations](https://github.com/cnlohr/buildroot/tree/master/board/zynqmp): `board/zynqmp`

### Cross-compilation

- **Buildroot build**
- [Toolchain wrapper](https://github.com/cnlohr/buildroot/blob/master/toolchain/toolchain-wrapper.c): `toolchain/toolchain-wrapper.c`
- **Package compilation**

### System outputs

- **Kernel, bootloader, rootfs**
- [Device-node creation](https://github.com/cnlohr/buildroot/blob/master/package/makedevs/makedevs.c): `package/makedevs/makedevs.c`
- [Pimage utility](https://github.com/cnlohr/buildroot/blob/master/package/mkpimage/mkpimage.c): `package/mkpimage/mkpimage.c`

### Checks and tests

- [Package checks](https://github.com/cnlohr/buildroot/tree/master/utils/checkpackagelib): `utils/checkpackagelib`
- [Symbol checks](https://github.com/cnlohr/buildroot/tree/master/utils/checksymbolslib): `utils/checksymbolslib`
- [Test builder](https://github.com/cnlohr/buildroot/blob/master/support/testing/infra/builder.py): `support/testing/infra/builder.py`
- [QEMU emulator](https://github.com/cnlohr/buildroot/blob/master/support/testing/infra/emulator.py): `support/testing/infra/emulator.py`

### Other components

- **Build user**
- **QEMU**

## Connections

- Build user → Kconfig interfaces: configures target (evidence: `README`)
- Build user → Qt configuration: configures target (evidence: `README`)
- Kconfig interfaces → Kconfig engine: sets configuration
- Qt configuration → Kconfig engine: sets configuration (evidence: `support/kconfig/qconf.cc`)
- Qt configuration → Kconfig engine: uses interfaces (evidence: `support/kconfig/qconf.cc`)
- Build user → Buildroot build: starts build (evidence: `README`)
- Buildroot build → Toolchain wrapper: cross-compiles
- Buildroot build → Package compilation: builds packages (evidence: `README`)
- Buildroot build → Kernel, bootloader, rootfs: produces images (evidence: `README`)
- Board configurations → Buildroot build: selects board
- Package compilation → Device-node creation: uses utility
- Package compilation → Pimage utility: uses utility
- Package checks → Symbol checks: checks separately
- Test builder → QEMU emulator: runs tests with (evidence: `support/testing/infra/basetest.py`)
- QEMU emulator → QEMU: starts (evidence: `support/testing/infra/emulator.py`)
