# robertcnelson/omap-image-builder architecture

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

- Interactive diagram: https://gitdiagram.com/robertcnelson/omap-image-builder
- Repository: https://github.com/robertcnelson/omap-image-builder

## Overview

RootStock-NG is a configurable image builder for ARM systems. Its apparent workflow is selecting a board/distribution configuration, obtaining and bootstrapping a Debian root filesystem, applying target-specific customization, and preparing boot and SD-card image artifacts. The tree identifies these runtime areas, while the README describes customized image generation and supported board EEPROM identities. No source excerpts were provided, so the internal flow is shown as unverified dashed relationships rather than asserted calls.

Main entry points: [`RootStock-NG.sh`](https://github.com/robertcnelson/omap-image-builder/blob/master/RootStock-NG.sh) (Build entry point), [`scripts/chroot.sh`](https://github.com/robertcnelson/omap-image-builder/blob/master/scripts/chroot.sh) (Rootfs setup), [`tools/setup_sdcard.sh`](https://github.com/robertcnelson/omap-image-builder/blob/master/tools/setup_sdcard.sh) (SD-card image setup), [`scripts/debootstrap.sh`](https://github.com/robertcnelson/omap-image-builder/blob/master/scripts/debootstrap.sh) (Rootfs bootstrap)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Image orchestration"]
  node_entry["Build entry point<br/>[RootStock-NG.sh]"]
  node_configs["Image configurations"]
end

subgraph group_rootfs["Root filesystem"]
  node_pull["Source retrieval<br/>[pull.sh]"]
  node_dependencies["Build dependencies"]
  node_debootstrap["Rootfs bootstrap<br/>[debootstrap.sh]"]
  node_chroot["Rootfs setup<br/>[chroot.sh]"]
end

subgraph group_customization["Target customization"]
  node_target_scripts["Board customization"]
  node_machinekit["Machinekit additions<br/>[chroot_hook.sh]"]
end

subgraph group_image["Boot and image output"]
  node_boot_config["Boot configuration"]
  node_hwpack["Hardware profiles"]
  node_sdcard["SD-card image setup<br/>[setup_sdcard.sh]"]
end

node_user(("Image builder user"))
node_debian{{"Debian packages"}}
node_image_artifact["System image"]

node_user -.->|"starts build"| node_entry
node_entry -.->|"selects profile"| node_configs
node_entry -.->|"runs retrieval"| node_pull
node_entry -.->|"prepares tools"| node_dependencies
node_entry -.->|"starts bootstrap"| node_debootstrap
node_debian -.->|"supplies packages"| node_debootstrap
node_entry -.->|"configures rootfs"| node_chroot
node_chroot -.->|"applies scripts"| node_target_scripts
node_chroot -.->|"applies hook"| node_machinekit
node_entry -.->|"uses boot settings"| node_boot_config
node_entry -.->|"uses board profile"| node_hwpack
node_entry -.->|"prepares image"| node_sdcard
node_sdcard -.->|"produces image"| node_image_artifact

click node_entry "https://github.com/robertcnelson/omap-image-builder/blob/master/RootStock-NG.sh"
click node_configs "https://github.com/robertcnelson/omap-image-builder/tree/master/configs"
click node_pull "https://github.com/robertcnelson/omap-image-builder/blob/master/scripts/pull.sh"
click node_dependencies "https://github.com/robertcnelson/omap-image-builder/blob/master/scripts/install_dependencies.sh"
click node_debootstrap "https://github.com/robertcnelson/omap-image-builder/blob/master/scripts/debootstrap.sh"
click node_chroot "https://github.com/robertcnelson/omap-image-builder/blob/master/scripts/chroot.sh"
click node_target_scripts "https://github.com/robertcnelson/omap-image-builder/tree/master/target/chroot"
click node_machinekit "https://github.com/robertcnelson/omap-image-builder/blob/master/machinekit/chroot_hook.sh"
click node_boot_config "https://github.com/robertcnelson/omap-image-builder/tree/master/target/boot"
click node_hwpack "https://github.com/robertcnelson/omap-image-builder/tree/master/tools/hwpack"
click node_sdcard "https://github.com/robertcnelson/omap-image-builder/blob/master/tools/setup_sdcard.sh"

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_entry,node_configs,node_user toneBlue
class node_pull,node_dependencies,node_debootstrap,node_chroot toneAmber
class node_target_scripts,node_machinekit toneMint
class node_boot_config,node_hwpack,node_sdcard toneRose
class node_debian,node_image_artifact toneIndigo
```

## Components

### Image orchestration

- [Build entry point](https://github.com/robertcnelson/omap-image-builder/blob/master/RootStock-NG.sh): `RootStock-NG.sh`
- [Image configurations](https://github.com/robertcnelson/omap-image-builder/tree/master/configs): `configs`

### Root filesystem

- [Source retrieval](https://github.com/robertcnelson/omap-image-builder/blob/master/scripts/pull.sh): `scripts/pull.sh`
- [Build dependencies](https://github.com/robertcnelson/omap-image-builder/blob/master/scripts/install_dependencies.sh): `scripts/install_dependencies.sh`
- [Rootfs bootstrap](https://github.com/robertcnelson/omap-image-builder/blob/master/scripts/debootstrap.sh): `scripts/debootstrap.sh`
- [Rootfs setup](https://github.com/robertcnelson/omap-image-builder/blob/master/scripts/chroot.sh): `scripts/chroot.sh`

### Target customization

- [Board customization](https://github.com/robertcnelson/omap-image-builder/tree/master/target/chroot): `target/chroot`
- [Machinekit additions](https://github.com/robertcnelson/omap-image-builder/blob/master/machinekit/chroot_hook.sh): `machinekit/chroot_hook.sh`

### Boot and image output

- [Boot configuration](https://github.com/robertcnelson/omap-image-builder/tree/master/target/boot): `target/boot`
- [Hardware profiles](https://github.com/robertcnelson/omap-image-builder/tree/master/tools/hwpack): `tools/hwpack`
- [SD-card image setup](https://github.com/robertcnelson/omap-image-builder/blob/master/tools/setup_sdcard.sh): `tools/setup_sdcard.sh`

### Other components

- **Image builder user**
- **Debian packages**
- **System image**

## Connections

- Image builder user → Build entry point: starts build
- Build entry point → Image configurations: selects profile
- Build entry point → Source retrieval: runs retrieval
- Build entry point → Build dependencies: prepares tools
- Build entry point → Rootfs bootstrap: starts bootstrap
- Debian packages → Rootfs bootstrap: supplies packages
- Build entry point → Rootfs setup: configures rootfs
- Rootfs setup → Board customization: applies scripts
- Rootfs setup → Machinekit additions: applies hook
- Build entry point → Boot configuration: uses boot settings
- Build entry point → Hardware profiles: uses board profile
- Build entry point → SD-card image setup: prepares image
- SD-card image setup → System image: produces image
