# j0ju/x6100-fw-mangler architecture

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

- Interactive diagram: https://gitdiagram.com/j0ju/x6100-fw-mangler
- Repository: https://github.com/j0ju/x6100-fw-mangler

## Overview

This repository modifies X6100 firmware images and produces bootable SD-card or eMMC update images. The documented workflow downloads and extracts firmware, stages its contents in a Docker image for modification, then emits the chosen image format. README-described capabilities also include vanilla and modded firmware variants, combined multiboot images, and Alpine utilities added to stock images. No source excerpts were provided, so relationships below rely on the README; implementation details beyond paths visible in the tree are not inferred.

Main entry points: [`Makefile.Dockerfile.generic`](https://github.com/j0ju/x6100-fw-mangler/blob/main/Makefile.Dockerfile.generic) (Docker target rootfs), [`multiboot-modded.Dockerfile`](https://github.com/j0ju/x6100-fw-mangler/blob/main/multiboot-modded.Dockerfile) (Multiboot image), [`xiegu-v1.1.8-modded.Dockerfile.d`](https://github.com/j0ju/x6100-fw-mangler/tree/main/xiegu-v1.1.8-modded.Dockerfile.d) (Firmware modifications), [`img-mangler/unrar-img.sh`](https://github.com/j0ju/x6100-fw-mangler/blob/main/img-mangler/unrar-img.sh) (Image extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Firmware inputs"]
  node_archives["Firmware archives"]
  node_unpack["Image extraction<br/>[unrar-img.sh]"]
  node_tarstage["Tar staging<br/>[img-to-tar.sh]"]
end

subgraph group_staging["Image modification"]
  node_target["Docker target rootfs"]
  node_modding["Firmware modifications"]
  node_alpine["Alpine utilities"]
end

subgraph group_outputs["Image outputs"]
  node_sdcard["SD-card image"]
  node_update["eMMC update image<br/>[flash-emmc.sh]"]
end

subgraph group_variants["Firmware variants"]
  node_vanilla["Vanilla variants"]
  node_r1cbu["R1CBU variants"]
  node_multiboot["Multiboot image"]
end

node_operator(("Image builder"))

node_operator -->|"selects firmware"| node_archives
node_archives -->|"downloads and extracts"| node_unpack
node_unpack -->|"stages image"| node_tarstage
node_tarstage -->|"copies into target"| node_target
node_target -->|"applies modifications"| node_modding
node_target -->|"adds Alpine utilities"| node_alpine
node_modding -->|"generates SD image"| node_sdcard
node_modding -->|"generates update image"| node_update
node_target -->|"supports vanilla builds"| node_vanilla
node_target -->|"supports R1CBU builds"| node_r1cbu
node_vanilla -->|"combines firmware"| node_multiboot
node_r1cbu -->|"combines firmware"| node_multiboot
node_multiboot -->|"generates SD image"| node_sdcard
node_multiboot -->|"generates update image"| node_update

click node_unpack "https://github.com/j0ju/x6100-fw-mangler/blob/main/img-mangler/unrar-img.sh"
click node_tarstage "https://github.com/j0ju/x6100-fw-mangler/blob/main/img-mangler/img-to-tar.sh"
click node_target "https://github.com/j0ju/x6100-fw-mangler/blob/main/Makefile.Dockerfile.generic"
click node_modding "https://github.com/j0ju/x6100-fw-mangler/tree/main/xiegu-v1.1.8-modded.Dockerfile.d"
click node_alpine "https://github.com/j0ju/x6100-fw-mangler/tree/main/Opt.Alpine.3.18.Dockerfile.d"
click node_vanilla "https://github.com/j0ju/x6100-fw-mangler/blob/main/xiegu-v1.1.8-vanilla.Dockerfile"
click node_r1cbu "https://github.com/j0ju/x6100-fw-mangler/blob/main/r1cbu-v0.28.0-modded.Dockerfile"
click node_multiboot "https://github.com/j0ju/x6100-fw-mangler/blob/main/multiboot-modded.Dockerfile"
click node_sdcard "https://github.com/j0ju/x6100-fw-mangler/blob/main/img-mangler/docker-img-to-sdcard.sh"
click node_update "https://github.com/j0ju/x6100-fw-mangler/blob/main/img-mangler/update/flash-emmc.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_archives,node_unpack,node_tarstage toneBlue
class node_target,node_modding,node_alpine toneAmber
class node_sdcard,node_update toneMint
class node_vanilla,node_r1cbu,node_multiboot toneRose
class node_operator toneIndigo
```

## Components

### Firmware inputs

- **Firmware archives**
- [Image extraction](https://github.com/j0ju/x6100-fw-mangler/blob/main/img-mangler/unrar-img.sh): `img-mangler/unrar-img.sh`
- [Tar staging](https://github.com/j0ju/x6100-fw-mangler/blob/main/img-mangler/img-to-tar.sh): `img-mangler/img-to-tar.sh`

### Image modification

- [Docker target rootfs](https://github.com/j0ju/x6100-fw-mangler/blob/main/Makefile.Dockerfile.generic): `Makefile.Dockerfile.generic`
- [Firmware modifications](https://github.com/j0ju/x6100-fw-mangler/tree/main/xiegu-v1.1.8-modded.Dockerfile.d): `xiegu-v1.1.8-modded.Dockerfile.d`
- [Alpine utilities](https://github.com/j0ju/x6100-fw-mangler/tree/main/Opt.Alpine.3.18.Dockerfile.d): `Opt.Alpine.3.18.Dockerfile.d`

### Image outputs

- [SD-card image](https://github.com/j0ju/x6100-fw-mangler/blob/main/img-mangler/docker-img-to-sdcard.sh): `img-mangler/docker-img-to-sdcard.sh`
- [eMMC update image](https://github.com/j0ju/x6100-fw-mangler/blob/main/img-mangler/update/flash-emmc.sh): `img-mangler/update/flash-emmc.sh`

### Firmware variants

- [Vanilla variants](https://github.com/j0ju/x6100-fw-mangler/blob/main/xiegu-v1.1.8-vanilla.Dockerfile): `xiegu-v1.1.8-vanilla.Dockerfile`
- [R1CBU variants](https://github.com/j0ju/x6100-fw-mangler/blob/main/r1cbu-v0.28.0-modded.Dockerfile): `r1cbu-v0.28.0-modded.Dockerfile`
- [Multiboot image](https://github.com/j0ju/x6100-fw-mangler/blob/main/multiboot-modded.Dockerfile): `multiboot-modded.Dockerfile`

### Other components

- **Image builder**

## Connections

- Image builder → Firmware archives: selects firmware (evidence: `README.md`)
- Firmware archives → Image extraction: downloads and extracts (evidence: `README.md`)
- Image extraction → Tar staging: stages image (evidence: `README.md`)
- Tar staging → Docker target rootfs: copies into target (evidence: `README.md`)
- Docker target rootfs → Firmware modifications: applies modifications (evidence: `README.md`)
- Docker target rootfs → Alpine utilities: adds Alpine utilities (evidence: `README.md`)
- Firmware modifications → SD-card image: generates SD image (evidence: `README.md`)
- Firmware modifications → eMMC update image: generates update image (evidence: `README.md`)
- Docker target rootfs → Vanilla variants: supports vanilla builds (evidence: `README.md`)
- Docker target rootfs → R1CBU variants: supports R1CBU builds (evidence: `README.md`)
- Vanilla variants → Multiboot image: combines firmware (evidence: `README.md`)
- R1CBU variants → Multiboot image: combines firmware (evidence: `README.md`)
- Multiboot image → SD-card image: generates SD image (evidence: `README.md`)
- Multiboot image → eMMC update image: generates update image (evidence: `README.md`)
