# cachyos/linux-cachyos architecture

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

- Interactive diagram: https://gitdiagram.com/cachyos/linux-cachyos
- Repository: https://github.com/cachyos/linux-cachyos

## Overview

#### Purpose and Entry Points
This repository defines Arch Linux package builds for CachyOS kernel variants. It does not contain the kernel source; package recipes acquire and build the CachyOS Linux fork into installable packages. Primary build entry points are variant `PKGBUILD` files, especially `linux-cachyos/PKGBUILD`, with architecture-oriented build wrappers in `script.sh`, `script-v3-v4.sh`, and `script-znver4.sh`.

#### Variant Package Families
Each top-level `linux-cachyos-*` directory is an independently buildable kernel package family, combining a package recipe, kernel configuration, and generated Arch metadata:
- Default optimized EEVDF build: `linux-cachyos/PKGBUILD`, `linux-cachyos/config`, `linux-cachyos/.SRCINFO`
- Scheduler variants: `linux-cachyos-bore/PKGBUILD`, `linux-cachyos-bmq/PKGBUILD`, `linux-cachyos-eevdf/PKGBUILD`
- Specialized builds: `linux-cachyos-lts/PKGBUILD`, `linux-cachyos-hardened/PKGBUILD`, `linux-cachyos-rt-bore/PKGBUILD`
- Workload/device builds: `linux-cachyos-server/PKGBUILD`, `linux-cachyos-deckify/PKGBUILD`, `linux-cachyos-rc/PKGBUILD`

The directory boundary is the principal product boundary: variants can differ in scheduler, upstream series, hardening, real-time support, device enablement, compiler choices, and configuration.

#### Build Definition Stage
`PKGBUILD` files are the authoritative executable specifications for Arch `makepkg`: source retrieval, versioning, patches/build flags, kernel compilation, module/package assembly, and package metadata. For example, `linux-cachyos/PKGBUILD` defines the default product, while `linux-cachyos-lts/PKGBUILD` and `linux-cachyos-rc/PKGBUILD` represent different kernel-release tracks.

The build depends materially on Arch packaging infrastructure (`makepkg`/pacman conventions), a kernel toolchain (GCC or LLVM/Clang depending on variant), and the external CachyOS Linux source fork/upstream Linux inputs.

#### Kernel Configuration Boundary
Per-variant `config` files are declarative kernel feature boundaries consumed by their sibling package recipes:
- `linux-cachyos/config`
- `linux-cachyos-hardened/config`
- `linux-cachyos-server/config`

These configurations select scheduler and systems capabilities such as preemption, hardware drivers, filesystems, networking, security hardening, and sched-ext compatibility. Recipe logic supplies build mechanics; `config` supplies the kernel feature policy.

#### Metadata and Release Synchronization
`.SRCINFO` is generated package metadata for Arch repository/index consumers and must remain synchronized with each `PKGBUILD`, e.g. `linux-cachyos/.SRCINFO`, `linux-cachyos-bore/.SRCINFO`, and `linux-cachyos-rt-bore/.SRCINFO`. `srcinfo.sh` is the repository-level maintenance entry point for regenerating this metadata.

Release automation is centered on `tag-release.sh`, which likely coordinates version/tag-oriented release preparation across package definitions. The resulting artifacts are intended for CachyOS package repositories and consumed through pacman.

#### Architecture-Specific Build Flow
The normal control flow is: select a kernel variant → select target CPU baseline/optimization tier → invoke the appropriate build script or `makepkg` → compile/package kernel and modules → publish package metadata/artifacts.

`script.sh` is the general wrapper; `script-v3-v4.sh` targets x86-64-v3/v4 optimized builds; `script-znver4.sh` targets AMD Zen 4-oriented builds. This separates CPU ISA targeting from the kernel-variant directories, allowing the same product family to be rebuilt for multiple CachyOS repository tiers.

#### CI and Operational Boundaries
GitHub Actions workflow `/.github/workflows/build.yml` is the visible automation boundary for validating or building package changes. Repository CI executes in GitHub-hosted infrastructure, while final distribution relies on external CachyOS mirrors/repositories and Arch-compatible package management. The source/kernel integration boundary remains external: this repo packages the CachyOS Linux fork rather than implementing kernel subsystems itself.

Main entry points: [`linux-cachyos/PKGBUILD`](https://github.com/cachyos/linux-cachyos/blob/master/linux-cachyos/PKGBUILD) (PKGBUILD specifications), [`srcinfo.sh`](https://github.com/cachyos/linux-cachyos/blob/master/srcinfo.sh) (SRCINFO refresh), [`linux-cachyos/.SRCINFO`](https://github.com/cachyos/linux-cachyos/blob/master/linux-cachyos/.SRCINFO) (Generated .SRCINFO), [`linux-cachyos/config`](https://github.com/cachyos/linux-cachyos/blob/master/linux-cachyos/config) (Default kernel config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_variants["Kernel package families"]
  node_default["Default EEVDF package<br/>PKGBUILD family"]
  node_scheduler["Scheduler variants<br/>PKGBUILD families"]
  node_specialized["Specialized variants<br/>PKGBUILD families"]
  node_workload["Workload/device variants<br/>PKGBUILD families"]
  node_default_config["Default kernel config"]
  node_variant_configs["Variant kernel configs"]
  node_srcinfo["Generated .SRCINFO<br/>Arch metadata<br/>[.SRCINFO]"]
  node_pkgbuilds["PKGBUILD specifications<br/>makepkg recipes"]
end

subgraph group_automation["Build and release automation"]
  node_general_wrapper["General build wrapper<br/>build script<br/>[script.sh]"]
  node_tier_wrapper["x86-64-v3/v4 wrapper<br/>build script<br/>[script-v3-v4.sh]"]
  node_zen_wrapper["Zen 4 wrapper<br/>build script<br/>[script-znver4.sh]"]
  node_srcinfo_refresh["SRCINFO refresh<br/>maintenance script<br/>[srcinfo.sh]"]
  node_release["Release tagging<br/>release script<br/>[tag-release.sh]"]
  node_ci["GitHub Actions build<br/>CI workflow<br/>[build.yml]"]
end

subgraph group_external["External build and distribution"]
  node_kernel_source[("CachyOS Linux source<br/>external kernel source")]
  node_arch_tooling{{"Arch packaging toolchain<br/>makepkg and compiler"}}
  node_artifacts["Kernel packages and modules<br/>package artifacts"]
  node_repositories[("CachyOS repositories<br/>package distribution")]
  node_pacman(("Arch package consumers<br/>pacman clients"))
end

node_default -->|"is defined by"| node_pkgbuilds
node_scheduler -->|"contribute recipes"| node_pkgbuilds
node_specialized -->|"contribute recipes"| node_pkgbuilds
node_workload -->|"contribute recipes"| node_pkgbuilds
node_default_config -->|"sets feature policy"| node_default
node_variant_configs -->|"configure"| node_scheduler
node_variant_configs -->|"configure"| node_specialized
node_variant_configs -->|"configure"| node_workload
node_general_wrapper -->|"invokes build"| node_pkgbuilds
node_tier_wrapper -->|"builds CPU tiers"| node_pkgbuilds
node_zen_wrapper -->|"builds Zen 4 tier"| node_pkgbuilds
node_pkgbuilds -->|"retrieves sources"| node_kernel_source
node_pkgbuilds -->|"runs through"| node_arch_tooling
node_arch_tooling -->|"compiles and packages"| node_artifacts
node_srcinfo_refresh -->|"reads recipes"| node_pkgbuilds
node_srcinfo_refresh -->|"regenerates"| node_srcinfo
node_release -->|"prepares releases"| node_pkgbuilds
node_ci -->|"validates or builds"| node_pkgbuilds
node_artifacts -->|"published to"| node_repositories
node_srcinfo -->|"indexes packages"| node_repositories
node_repositories -->|"served through"| node_pacman

click node_default "https://github.com/cachyos/linux-cachyos/blob/master/linux-cachyos/PKGBUILD"
click node_default_config "https://github.com/cachyos/linux-cachyos/blob/master/linux-cachyos/config"
click node_srcinfo "https://github.com/cachyos/linux-cachyos/blob/master/linux-cachyos/.SRCINFO"
click node_pkgbuilds "https://github.com/cachyos/linux-cachyos/blob/master/linux-cachyos/PKGBUILD"
click node_general_wrapper "https://github.com/cachyos/linux-cachyos/blob/master/script.sh"
click node_tier_wrapper "https://github.com/cachyos/linux-cachyos/blob/master/script-v3-v4.sh"
click node_zen_wrapper "https://github.com/cachyos/linux-cachyos/blob/master/script-znver4.sh"
click node_srcinfo_refresh "https://github.com/cachyos/linux-cachyos/blob/master/srcinfo.sh"
click node_release "https://github.com/cachyos/linux-cachyos/blob/master/tag-release.sh"
click node_ci "https://github.com/cachyos/linux-cachyos/blob/master/.github/workflows/build.yml"

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_default,node_scheduler,node_specialized,node_workload,node_default_config,node_variant_configs,node_srcinfo,node_pkgbuilds toneBlue
class node_general_wrapper,node_tier_wrapper,node_zen_wrapper,node_srcinfo_refresh,node_release,node_ci toneAmber
class node_kernel_source,node_arch_tooling,node_artifacts,node_repositories,node_pacman toneMint
```

## Components

### Kernel package families

Independent Arch kernel products.

- [Default EEVDF package](https://github.com/cachyos/linux-cachyos/blob/master/linux-cachyos/PKGBUILD): PKGBUILD family · Primary optimized CachyOS kernel product. · `linux-cachyos/PKGBUILD`
- **Scheduler variants**: PKGBUILD families · BORE, BMQ, and alternate EEVDF products.
- **Specialized variants**: PKGBUILD families · LTS, hardened, and RT/BORE release tracks.
- **Workload/device variants**: PKGBUILD families · Server, Deckify, and release-candidate builds.
- [Default kernel config](https://github.com/cachyos/linux-cachyos/blob/master/linux-cachyos/config): kernel config · Feature policy consumed by the default recipe. · `linux-cachyos/config`
- **Variant kernel configs**: kernel configs · Per-product scheduler, driver, and security policy.
- [Generated .SRCINFO](https://github.com/cachyos/linux-cachyos/blob/master/linux-cachyos/.SRCINFO): Arch metadata · Repository metadata synchronized from package recipes. · `linux-cachyos/.SRCINFO`
- [PKGBUILD specifications](https://github.com/cachyos/linux-cachyos/blob/master/linux-cachyos/PKGBUILD): makepkg recipes · Authoritative source, version, build, and package definitions. · `linux-cachyos/PKGBUILD`

### Build and release automation

- [General build wrapper](https://github.com/cachyos/linux-cachyos/blob/master/script.sh): build script · `script.sh`
- [x86-64-v3/v4 wrapper](https://github.com/cachyos/linux-cachyos/blob/master/script-v3-v4.sh): build script · Selects x86-64-v3/v4 optimized builds. · `script-v3-v4.sh`
- [Zen 4 wrapper](https://github.com/cachyos/linux-cachyos/blob/master/script-znver4.sh): build script · Selects AMD Zen 4-oriented builds. · `script-znver4.sh`
- [SRCINFO refresh](https://github.com/cachyos/linux-cachyos/blob/master/srcinfo.sh): maintenance script · `srcinfo.sh`
- [Release tagging](https://github.com/cachyos/linux-cachyos/blob/master/tag-release.sh): release script · `tag-release.sh`
- [GitHub Actions build](https://github.com/cachyos/linux-cachyos/blob/master/.github/workflows/build.yml): CI workflow · Validates or builds package changes. · `.github/workflows/build.yml`

### External build and distribution

- **CachyOS Linux source**: external kernel source · Fork and upstream Linux inputs are acquired by recipes.
- **Arch packaging toolchain**: makepkg and compiler · Arch packaging conventions plus GCC or LLVM/Clang.
- **Kernel packages and modules**: package artifacts · Installable compiled kernel outputs.
- **CachyOS repositories**: package distribution · External repositories and mirrors publish packages for pacman.
- **Arch package consumers**: pacman clients

## Connections

- Default EEVDF package → PKGBUILD specifications: is defined by
- Scheduler variants → PKGBUILD specifications: contribute recipes
- Specialized variants → PKGBUILD specifications: contribute recipes
- Workload/device variants → PKGBUILD specifications: contribute recipes
- Default kernel config → Default EEVDF package: sets feature policy
- Variant kernel configs → Scheduler variants: configure
- Variant kernel configs → Specialized variants: configure
- Variant kernel configs → Workload/device variants: configure
- General build wrapper → PKGBUILD specifications: invokes build
- x86-64-v3/v4 wrapper → PKGBUILD specifications: builds CPU tiers
- Zen 4 wrapper → PKGBUILD specifications: builds Zen 4 tier
- PKGBUILD specifications → CachyOS Linux source: retrieves sources
- PKGBUILD specifications → Arch packaging toolchain: runs through
- Arch packaging toolchain → Kernel packages and modules: compiles and packages
- SRCINFO refresh → PKGBUILD specifications: reads recipes
- SRCINFO refresh → Generated .SRCINFO: regenerates
- Release tagging → PKGBUILD specifications: prepares releases
- GitHub Actions build → PKGBUILD specifications: validates or builds
- Kernel packages and modules → CachyOS repositories: published to
- Generated .SRCINFO → CachyOS repositories: indexes packages
- CachyOS repositories → Arch package consumers: served through
