Skip to content

Repository files navigation

Linux Kernel Builder Suite

A comprehensive Linux kernel build system combining:

  • Curated Patch Collection: Organized patches from CachyOS, XanMod, Clear Linux, and more
  • Catgirl Edition: Aggressive performance optimizations with multiple scheduler options
  • CachyMod: Interactive CachyOS kernel builder with multiple scheduler variants
  • TKG Integration: Frogging-Family package management for linux-tkg, nvidia-tkg, mesa-tkg, wine-tkg, and proton-tkg

This unified repository provides everything needed for building highly optimized custom Linux kernels with extensive customization options.

Repository Structure

.
├── 6.12/                       # Patches for Linux kernel 6.12
├── 6.15/                       # Patches for Linux kernel 6.15
├── 6.16/                       # Patches for Linux kernel 6.16
├── 6.17/                       # Patches for Linux kernel 6.17
│   └── catgirl-edition/       # Catgirl edition patches
├── 6.18/                       # Patches for Linux kernel 6.18
├── build/                      # Build system directory
│   ├── catgirl-edition/       # Catgirl Edition PKGBUILD and configs
│   │   ├── PKGBUILD           # Arch Linux package build script
│   │   ├── config             # Kernel configuration
│   │   ├── patches/           # Catgirl-specific patches
│   │   └── README.md          # Catgirl Edition documentation
│   ├── cachymod/              # CachyMod interactive build system
│   │   ├── confmod.sh         # Interactive configuration utility
│   │   ├── uninstall.sh       # Kernel removal tool
│   │   ├── defconfigs/        # Pre-made configurations
│   │   ├── sample/            # Custom modification templates
│   │   └── 6.18/              # Kernel 6.18 build directory
│   ├── configs/               # Build configurations
│   └── templates/             # Build templates
├── scripts/                    # Build and configuration scripts
│   ├── cachy/                 # CachyOS-specific scripts
│   ├── utils/                 # Utility scripts
│   ├── compile.sh             # Kernel compilation script
│   ├── config.sh              # Kernel configuration script
│   ├── fetch.sh               # Patch fetching script
│   ├── trim.sh                # Patch trimming/processing script
│   ├── tkg-installer          # TKG package installer (TUI)
│   └── install-tkg.sh         # TKG installer setup script
├── docs/                       # Documentation and patch lists
└── kernel-builder.sh           # Main unified build interface

Quick Start

Unified Build Interface

Use the main kernel-builder.sh script for all build operations:

# Interactive mode - shows menu with all options
./kernel-builder.sh

# Build Catgirl Edition kernel (optimized, multiple schedulers)
./kernel-builder.sh catgirl

# Build CachyMod kernels (interactive CachyOS builds)
./kernel-builder.sh cachymod

# Launch TKG installer TUI for Frogging-Family packages
./kernel-builder.sh tkg

# Browse available patches by version
./kernel-builder.sh patches 6.17

# Fetch latest patches from upstream sources
./kernel-builder.sh fetch

# Standard kernel compilation
./kernel-builder.sh compile

# Show help and available commands
./kernel-builder.sh help

Building Catgirl Edition Kernel

The Catgirl Edition provides aggressive performance optimizations:

# Build with interactive customization
./kernel-builder.sh catgirl
# Or directly with makepkg
cd build/catgirl-edition
makepkg -scf --cleanbuild --skipchecksums

Key Features:

  • Multiple CPU schedulers: BORE (recommended), EEVDF, BMQ, RT | Benchmarks
  • Clang LTO and -O3 optimizations
  • TCP BBRv3 congestion control
  • Modprobed-db support for minimal kernel size
  • Clear Linux and CachyOS patchsets

Building CachyMod Kernels

CachyMod provides an interactive build system for CachyOS with pre-configured scheduler variants:

# Interactive configuration (requires gum)
./kernel-builder.sh cachymod

# Or use subcommands:
./kernel-builder.sh cachymod config      # Configure new kernel variant
./kernel-builder.sh cachymod build 618-bore  # Build specific config
./kernel-builder.sh cachymod list        # List available configs
./kernel-builder.sh cachymod uninstall   # Remove installed kernels

Available Configs:

  • 618 - Standard EEVDF scheduler
  • 618-bore - BORE scheduler (balanced)
  • 618-bmq - BMQ scheduler (minimal)
  • 618-pds - PDS scheduler
  • 618-rt - Real-time scheduler

Prerequisites:

sudo pacman -S gum  # Required for interactive UI

See build/cachymod/README.md for detailed documentation.

Using TKG Installer

Build and manage Frogging-Family packages:

# Interactive TUI mode
./kernel-builder.sh tkg

# Direct package installation
./scripts/tkg-installer linux     # Linux-TKG kernel
./scripts/tkg-installer nvidia    # NVIDIA-TKG drivers
./scripts/tkg-installer mesa      # Mesa-TKG graphics
./scripts/tkg-installer wine      # Wine-TKG
./scripts/tkg-installer proton    # Proton-TKG

# Edit package configuration
./scripts/tkg-installer linux config

Traditional Patch Application

For manual patch application:

# Fetch latest patches
./scripts/fetch.sh

# Apply patches to kernel source
cd /path/to/linux-source
patch -p1 < /path/to/patch-file.patch

# Or use git apply
git apply /path/to/patch-file.patch

Building with CachyOS Patches

./scripts/cachy/cachy.sh
./scripts/compile.sh

Build Profiles

Catgirl Edition (Aggressive Optimizations)

A highly optimized kernel build system with the following features:

Performance Optimizations:

  • Guess unwinder: Zero overhead alternative to ORC/frame pointer
  • CPU schedulers: BORE (best for desktop), EEVDF (stock), BMQ (minimal), RT (realtime)
  • TCP BBRv3: Google's advanced congestion control protocol
  • -O3 optimization: Maximum compiler optimization level
  • Clang LTO: Link-time optimization for better performance
  • -march=native: CPU-specific optimizations

Size Reductions:

  • Remove BUG() calls, coredump support, and tracing infrastructure
  • Disable module decompression in kernel
  • Remove 16/32-bit application support (optional)
  • No printk() support to reduce kernel size

Configurability:

  • Fine-grained kernel tickrates (default: 1000Hz)
  • Multiple preemption levels (rt, full, lazy, voluntary, none)
  • Modprobed-db integration for minimal module selection
  • Per-feature toggles in PKGBUILD

See build/catgirl-edition/README.md for detailed documentation.

CachyMod (Interactive CachyOS Builds)

An interactive kernel build system designed specifically for CachyOS:

Key Features:

  • Interactive Configuration: Uses gum for user-friendly TUI configuration
  • Pre-made Configs: Ready-to-use configurations in defconfigs/ directory
  • Multiple Scheduler Support: EEVDF (default), BORE, BMQ, PDS, RT
  • Kernel Variants: Build and maintain multiple kernel versions simultaneously
  • AutoFDO Support: Profile-guided optimization for performance
  • Custom Modifications: Support for user scripts via custom.sh

Build Options:

  • LTO: None, Thin, Full
  • AutoFDO: Optional profile-guided optimization
  • Hugepage: Always, madvise
  • Local module config support (modprobed-db)
  • TCP BBRv3 congestion control
  • Tick types: Full, idle, periodic
  • HZ values: 1000, 800, 500, 300, 250, 100
  • Preemption: Full, lazy, voluntary, none

Workflow:

  1. Configure kernel with confmod.sh (creates configs in ~/.config/cachymod/)
  2. Build with build.sh <config-name>
  3. Automatic installation via pacman
  4. Uninstall with interactive uninstall.sh tool

See build/cachymod/README.md for detailed documentation.

TKG Packages (Frogging-Family)

Customizable source-based packages from the Frogging-Family:

  • linux-tkg: Highly customizable kernel builds
  • nvidia-tkg: Custom NVIDIA driver builds
  • mesa-tkg: Optimized Mesa graphics drivers
  • wine-tkg: Enhanced Wine compatibility layer
  • proton-tkg: Optimized Proton for Steam gaming

Each package includes extensive customization options via customization.cfg files.

Standard Patch Collection

Performance Patches

  • CachyOS patches: Performance optimizations and scheduling improvements
  • Sunlight Linux patches: System call optimizations and I/O improvements
  • Zen patches: Desktop responsiveness and latency reduction
  • Clear Linux patches: Intel-optimized performance improvements

Hardware Support

  • Mesa patches: GPU driver improvements
  • Raspberry Pi patches: ARM-specific optimizations

Memory Management

  • zblock allocator: Compressed memory block allocation
  • PTE batching: Page table entry batching for performance
  • ZRAM improvements: Enhanced swap compression

Filesystem Patches

  • F2FS patches: Flash-friendly filesystem optimizations
  • XFS fixes: XFS filesystem bug fixes and improvements

Patch Sources

This repository aggregates patches from the following upstream sources:

Main Sources

Additional Sources

Tools and Utilities

Main Build Tools

  • kernel-builder.sh: Unified build interface for all kernel build operations
  • CachyMod: Interactive CachyOS kernel builder with pre-configured variants
  • TKG Installer: Interactive TUI for Frogging-Family package management
  • PKGBUILD System: Arch Linux package build system for catgirl edition

Recommended External Tools

  • patchutils - Collection of programs for manipulating patch files
  • modprobed-db - Track kernel modules for minimal builds
  • gum - Required for CachyMod interactive configuration
  • fzf - Required for TKG installer TUI mode

Included Utilities

  • sort-modprobed-dbs: Sort and merge modprobed-db files
  • zramswap: ZRAM swap configuration utility
  • compile.sh: Standard kernel compilation script
  • config.sh: Kernel configuration helper
  • fetch.sh: Automated patch fetching
  • trim.sh: Patch processing and trimming

Contributing

See CONTRIBUTING.md for guidelines on contributing patches and improvements.

License

See LICENSE for details.

Merged Repositories

This repository combines functionality from:

  1. Original Linux-Kernel-Patches: Curated patch collection organized by kernel version
  2. linux-catgirl-edition (Ven0m0/linux-catgirl-edition): Aggressive optimization build system with PKGBUILD
  3. cachymod (marioroy/cachymod): Interactive CachyOS kernel builder with scheduler variants
  4. tkginstaller (damachine/tkginstaller): TKG package management and TUI

The merge provides a unified interface for all kernel building needs, from patch management to optimized builds.

Disclaimer

Important: These patches and build configurations are provided as-is. Always test in a safe environment before applying to production systems. Kernel modifications can potentially cause system instability.

Catgirl Edition Warning: The aggressive optimizations in catgirl edition (especially memory zero-init disabling, stack protections removal) may introduce security risks. Only use these optimizations if you understand the tradeoffs.

CachyMod Note: CachyMod is designed for CachyOS. While it may work on other Arch-based distributions, optimal performance and compatibility are guaranteed on CachyOS. Ensure you have the required dependencies installed.

TKG Packages: Frogging-Family TKG packages are customizable and may require specific hardware or software configurations. Review customization.cfg files before building.

Support

For issues or questions:

Version Compatibility

Each directory (6.12, 6.15, etc.) contains patches specifically tested for that kernel version. Patches may not apply cleanly to other kernel versions without modification.

Catgirl Edition: Currently configured for kernel 6.17.x (see build/catgirl-edition/PKGBUILD) CachyMod: Currently configured for kernel 6.18 (see build/cachymod/6.18/) TKG Packages: Support varies by package; check Frogging-Family repositories for details

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages