# ni/nilrt architecture

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

- Interactive diagram: https://gitdiagram.com/ni/nilrt
- Repository: https://github.com/ni/nilrt

## Overview

NI Linux Real-Time is an OpenEmbedded-based project for building packages, feeds, kernels, system images, and installation media for NI embedded hardware. The primary workflow is a developer configuring the build environment and target, building packages and feeds, then building device images. The repository also includes CVE-reporting tools and an upstream-merge automation workflow. Several product capabilities are documented in the README but their implementation is outside the sampled source; those links cite the README, and uncertain implementation links are omitted.

Main entry points: [`sources/openembedded-core`](https://github.com/ni/nilrt/tree/nilrt/master/scarthgap/sources/openembedded-core) (OpenEmbedded), [`ni-oe-init-build-env`](https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/ni-oe-init-build-env) (Build setup), [`sources/meta-nilrt`](https://github.com/ni/nilrt/tree/nilrt/master/scarthgap/sources/meta-nilrt) (Packages), [`scripts/dev/upstream_merge/utils/git_repo.py`](https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/scripts/dev/upstream_merge/utils/git_repo.py) (Git repository API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_build["Build environment"]
  node_init["Build setup"]
  node_container["Build container"]
  node_pyrex["Pyrex shim"]
  node_oe["OpenEmbedded"]
  node_layers["Distribution layers"]
end

subgraph group_outputs["Distribution outputs"]
  node_packages["Packages"]
  node_feeds["Package feeds"]
  node_kernel["RT kernel"]
  node_images["System images"]
  node_media["Recovery media"]
end

subgraph group_security["CVE reporting"]
  node_cveparse["CVE stanza parser<br/>[cve-to-csv.py]"]
  node_cvehigh["High-severity filter"]
  node_cvediff["CVE CSV diff<br/>[diff-cve-csvs.py]"]
end

subgraph group_upstream["Upstream automation"]
  node_merge["Merge workflow<br/>[upstream_merge.py]"]
  node_gitrepo["Git repository API<br/>[git_repo.py]"]
  node_gitcmd["Git commands<br/>[git_commands.py]"]
  node_shell["Shell execution<br/>[shell_commands.py]"]
  node_buildutil["Build helpers<br/>[build.py]"]
  node_pr["Push and PR"]
  node_reports["Merge reporting"]
end

node_developer(("Developer"))

node_developer -->|"configures"| node_init
node_init -->|"sets up shim"| node_pyrex
node_init -->|"initializes environment"| node_oe
node_developer -->|"prepares build"| node_container
node_oe -->|"builds"| node_packages
node_layers -.->|"defines"| node_packages
node_packages -->|"assembles"| node_feeds
node_feeds -->|"prerequisite"| node_images
node_oe -->|"builds"| node_kernel
node_oe -->|"builds"| node_images
node_oe -->|"builds"| node_media
node_developer -->|"runs"| node_cveparse
node_developer -->|"runs"| node_cvehigh
node_developer -->|"compares reports"| node_cvediff
node_merge -.->|"uses repository object"| node_gitrepo
node_gitrepo -->|"delegates Git operations"| node_gitcmd
node_gitcmd -->|"runs commands"| node_shell
node_buildutil -->|"streams commands"| node_shell
node_pr -->|"pushes and creates PR"| node_gitrepo
node_reports -->|"sends email"| node_gitcmd

click node_init "https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/ni-oe-init-build-env"
click node_container "https://github.com/ni/nilrt/tree/nilrt/master/scarthgap/docker"
click node_pyrex "https://github.com/ni/nilrt/tree/nilrt/master/scarthgap/sources/pyrex"
click node_oe "https://github.com/ni/nilrt/tree/nilrt/master/scarthgap/sources/openembedded-core"
click node_layers "https://github.com/ni/nilrt/tree/nilrt/master/scarthgap/sources/meta-nilrt"
click node_packages "https://github.com/ni/nilrt/tree/nilrt/master/scarthgap/sources/meta-nilrt"
click node_feeds "https://github.com/ni/nilrt/tree/nilrt/master/scarthgap/scripts/pipelines"
click node_kernel "https://github.com/ni/nilrt/tree/nilrt/master/scarthgap/sources/meta-nilrt"
click node_images "https://github.com/ni/nilrt/tree/nilrt/master/scarthgap/sources/meta-nilrt"
click node_media "https://github.com/ni/nilrt/tree/nilrt/master/scarthgap/sources/meta-nilrt"
click node_cveparse "https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/scripts/pipelines/cve-to-csv.py"
click node_cvehigh "https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/scripts/pipelines/high-sev-cve-to-json.py"
click node_cvediff "https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/scripts/dev/diff-cve-csvs.py"
click node_merge "https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/scripts/dev/upstream_merge/upstream_merge.py"
click node_gitrepo "https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/scripts/dev/upstream_merge/utils/git_repo.py"
click node_gitcmd "https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/scripts/dev/upstream_merge/utils/git_commands.py"
click node_shell "https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/scripts/dev/upstream_merge/utils/shell_commands.py"
click node_buildutil "https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/scripts/dev/upstream_merge/utils/build.py"
click node_pr "https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/scripts/dev/upstream_merge/utils/push_branch_and_create_pr.py"
click node_reports "https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/scripts/dev/upstream_merge/log_and_email_utils.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_init,node_container,node_pyrex,node_oe,node_layers toneBlue
class node_packages,node_feeds,node_kernel,node_images,node_media toneAmber
class node_cveparse,node_cvehigh,node_cvediff toneMint
class node_merge,node_gitrepo,node_gitcmd,node_shell,node_buildutil,node_pr,node_reports toneRose
class node_developer toneIndigo
```

## Components

### Build environment

- [Build setup](https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/ni-oe-init-build-env): `ni-oe-init-build-env`
- [Build container](https://github.com/ni/nilrt/tree/nilrt/master/scarthgap/docker): `docker`
- [Pyrex shim](https://github.com/ni/nilrt/tree/nilrt/master/scarthgap/sources/pyrex): `sources/pyrex`
- [OpenEmbedded](https://github.com/ni/nilrt/tree/nilrt/master/scarthgap/sources/openembedded-core): `sources/openembedded-core`
- [Distribution layers](https://github.com/ni/nilrt/tree/nilrt/master/scarthgap/sources/meta-nilrt): `sources/meta-nilrt`

### Distribution outputs

- [Packages](https://github.com/ni/nilrt/tree/nilrt/master/scarthgap/sources/meta-nilrt): `sources/meta-nilrt`
- [Package feeds](https://github.com/ni/nilrt/tree/nilrt/master/scarthgap/scripts/pipelines): `scripts/pipelines`
- [RT kernel](https://github.com/ni/nilrt/tree/nilrt/master/scarthgap/sources/meta-nilrt): `sources/meta-nilrt`
- [System images](https://github.com/ni/nilrt/tree/nilrt/master/scarthgap/sources/meta-nilrt): `sources/meta-nilrt`
- [Recovery media](https://github.com/ni/nilrt/tree/nilrt/master/scarthgap/sources/meta-nilrt): `sources/meta-nilrt`

### CVE reporting

- [CVE stanza parser](https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/scripts/pipelines/cve-to-csv.py): `scripts/pipelines/cve-to-csv.py`
- [High-severity filter](https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/scripts/pipelines/high-sev-cve-to-json.py): `scripts/pipelines/high-sev-cve-to-json.py`
- [CVE CSV diff](https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/scripts/dev/diff-cve-csvs.py): `scripts/dev/diff-cve-csvs.py`

### Upstream automation

- [Merge workflow](https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/scripts/dev/upstream_merge/upstream_merge.py): `scripts/dev/upstream_merge/upstream_merge.py`
- [Git repository API](https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/scripts/dev/upstream_merge/utils/git_repo.py): `scripts/dev/upstream_merge/utils/git_repo.py`
- [Git commands](https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/scripts/dev/upstream_merge/utils/git_commands.py): `scripts/dev/upstream_merge/utils/git_commands.py`
- [Shell execution](https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/scripts/dev/upstream_merge/utils/shell_commands.py): `scripts/dev/upstream_merge/utils/shell_commands.py`
- [Build helpers](https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/scripts/dev/upstream_merge/utils/build.py): `scripts/dev/upstream_merge/utils/build.py`
- [Push and PR](https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/scripts/dev/upstream_merge/utils/push_branch_and_create_pr.py): `scripts/dev/upstream_merge/utils/push_branch_and_create_pr.py`
- [Merge reporting](https://github.com/ni/nilrt/blob/nilrt/master/scarthgap/scripts/dev/upstream_merge/log_and_email_utils.py): `scripts/dev/upstream_merge/log_and_email_utils.py`

### Other components

- **Developer**

## Connections

- Developer → Build setup: configures (evidence: `README.md`)
- Build setup → Pyrex shim: sets up shim (evidence: `README.md`)
- Build setup → OpenEmbedded: initializes environment (evidence: `README.md`)
- Developer → Build container: prepares build (evidence: `README.md`)
- OpenEmbedded → Packages: builds (evidence: `README.md`)
- Distribution layers → Packages: defines
- Packages → Package feeds: assembles (evidence: `README.md`)
- Package feeds → System images: prerequisite (evidence: `README.md`)
- OpenEmbedded → RT kernel: builds (evidence: `README.md`)
- OpenEmbedded → System images: builds (evidence: `README.md`)
- OpenEmbedded → Recovery media: builds (evidence: `README.md`)
- Developer → CVE stanza parser: runs (evidence: `scripts/pipelines/cve-to-csv.py`)
- Developer → High-severity filter: runs (evidence: `scripts/pipelines/high-sev-cve-to-json.py`)
- Developer → CVE CSV diff: compares reports (evidence: `scripts/dev/diff-cve-csvs.py`)
- Merge workflow → Git repository API: uses repository object
- Git repository API → Git commands: delegates Git operations (evidence: `scripts/dev/upstream_merge/utils/git_repo.py`)
- Git commands → Shell execution: runs commands (evidence: `scripts/dev/upstream_merge/utils/git_commands.py`)
- Build helpers → Shell execution: streams commands (evidence: `scripts/dev/upstream_merge/utils/build.py`)
- Push and PR → Git repository API: pushes and creates PR (evidence: `scripts/dev/upstream_merge/utils/push_branch_and_create_pr.py`)
- Merge reporting → Git commands: sends email (evidence: `scripts/dev/upstream_merge/log_and_email_utils.py`)
