# zqinking/wrt_release architecture

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

- Interactive diagram: https://gitdiagram.com/zqinking/wrt_release
- Repository: https://github.com/zqinking/wrt_release

## Overview

This repository automates building device-specific OpenWrt-family firmware. The documented workflow selects a device and build mode, combines its build metadata and configuration, updates source and package feeds, applies customizations, builds (optionally in Docker), and collects firmware output. The README documents responsibilities and stages, but no source excerpts were provided, so the graph avoids claims about specific script-level calls.

Main entry points: [`build.sh`](https://github.com/zqinking/wrt_release/blob/main/build.sh) (Build entry), [`wrt_core/update.sh`](https://github.com/zqinking/wrt_release/blob/main/wrt_core/update.sh) (Source update), [`wrt_core/build_container.sh`](https://github.com/zqinking/wrt_release/blob/main/wrt_core/build_container.sh) (Container build), [`wrt_core/compilecfg`](https://github.com/zqinking/wrt_release/tree/main/wrt_core/compilecfg) (Device metadata)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Build orchestration"]
  node_build_entry["Build entry<br/>[build.sh]"]
  node_source_update["Source update<br/>[update.sh]"]
end

subgraph group_configuration["Device configuration"]
  node_device_metadata["Device metadata"]
  node_device_config["Device config"]
  node_config_fragments["Config fragments"]
end

subgraph group_customization["Source customization"]
  node_feed_changes["Feed adjustments<br/>[feeds.sh]"]
  node_package_sync["Package sync<br/>[packages.sh]"]
  node_patches["Build patches"]
end

subgraph group_build_output["Build and output"]
  node_container_entry["Container build<br/>[build_container.sh]"]
  node_firmware_build["Firmware build<br/>[update.sh]"]
  node_firmware_output[("Firmware output")]
end

node_user(("Builder"))
node_upstream["Firmware source"]
node_docker["Docker runtime"]

node_user -->|"selects device"| node_build_entry
node_build_entry -->|"reads build metadata"| node_device_metadata
node_build_entry -->|"combines configuration"| node_device_config
node_build_entry -->|"selects fragments"| node_config_fragments
node_build_entry -->|"runs update flow"| node_source_update
node_source_update -->|"pulls source"| node_upstream
node_source_update -->|"adjusts feeds"| node_feed_changes
node_source_update -->|"syncs packages"| node_package_sync
node_source_update -->|"applies patches"| node_patches
node_build_entry -.->|"starts container build"| node_container_entry
node_container_entry -->|"uses runtime"| node_docker
node_build_entry -->|"runs full build"| node_firmware_build
node_build_entry -->|"collects firmware"| node_firmware_output

click node_build_entry "https://github.com/zqinking/wrt_release/blob/main/build.sh"
click node_source_update "https://github.com/zqinking/wrt_release/blob/main/wrt_core/update.sh"
click node_device_metadata "https://github.com/zqinking/wrt_release/tree/main/wrt_core/compilecfg"
click node_device_config "https://github.com/zqinking/wrt_release/tree/main/wrt_core/deconfig"
click node_config_fragments "https://github.com/zqinking/wrt_release/tree/main/wrt_core/deconfig/fragments"
click node_feed_changes "https://github.com/zqinking/wrt_release/blob/main/wrt_core/modules/feeds.sh"
click node_package_sync "https://github.com/zqinking/wrt_release/blob/main/wrt_core/modules/packages.sh"
click node_patches "https://github.com/zqinking/wrt_release/tree/main/wrt_core/patches"
click node_container_entry "https://github.com/zqinking/wrt_release/blob/main/wrt_core/build_container.sh"
click node_firmware_build "https://github.com/zqinking/wrt_release/blob/main/wrt_core/update.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_build_entry,node_source_update toneBlue
class node_device_metadata,node_device_config,node_config_fragments toneAmber
class node_feed_changes,node_package_sync,node_patches toneMint
class node_container_entry,node_firmware_build,node_firmware_output toneRose
class node_user,node_upstream,node_docker toneIndigo
```

## Components

### Build orchestration

- [Build entry](https://github.com/zqinking/wrt_release/blob/main/build.sh): `build.sh`
- [Source update](https://github.com/zqinking/wrt_release/blob/main/wrt_core/update.sh): `wrt_core/update.sh`

### Device configuration

- [Device metadata](https://github.com/zqinking/wrt_release/tree/main/wrt_core/compilecfg): `wrt_core/compilecfg`
- [Device config](https://github.com/zqinking/wrt_release/tree/main/wrt_core/deconfig): `wrt_core/deconfig`
- [Config fragments](https://github.com/zqinking/wrt_release/tree/main/wrt_core/deconfig/fragments): `wrt_core/deconfig/fragments`

### Source customization

- [Feed adjustments](https://github.com/zqinking/wrt_release/blob/main/wrt_core/modules/feeds.sh): `wrt_core/modules/feeds.sh`
- [Package sync](https://github.com/zqinking/wrt_release/blob/main/wrt_core/modules/packages.sh): `wrt_core/modules/packages.sh`
- [Build patches](https://github.com/zqinking/wrt_release/tree/main/wrt_core/patches): `wrt_core/patches`

### Build and output

- [Container build](https://github.com/zqinking/wrt_release/blob/main/wrt_core/build_container.sh): `wrt_core/build_container.sh`
- [Firmware build](https://github.com/zqinking/wrt_release/blob/main/wrt_core/update.sh): `wrt_core/update.sh`
- **Firmware output**

### Other components

- **Builder**
- **Firmware source**
- **Docker runtime**

## Connections

- Builder → Build entry: selects device (evidence: `README.md`)
- Build entry → Device metadata: reads build metadata (evidence: `README.md`)
- Build entry → Device config: combines configuration (evidence: `README.md`)
- Build entry → Config fragments: selects fragments (evidence: `README.md`)
- Build entry → Source update: runs update flow (evidence: `README.md`)
- Source update → Firmware source: pulls source (evidence: `README.md`)
- Source update → Feed adjustments: adjusts feeds (evidence: `README.md`)
- Source update → Package sync: syncs packages (evidence: `README.md`)
- Source update → Build patches: applies patches (evidence: `README.md`)
- Build entry → Container build: starts container build (evidence: `README.md`)
- Container build → Docker runtime: uses runtime (evidence: `README.md`)
- Build entry → Firmware build: runs full build (evidence: `README.md`)
- Build entry → Firmware output: collects firmware (evidence: `README.md`)
