agentleFS
bmcszkbmcszk/agent-skills/skills/arch-linux-cachyos/SKILL.md

arch-linux-cachyos

Skill1 starsChanged 2 months agoMITView on GitHub

Arch Linux / CachyOS administration. Pacman, mkinitcpio, Limine, Btrfs, amdgpu, gamescope, Sunshine/Moonlight, kernel management. Verified against official man pages, CachyOS wiki, and actual binaries on disk — not from memory.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    No need to edit /etc/default/limine, /boot/limine.conf, or write hooks

    line 63
  2. Very specific:

    Use the CachyOS Kernel Manager GUI (cachyos-kernel-manager) or:

    line 69
  3. Very specific:

    Add to mkinitcpio: FILES=(/lib/firmware/edid/monitor.bin) in /etc/mkinitcpio.conf

    line 127
  4. Very specific:

    Add kernel params: drm.edid_firmware=HDMI-A-1:edid/monitor.bin video=HDMI-A-1:e

    line 128
  5. Very specific:

    signal-cli is a JVM app: If Java is missing, the daemon cannot start and loops in activating (auto-restart) — Hermes gateway then shows …

    line 234

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Arch Linux / CachyOS Administration

This file is intentionally machine-agnostic. Machine-specific data (hostname, hardware specs, kernel versions) lives in per-host files (e.g. ./vecna.md) at the project root.

Always verify against the listed source before relying on anything. Training data goes stale; the docs do not. Use context7 and searxng skills for online verification.

Hard constraints (from user feedback)

  1. AI agent must not invoke sudo directly. Scripts that need root use sudo internally.
  2. All fix scripts must be idempotent (safe to re-run).
  3. User wants 300% certainty on kernel/bootloader changes. Investigate online; check the actual binary; verify the fix ran.
  4. Avoid kernel panic risk. Kernel cmdline and initramfs changes are the highest-risk surface.
  5. Read existing skills before acting. ls .agents/skills/ and use find_skills from the global set.

Pacman / pacman.conf

IgnorePkg placement (the #1 recurring bug)

IgnorePkg MUST be in the [options] section. Anywhere else (end of file, [multilib], etc.) → pacman prints directive 'IgnorePkg' in section '<name>' not recognized and silently ignores it.

  • Source: pacman.conf(5) — https://man.archlinux.org/man/pacman.conf.5.en
  • Separator: space, not comma
  • Validation: pacman-conf IgnorePkg (same parser pacman uses)
  • The CachyOS default pacman.conf has a commented #IgnorePkg = in [options] — uncomment and populate that line

Removing the running kernel is safe

Per ArchWiki/Reddit: "It is safe to remove either [kernel] as long as you have another kernel installed that you can boot into." The running kernel stays in memory; only disk files are removed.

IgnorePkg does not block removal

Per pacman.conf(5): IgnorePkg only affects --sysupgrade (upgrades), not --remove. So pacman -Rns works even on IgnorePkg'd packages.

Kernel switching (the SIMPLE way)

To switch default kernel: just remove the one you don't want.

# Verify the kernel you want to keep has boot files:
sudo ls /boot/vmlinuz-linux-cachyos-lts /boot/initramfs-linux-cachyos-lts.img

# Remove the other kernel — pacman hooks auto-regenerate /boot/limine.conf
sudo pacman -Rns linux-cachyos linux-cachyos-headers

# Reboot into the remaining kernel
sudo reboot

Why this works:

  1. Pacman hooks (60-limine-mkinitcpio-remove-pre.hook + 90-limine-mkinitcpio-remove-post.hook) fire on kernel package removal and call limine-mkinitcpio-remove which regenerates /boot/limine.conf with only the remaining kernel
  2. The limine-entry-tool template hardcodes default_entry: 2 — after removing the non-LTS kernel, the limine.conf structure is /+CachyOS (entry 1 = directory) → //linux-cachyos-lts (entry 2 = the only kernel). So default_entry: 2 naturally points to LTS
  3. No need to edit /etc/default/limine, /boot/limine.conf, or write hooks

Do NOT overcomplicate this with: BOOT_ORDER changes, default_entry hooks, custom post-install scripts, /etc/boot/hooks/post.d/ entries. All of those were tried and failed. The pacman hooks are designed for exactly this use case.

Installing a new kernel

Use the CachyOS Kernel Manager GUI (cachyos-kernel-manager) or:

sudo pacman -S linux-cachyos-lts linux-cachyos-lts-headers
sudo mkinitcpio -P    # regenerate all initramfs

Limine bootloader

Architecture

/etc/default/limine           → user-editable source (KERNEL_CMDLINE, BOOT_ORDER, ESP_PATH)
                                          │
                              sudo limine-update
                                          │
                                          ▼
/boot/limine.conf (vfat)      → regenerated from /etc/default/limine + limine-entry-tool template
                                          │
                              /etc/boot/hooks/post.d/*  (run after regeneration)

Key facts

FactSource
/etc/default/limine is the user-editable sourceCachyOS wiki: wiki.cachyos.org/configuration/boot_manager_configuration/
/boot/limine.conf is regenerated by sudo limine-updateLocal limine-update binary
limine-entry-tool template hardcodes default_entry: 2strings /usr/lib/limine/limine-entry-tool
default_entry accepts numeric (1) or path (CachyOS/linux-cachyos-lts)Limine CONFIG.md: codeberg.org/Limine/Limine/raw/branch/trunk/CONFIG.md
/etc/boot/hooks/post.d/ scripts run after limine regenlimine-common-functions → run_boot_hooks post
Hooks must be executable and not end in .disabledrun_boot_hooks() in limine-common-functions

default_entry: 2 explained

The CachyOS limine.conf structure is:

/+CachyOS              # Entry 1 (OS directory)
//linux-cachyos        # Entry 2 (kernel under the OS dir)
//linux-cachyos-lts    # Entry 3 (another kernel, if installed)

default_entry: 2 always points to the FIRST kernel entry (under the OS directory). If you remove the non-LTS kernel, entry 2 becomes linux-cachyos-lts. So default_entry: 2 naturally works.

BOOT_ORDER in /etc/default/limine

Controls the ORDER of kernel entries written to /boot/limine.conf. Glob patterns: *lts, *fallback, *, Snapshots. Does NOT control which entry is the default — that's default_entry in /boot/limine.conf.

/boot is vfat with restrictive permissions

/boot is mounted with fmask=0077,dmask=0077 — only root can read/write. All scripts that touch /boot/limine.conf need sudo.

mkinitcpio

EDID firmware injection pattern

To make a connector always report "connected" (for headless/Sunshine use):

  1. Extract EDID from a real monitor: /sys/class/drm/card1-HDMI-A-1/edid → /lib/firmware/edid/monitor.bin
  2. Add to mkinitcpio: FILES=(/lib/firmware/edid/monitor.bin) in /etc/mkinitcpio.conf
  3. Add kernel params: drm.edid_firmware=HDMI-A-1:edid/monitor.bin video=HDMI-A-1:e
  4. sudo mkinitcpio -P && sudo limine-update
  5. Verify: lsinitcpio /boot/initramfs-linux-cachyos-lts.img | grep edid

amdgpu in MODULES=()

Early-loads amdgpu in initramfs so KMS + EDID injection work at mode-set time, before userspace starts.

CachyOS kernels

KernelBaseStabilityUse case
linux-cachyoslatest stable (7.0.x)Bleeding edgeDefault if unsure; has AutoFDO
linux-cachyos-ltslongterm (6.18.x)"Minimally patched for maximum stability"Stable fallback; fewer regressions
linux-cachyos-deckifylatest stableHandheld-specific patchesCachyOS Handheld ISO default

Source: wiki.cachyos.org/features/kernel

LTS vs main: what you lose

  • AutoFDO + Propeller (main only): 1-5% on kernel-heavy benchmarks; negligible for GPU-bound gaming
  • Newest BORE patches (main only): marginal scheduler tuning
  • Color Pipeline API for HW HDR (6.19+): only if using HDR over HDMI
  • New amdgpu features: sometimes new features, sometimes new regressions

What you keep on LTS: BORE scheduler, CachyOS base patchset, full 890M/Zen 5/NPU support (all in tree since 6.8/6.6).

Display / compositor issues

KWin doesn't re-enable display after gamescope teardown

On kernel 7.0.12, KWin may leave HDMI-A-1 in enabled: disabled, dpms: Off after gamescope exits. Symptoms: black screen after "Switch to Desktop" in Steam Big Picture.

Workaround: qdbus6 org.kde.KWin /KWin org.kde.KWin.replace (restarts KWin, re-detects outputs)

Fix: switch to linux-cachyos-lts (older amdgpu display-handoff code is more stable)

Steam "Switch to Desktop" in Big Picture

Steam's legacy path calls steamos-session-select plasma which:

  1. Sets autologin to plasma.desktop via pkexec
  2. Shuts down Steam
  3. Stops gamescope-session.target

The cachyos-gamescope-autologin.service then reverts autologin to gamescope-session.desktop on every desktop login. Use steamos-session-select persistent to mask this behavior.

Sunshine autostart

Sunshine's systemd user service (app-dev.lizardbyte.app.Sunshine.service) must be enabled to autostart:

systemctl --user enable app-dev.lizardbyte.app.Sunshine.service

The service has ExecStartPre=/bin/sleep 5 to avoid racing with KWin.

Canonical validation commands

pacman-conf IgnorePkg                    # what pacman will actually respect
uname -r                                  # running kernel
pacman -Q | grep ^linux-cachyos           # installed kernels
sudo ls /boot/vmlinuz-* /boot/initramfs-* # boot files present?
lsinitcpio /boot/initramfs-linux-cachyos-lts.img | grep edid  # EDID in initramfs?
sudo grep default_entry /boot/limine.conf # what will limine boot?
cat /sys/class/drm/card1-HDMI-A-1/enabled # display output active?
cat /sys/class/drm/card1-HDMI-A-1/dpms    # display powered?

References

  • references/electron-gamescope-fix.md — Electron apps (Discord, Heroic) in gamescope-session: root causes (Electron-Wayland, shortcuts.vdf not repointed, CompatToolMapping force-pin to proton), automated fix flow, restart requirement, verification commands, pitfalls (binary VDF needs python-vdf, userdata placeholder 0/, grep -q too broad), rollback.

Fix-script index (in /home/blaze/scripts/)

IssueScriptNotes
Gamescope crashes on monitor disconnectbuild-gamescope-patched.sh → install-gamescope-patched.shRun build as blaze (not root); install with sudo
IgnorePkg in wrong sectionfix-pacman-ignorepkg.shMoves to [options], validates with pacman-conf
Monitor off → gamescope sees no displayfix-virtual-display-edid.shSaves EDID to initramfs + kernel cmdline
Install both kernels + Strix boot paramsfix-boot-safe.shIdempotent: amdgpu MODULES, dcdebugmask=0x412, PCIe AER
Electron apps (Discord, Heroic, …) silently fail in gamescope-sessionfix-electron-gamescope.shPer-app --ozone-platform=x11 wrapper + repoints Steam shortcut + clears CompatToolMapping force-pin. Rolls back with rollback-electron-gamescope.sh. Details: references/electron-gamescope-fix.md
Rollback everything to stockrevert-all-changes.shDestructive, no confirmation
Rollback gamescope patch onlyrollback-gamescope-patch.shReinstalls repo gamescope
Rollback EDID injection onlyrollback-virtual-display-edid.shRemoves EDID from initramfs + cmdline
Disk cleanupclean-all.shpacman, cargo, docker, flatpak, etc.
signal-cli daemon dead (hermes Signal gateway)(no script — manual)Java missing → see "signal-cli / Java" below

Top pitfalls (learned the hard way)

#PitfallDetectionFix
1IgnorePkg in wrong section → silently ignoredpacman-conf IgnorePkg returns emptyfix-pacman-ignorepkg.sh
2Overcomplicating kernel switch with BOOT_ORDER/default_entry hooksSystem boots wrong kernel despite config changesJust pacman -Rns the unwanted kernel; hooks auto-regen limine.conf
3Can't remove running kernel (pacman -Rns refuses)pacman error messageIt doesn't refuse — it's safe. The running kernel stays in memory.
4KWin doesn't re-enable display after gamescope teardowncat /sys/class/drm/card1-HDMI-A-1/enabled = disabledqdbus6 org.kde.KWin /KWin org.kde.KWin.replace or switch to LTS
5Building gamescope as rootmakepkg errorRun as blaze, not root
6Writing scripts from memory without verifying onlineScript has subtle bugs (wrong sed patterns, wrong bash conditions)Use context7 + searxng skills; read actual man pages and binaries
7cachyos-gamescope-autologin.service reverts desktop autologinDesktop reverts to gamescope after rebootsteamos-session-select persistent
8Electron app (Discord, Heroic, …) silent no-window in gamescope-sessionTHREE layered causes: (a) gamescope doesn't expose Wayland socket → Electron 27+ needs --ozone-platform=x11; (b) Steam shortcut still points at raw binary / is force-pinned to proton (can't run ELF); (c) Steam's overlay LD_PRELOAD=gameoverlayrenderer.so crashes Electron 42+ zygote (FATAL zygote_host_impl_linux.cc:207). Manual terminal tests never reproduce (c) — your shell lacks the injected preload.fix-electron-gamescope.sh handles all three; verify with exact Steam env (see references/electron-gamescope-fix.md Failure D)
9signal-cli-daemon.service loops in activating (auto-restart) forever, Hermes Signal gateway shows "cannot reach signal-cli at http://127.0.0.1:41511"journalctl --user -u signal-cli-daemon → JAVA_HOME is not set and no 'java' command could be found in your PATHInstall jre-openjdk-headless, then sudo archlinux-java status → patch service with Environment=JAVA_HOME=<path>
10Steam shortcut pointing at Linux-native ELF (e.g. Heroic) still goes through proton-cachyos-slr — proton can't run an ELF, exits in ~4 s, Steam shows "Preparing launch" forever, user sees black screen + spinner. Force-pin lives in ~/.steam/steam/config/config.vdf → CompatToolMapping keyed by appid (Heroic = 2385805048)grep -B1 'proton-cachyos-slr' ~/.steam/steam/config/config.vdffix-electron-gamescope.sh strips the bad CompatToolMapping entry, AND repoints the shortcut in userdata/<id>/config/shortcuts.vdf to call the wrapper directly. Steam restart required to apply.
11Steam userdata/ has a placeholder 0/ dir with no real shortcuts; iterating userdata/*/config naively picks the placeholder first and patches a non-existent fileFirst for cfg in /home/blaze/.steam/steam/userdata/*/config picks 0/Require dirname >= 1 AND shortcuts.vdf must exist before patching
12Trying to pkill -9 -f 'gamescope|steam' from a non-root terminal to force Steam reload takes out the user's own shell with no recovery (Operation not permitted on plasmalogin-helper, but SIGKILL propagates via signal mask).pkill returns Operation not permitted for root PIDs AND the calling shell exits with -9Use systemctl --user restart gamescope-session.target — plasmalogin-autologin respawns gamescope + Steam cleanly with new PIDs reading fresh config

signal-cli / Java (Hermes Signal gateway)

signal-cli is a JVM app. If Java is missing, the daemon cannot start and loops in activating (auto-restart) — Hermes gateway then shows cannot reach signal-cli at http://127.0.0.1:41511.

Diagnosis

systemctl --user status signal-cli-daemon
journalctl --user -u signal-cli-daemon --no-pager -n 20
# look for: ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH

Fix

sudo pacman -S jre-openjdk-headless
sudo archlinux-java status                     # discover installed JVM path
# → typically /usr/lib/jvm/java-21-openjdk

# Patch the user service to set JAVA_HOME
sed -i '/Environment=SIGNAL_CLI_DATA_DIR=/i Environment=JAVA_HOME=/usr/lib/jvm/java-21-openjdk' \
    ~/.config/systemd/user/signal-cli-daemon.service

systemctl --user daemon-reload
systemctl --user restart signal-cli-daemon
systemctl --user status signal-cli-daemon

Hermes gateway reconnects automatically every ~300s on retry. To force it now, restart the gateway container.

Reference URLs

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.