# rrorg/rr architecture

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

- Interactive diagram: https://gitdiagram.com/rrorg/rr
- Repository: https://github.com/rrorg/rr

## Overview

RR is a Synology DSM bootloader preinstallation and recovery environment for x86/x64 machines. The principal workflow is: a user boots the prepared media, RR initializes hardware and configuration, presents its management menu, and produces or launches a patched DSM-compatible boot environment. Compilation obtains model, version, PAT, addon, and module data from online sources. The graph also shows Proxmox installation and Docker/QEMU usage. Some shell orchestration is inferred only from filenames because those implementations were not sampled.

Main entry points: [`files/initrd/opt/rr/menu.sh`](https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/menu.sh) (Management Menu), [`scripts/func.py`](https://github.com/rrorg/rr/blob/main/scripts/func.py) (Catalog Generator), [`files/mnt/p1/boot/grub/grub.cfg`](https://github.com/rrorg/rr/blob/main/files/mnt/p1/boot/grub/grub.cfg) (Boot Media), [`files/initrd/opt/rr/init.sh`](https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/init.sh) (Environment Init)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime Environment"]
  node_boot_script["Boot Launcher<br/>[boot.sh]"]
  node_init_script["Environment Init<br/>[init.sh]"]
  node_menu["Management Menu<br/>[menu.sh]"]
  node_config["Configuration Store<br/>[configFile.sh]"]
  node_runtime_functions["Runtime Functions<br/>[functions.sh]"]
end

subgraph group_metadata["Metadata and Build"]
  node_cli_helpers["RR CLI Helpers<br/>[functions.py]"]
  node_catalog_generator["Catalog Generator<br/>[func.py]"]
  node_platform_catalog[("Platform Catalog<br/>[platforms.yml]")]
  node_published_metadata["Published Metadata<br/>[models.json]"]
  node_pat_metadata["PAT Metadata<br/>[pats.json]"]
end

subgraph group_boot["Boot Artifacts"]
  node_boot_patcher["Ramdisk Patcher<br/>[ramdisk-patch.sh]"]
  node_kernel_patcher["Kernel Patcher<br/>[zimage-patch.sh]"]
  node_boot_media["Boot Media<br/>[grub.cfg]"]
  node_efi_loader["EFI Loader<br/>[SynoBootLoader.efi]"]
end

subgraph group_integrations["Deployment Integrations"]
  node_pve_installer["PVE Installer<br/>[pve.sh]"]
end

subgraph group_support["Localization and Extensions"]
  node_module_manager["Module Manager<br/>[modules.sh]"]
  node_addon_manager["Addon Manager<br/>[addons.sh]"]
  node_localization["Translations"]
end

node_user(("Operator"))
node_internet(("Synology Services"))
node_proxmox(("Proxmox VE"))
node_qemu(("Docker QEMU"))

node_user -->|"boots"| node_boot_script
node_boot_script -->|"dispatches"| node_init_script
node_init_script -->|"loads"| node_config
node_init_script -->|"opens"| node_menu
node_menu -->|"runs"| node_runtime_functions
node_menu -->|"manages modules"| node_module_manager
node_menu -->|"manages addons"| node_addon_manager
node_menu -->|"loads translations"| node_localization
node_menu -->|"starts patching"| node_boot_patcher
node_menu -->|"patches kernel"| node_kernel_patcher
node_catalog_generator -->|"reads platforms"| node_platform_catalog
node_catalog_generator -->|"queries releases"| node_internet
node_catalog_generator -->|"writes models"| node_published_metadata
node_catalog_generator -->|"writes PATs"| node_pat_metadata
node_cli_helpers -->|"downloads metadata"| node_internet
node_boot_patcher -->|"updates boot"| node_boot_media
node_kernel_patcher -->|"updates media"| node_boot_media
node_efi_loader -->|"loads configuration"| node_boot_media
node_user -->|"requests install"| node_pve_installer
node_pve_installer -->|"installs image"| node_proxmox
node_qemu -.->|"boots image"| node_boot_media

click node_boot_script "https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/boot.sh"
click node_init_script "https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/init.sh"
click node_menu "https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/menu.sh"
click node_config "https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/include/configFile.sh"
click node_runtime_functions "https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/include/functions.sh"
click node_module_manager "https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/include/modules.sh"
click node_addon_manager "https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/include/addons.sh"
click node_cli_helpers "https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/include/functions.py"
click node_catalog_generator "https://github.com/rrorg/rr/blob/main/scripts/func.py"
click node_platform_catalog "https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/platforms.yml"
click node_published_metadata "https://github.com/rrorg/rr/blob/main/docs/models.json"
click node_pat_metadata "https://github.com/rrorg/rr/blob/main/docs/pats.json"
click node_boot_patcher "https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/ramdisk-patch.sh"
click node_kernel_patcher "https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/zimage-patch.sh"
click node_boot_media "https://github.com/rrorg/rr/blob/main/files/mnt/p1/boot/grub/grub.cfg"
click node_efi_loader "https://github.com/rrorg/rr/blob/main/files/mnt/p1/EFI/BOOT/SynoBootLoader.efi"
click node_localization "https://github.com/rrorg/rr/tree/main/files/initrd/opt/rr/lang"
click node_pve_installer "https://github.com/rrorg/rr/blob/main/scripts/pve.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_boot_script,node_init_script,node_menu,node_config,node_runtime_functions toneBlue
class node_cli_helpers,node_catalog_generator,node_platform_catalog,node_published_metadata,node_pat_metadata toneAmber
class node_boot_patcher,node_kernel_patcher,node_boot_media,node_efi_loader toneMint
class node_pve_installer toneRose
class node_module_manager,node_addon_manager,node_localization,node_user,node_internet,node_proxmox,node_qemu toneIndigo
```

## Components

### Runtime Environment

- [Boot Launcher](https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/boot.sh): `files/initrd/opt/rr/boot.sh`
- [Environment Init](https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/init.sh): `files/initrd/opt/rr/init.sh`
- [Management Menu](https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/menu.sh): `files/initrd/opt/rr/menu.sh`
- [Configuration Store](https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/include/configFile.sh): `files/initrd/opt/rr/include/configFile.sh`
- [Runtime Functions](https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/include/functions.sh): `files/initrd/opt/rr/include/functions.sh`

### Metadata and Build

- [RR CLI Helpers](https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/include/functions.py): `files/initrd/opt/rr/include/functions.py`
- [Catalog Generator](https://github.com/rrorg/rr/blob/main/scripts/func.py): `scripts/func.py`
- [Platform Catalog](https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/platforms.yml): `files/initrd/opt/rr/platforms.yml`
- [Published Metadata](https://github.com/rrorg/rr/blob/main/docs/models.json): `docs/models.json`
- [PAT Metadata](https://github.com/rrorg/rr/blob/main/docs/pats.json): `docs/pats.json`

### Boot Artifacts

- [Ramdisk Patcher](https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/ramdisk-patch.sh): `files/initrd/opt/rr/ramdisk-patch.sh`
- [Kernel Patcher](https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/zimage-patch.sh): `files/initrd/opt/rr/zimage-patch.sh`
- [Boot Media](https://github.com/rrorg/rr/blob/main/files/mnt/p1/boot/grub/grub.cfg): `files/mnt/p1/boot/grub/grub.cfg`
- [EFI Loader](https://github.com/rrorg/rr/blob/main/files/mnt/p1/EFI/BOOT/SynoBootLoader.efi): `files/mnt/p1/EFI/BOOT/SynoBootLoader.efi`

### Deployment Integrations

- [PVE Installer](https://github.com/rrorg/rr/blob/main/scripts/pve.sh): `scripts/pve.sh`

### Localization and Extensions

- [Module Manager](https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/include/modules.sh): `files/initrd/opt/rr/include/modules.sh`
- [Addon Manager](https://github.com/rrorg/rr/blob/main/files/initrd/opt/rr/include/addons.sh): `files/initrd/opt/rr/include/addons.sh`
- [Translations](https://github.com/rrorg/rr/tree/main/files/initrd/opt/rr/lang): `files/initrd/opt/rr/lang`

### Other components

- **Operator**
- **Synology Services**
- **Proxmox VE**
- **Docker QEMU**

## Connections

- Operator → Boot Launcher: boots
- Boot Launcher → Environment Init: dispatches
- Environment Init → Configuration Store: loads
- Environment Init → Management Menu: opens
- Management Menu → Runtime Functions: runs
- Management Menu → Module Manager: manages modules
- Management Menu → Addon Manager: manages addons
- Management Menu → Translations: loads translations
- Management Menu → Ramdisk Patcher: starts patching
- Management Menu → Kernel Patcher: patches kernel
- Catalog Generator → Platform Catalog: reads platforms
- Catalog Generator → Synology Services: queries releases
- Catalog Generator → Published Metadata: writes models
- Catalog Generator → PAT Metadata: writes PATs
- RR CLI Helpers → Synology Services: downloads metadata
- Ramdisk Patcher → Boot Media: updates boot
- Kernel Patcher → Boot Media: updates media
- EFI Loader → Boot Media: loads configuration
- Operator → PVE Installer: requests install
- PVE Installer → Proxmox VE: installs image
- Docker QEMU → Boot Media: boots image
