Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

marchy 🚀

A generic, high-performance Arch Linux x86_64 package & kernel builder for macOS (Apple Silicon & Intel) and Linux, powered by Docker / Podman and Apple's Rosetta 2 Linux translation.


💡 Motivation

"I have a blazing-fast Apple Silicon MacBook (and high-spec workstations), but much slower Linux ThinkPads and mini PCs where compiling a custom Linux kernel (or heavy AUR packages) was taking ages."

Compiling heavy C/C++/Rust packages (like custom Linux kernels with BORE scheduler, ZFS, or LLVM) on lower-power x86 laptops can take hours. marchy turns your fast Mac or powerful Linux server into a dedicated remote build farm. It compiles x86_64 packages at near-native speeds, packages them into a pacman repository, and serves or deploys them directly over your local network.


✨ Features & Optimizations

  • 🍏 macOS Apple Silicon & Linux Support:
    • macOS: Runs x86_64 containers with native Rosetta 2 translation via OrbStack or Docker Desktop.
    • Linux: Runs natively on x86_64 hosts or via QEMU/binfmt on ARM64 Linux servers.
    • Supports both docker and podman engines seamlessly.
  • Native Virtual Disk I/O: Syncs sources to internal container ext4 storage to avoid slow host-guest file sharing overhead during large builds.
  • 💾 Persistent Source Caching (SRCDEST): Preserves large kernel source tarballs (marchy-sources volume) across builds so you don't re-download 150MB+ archives.
  • Persistent Ccache Support: Pre-configured 25GB compiler cache (marchy-ccache volume) accelerating repeated C/C++ builds.
  • 🌐 Automatic Fast Mirrors (reflector): Dynamically benchmarks and ranks fastest HTTPS Arch package mirrors for maximum download speeds.
  • 🚀 Direct SSH Deployment (deploy): Upload, install via pacman -U, and optionally reboot remote ThinkPads/mini PCs in a single command.
  • 🗄️ Pacman Repository Auto-Generation (--repo): Automatically creates and updates custom.db.tar.zst repository database for your built packages.
  • 🌐 Built-in HTTP Repository Server (serve): One-command local web server with ready-to-paste /etc/pacman.conf snippet for clients.
  • 🔔 Universal Desktop Notifications: Sends alerts on macOS (Notification Center) and Linux (notify-send) upon build completion or failure.
  • 📝 Live Build Logging: Streams output live while capturing complete logs to ./dist/build_<id>.log.
  • 🎛️ Kernel menuconfig Integration: Launch make menuconfig before compilation with --menuconfig.
  • 🔑 Automatic PGP Key Import: Automatically parses validpgpkeys from PKGBUILD and imports them into the GPG keyring.

📋 Prerequisites


🚀 Quick Start

1. Install marchy into PATH

Clone this repository and run:

# Automatic self-install to /usr/local/bin (or specify custom dir like ~/.local/bin)
./marchy install

# Or manual symlink:
sudo ln -sf "$PWD/marchy" /usr/local/bin/marchy

2. Initialize Builder Container

marchy init

Builds the marchy-builder container image and configures base-devel, ccache, reflector, and compilation tuning.


📖 Usage Examples

1. Build linux-omarchy-bore Kernel

Option A: Directly from Git (Single Command)

marchy git https://github.com/kwilczynski/omarchy-kernels.git linux-omarchy-bore -o ./dist

Option B: Build with Pacman Repository Database Generation

marchy git https://github.com/kwilczynski/omarchy-kernels.git linux-omarchy-bore -o ./dist --repo omarchy

This produces linux-omarchy-bore-*.pkg.tar.zst and generates omarchy.db.tar.zst.

Option C: Interactive Kernel menuconfig before build

marchy build ./linux-omarchy-bore --menuconfig -o ./dist

2. Build Packages from AUR

marchy aur yay-bin -o ./dist

3. Direct SSH Deployment to ThinkPads / Mini PCs

Instead of manually copying files, push and install packages directly over SSH:

# Upload and auto-install on remote machine:
marchy deploy user@thinkpad --install -o ./dist

# Upload, install kernel + headers, and auto-reboot:
marchy deploy user@thinkpad --install --reboot -o ./dist

4. Hosting a Temporary Pacman Repository

Serve built packages over HTTP to any Arch Linux machine on your local network:

# Serves ./dist on port 8080 (default)
marchy serve ./dist 8080

marchy will automatically detect your host LAN IP address and display the exact copy-paste config:

=== 🚀 Temporary Pacman Repository Server ===
Serving Directory: /path/to/dist
Local URL:         http://<YOUR_LOCAL_IP>:8080/ or http://hostname.local:8080/

Add this repository block to /etc/pacman.conf on your Arch Linux machine:
--------------------------------------------------------
[omarchy]
SigLevel = Optional TrustAll
Server = http://<YOUR_LOCAL_IP>:8080/
--------------------------------------------------------

Then on your Arch Linux machine, run:
  sudo pacman -Syu
  sudo pacman -S linux-omarchy-bore linux-omarchy-bore-headers

5. Interactive Shell & Maintenance

# Drop into bash shell inside builder container
marchy shell

# Update pacman packages and rebuild builder image
marchy update

# Clean build caches and named volumes
marchy clean

⚙️ Options Reference

Flag Description Default
-o, --out <dir> Output folder for .pkg.tar.zst packages Source directory
-r, --repo [name] Generate/update a pacman repo database (name.db.tar.zst) Disabled
-i, --install Automatically install on remote host (deploy command) false
--reboot Reboot remote machine after installation (deploy command) false
--menuconfig Run make menuconfig before compilation Disabled
--arch <arch> Architecture (amd64 or arm64) amd64
--engine <engine> Container engine (docker or podman) Auto-detected
--skippgpcheck Skip PGP signature checks false
--no-extract Skip extraction (incremental rebuilds) false
--no-ccache Disable compiler caching false
--no-notify Disable desktop notification on finish false
--rebuild-image Force rebuild of container image false

About

Fast Arch Linux x86_64 package & kernel builder for macOS Apple Silicon powered by Rosetta 2

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages