# justadeayo/ksu_builder architecture

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

- Interactive diagram: https://gitdiagram.com/justadeayo/ksu_builder
- Repository: https://github.com/justadeayo/ksu_builder

## Overview

KSU_Builder is a GitHub Actions-based Android kernel build system, not a standalone runtime library. Its main workflow accepts build inputs, resolves device configuration, and builds KernelSU or BakaSU/SUSFS kernel variants; related workflows build the Manager and publish releases. The README documents workflow relationships and shared master-script steps. The only sampled source is the device resolver, so other implementation-level links are omitted where the README does not establish them.

Main entry points: [`.github/workflows/kernelsu.yml`](https://github.com/justadeayo/ksu_builder/blob/dev/.github/workflows/kernelsu.yml) (KernelSU build), [`.github/workflows/release.yml`](https://github.com/justadeayo/ksu_builder/blob/dev/.github/workflows/release.yml) (Release publishing), [`.github/workflows/build-manager.yml`](https://github.com/justadeayo/ksu_builder/blob/dev/.github/workflows/build-manager.yml) (Manager build), [`.github/workflows/bakasu.yml`](https://github.com/justadeayo/ksu_builder/blob/dev/.github/workflows/bakasu.yml) (BakaSU build)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Build inputs"]
  node_device_config["Device configuration"]
  node_device_resolver["Resolve device<br/>[resolve-device.py]"]
end

subgraph group_kernel["Kernel builds"]
  node_bakasu_workflow["BakaSU build<br/>[bakasu.yml]"]
  node_kernelsu_workflow["KernelSU build<br/>[kernelsu.yml]"]
  node_master["Shared build steps<br/>[master.sh]"]
  node_kernel_compile["Kernel compilation<br/>[compile.sh]"]
  node_ksu_setup["KernelSU setup<br/>[ksu.sh]"]
  node_susfs_setup["SUSFS setup<br/>[susfs-setup.sh]"]
  node_variant["Build variants<br/>[variant.sh]"]
  node_notify["Build notifications<br/>[notify.sh]"]
end

subgraph group_manager["Manager and release"]
  node_manager_workflow["Manager build<br/>[build-manager.yml]"]
  node_release_workflow["Release publishing<br/>[release.yml]"]
end

subgraph group_environment["Build environment"]
  node_build_env_workflow["Build image workflow<br/>[build-env.yml]"]
  node_build_image["Build environment image"]
end

node_operator(("Build operator"))

node_operator -->|"starts build"| node_bakasu_workflow
node_operator -->|"starts build"| node_kernelsu_workflow
node_operator -->|"starts build"| node_manager_workflow
node_operator -->|"starts build"| node_build_env_workflow
node_operator -->|"starts release"| node_release_workflow
node_device_resolver -->|"reads config"| node_device_config
node_bakasu_workflow -->|"uses shared steps"| node_master
node_kernelsu_workflow -->|"uses shared steps"| node_master
node_kernelsu_workflow -->|"calls"| node_manager_workflow
node_release_workflow -->|"calls"| node_kernelsu_workflow
node_release_workflow -->|"calls"| node_manager_workflow
node_build_env_workflow -->|"builds image"| node_build_image

click node_device_config "https://github.com/justadeayo/ksu_builder/tree/dev/devices"
click node_device_resolver "https://github.com/justadeayo/ksu_builder/blob/dev/scripts/resolve-device.py"
click node_bakasu_workflow "https://github.com/justadeayo/ksu_builder/blob/dev/.github/workflows/bakasu.yml"
click node_kernelsu_workflow "https://github.com/justadeayo/ksu_builder/blob/dev/.github/workflows/kernelsu.yml"
click node_master "https://github.com/justadeayo/ksu_builder/blob/dev/scripts/master.sh"
click node_kernel_compile "https://github.com/justadeayo/ksu_builder/blob/dev/scripts/compile.sh"
click node_ksu_setup "https://github.com/justadeayo/ksu_builder/blob/dev/scripts/ksu.sh"
click node_susfs_setup "https://github.com/justadeayo/ksu_builder/blob/dev/scripts/susfs-setup.sh"
click node_variant "https://github.com/justadeayo/ksu_builder/blob/dev/scripts/variant.sh"
click node_manager_workflow "https://github.com/justadeayo/ksu_builder/blob/dev/.github/workflows/build-manager.yml"
click node_release_workflow "https://github.com/justadeayo/ksu_builder/blob/dev/.github/workflows/release.yml"
click node_build_env_workflow "https://github.com/justadeayo/ksu_builder/blob/dev/.github/workflows/build-env.yml"
click node_build_image "https://github.com/justadeayo/ksu_builder/blob/dev/docker/build-env/Dockerfile"
click node_notify "https://github.com/justadeayo/ksu_builder/blob/dev/scripts/notify.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_device_config,node_device_resolver toneBlue
class node_bakasu_workflow,node_kernelsu_workflow,node_master,node_kernel_compile,node_ksu_setup,node_susfs_setup,node_variant,node_notify toneAmber
class node_manager_workflow,node_release_workflow toneMint
class node_build_env_workflow,node_build_image toneRose
class node_operator toneIndigo
```

## Components

### Build inputs

- [Device configuration](https://github.com/justadeayo/ksu_builder/tree/dev/devices): `devices`
- [Resolve device](https://github.com/justadeayo/ksu_builder/blob/dev/scripts/resolve-device.py): `scripts/resolve-device.py`

### Kernel builds

- [BakaSU build](https://github.com/justadeayo/ksu_builder/blob/dev/.github/workflows/bakasu.yml): `.github/workflows/bakasu.yml`
- [KernelSU build](https://github.com/justadeayo/ksu_builder/blob/dev/.github/workflows/kernelsu.yml): `.github/workflows/kernelsu.yml`
- [Shared build steps](https://github.com/justadeayo/ksu_builder/blob/dev/scripts/master.sh): `scripts/master.sh`
- [Kernel compilation](https://github.com/justadeayo/ksu_builder/blob/dev/scripts/compile.sh): `scripts/compile.sh`
- [KernelSU setup](https://github.com/justadeayo/ksu_builder/blob/dev/scripts/ksu.sh): `scripts/ksu.sh`
- [SUSFS setup](https://github.com/justadeayo/ksu_builder/blob/dev/scripts/susfs-setup.sh): `scripts/susfs-setup.sh`
- [Build variants](https://github.com/justadeayo/ksu_builder/blob/dev/scripts/variant.sh): `scripts/variant.sh`
- [Build notifications](https://github.com/justadeayo/ksu_builder/blob/dev/scripts/notify.sh): `scripts/notify.sh`

### Manager and release

- [Manager build](https://github.com/justadeayo/ksu_builder/blob/dev/.github/workflows/build-manager.yml): `.github/workflows/build-manager.yml`
- [Release publishing](https://github.com/justadeayo/ksu_builder/blob/dev/.github/workflows/release.yml): `.github/workflows/release.yml`

### Build environment

- [Build image workflow](https://github.com/justadeayo/ksu_builder/blob/dev/.github/workflows/build-env.yml): `.github/workflows/build-env.yml`
- [Build environment image](https://github.com/justadeayo/ksu_builder/blob/dev/docker/build-env/Dockerfile): `docker/build-env/Dockerfile`

### Other components

- **Build operator**

## Connections

- Build operator → BakaSU build: starts build (evidence: `README.md`)
- Build operator → KernelSU build: starts build (evidence: `README.md`)
- Build operator → Manager build: starts build (evidence: `README.md`)
- Build operator → Build image workflow: starts build (evidence: `README.md`)
- Build operator → Release publishing: starts release (evidence: `README.md`)
- Resolve device → Device configuration: reads config (evidence: `scripts/resolve-device.py`)
- BakaSU build → Shared build steps: uses shared steps (evidence: `README.md`)
- KernelSU build → Shared build steps: uses shared steps (evidence: `README.md`)
- KernelSU build → Manager build: calls (evidence: `README.md`)
- Release publishing → KernelSU build: calls (evidence: `README.md`)
- Release publishing → Manager build: calls (evidence: `README.md`)
- Build image workflow → Build environment image: builds image (evidence: `README.md`)
