Review: enroll keeps foreign db keys, configurable paths, on-demand eac-run, launcher ebuild, db dedupe tool

This commit is contained in:
2026-12-04 08:35:52 +01:00
parent dec92adb08
commit 7cf69ae701
18 changed files with 509 additions and 122 deletions
+72 -38
View File
@@ -49,10 +49,11 @@ doas -n sbctl status # Installed, Setup Mode di
rc-service elogind status; pgrep -x polkitd
df -h /efi # >= 200 MB free
efibootmgr # note BootOrder and Boot0201
emerge -p sys-kernel/cachyos-eac-kernel-bin sys-apps/eac-openrc-compat sys-auth/hyprpolkitagent
emerge -p sys-kernel/cachyos-eac-kernel-bin sys-apps/eac-openrc-compat \
games-util/epic-games-launcher-bin sys-auth/hyprpolkitagent
```
`emerge -p` must resolve both packages from `febuild`. If `febuild` lacks them,
`emerge -p` must resolve the three packages from `febuild`. If `febuild` lacks them,
add `overlay/` from this repository as a repository in
`/etc/portage/repos.conf/eac-gentoo-openrc.conf` (`location` = absolute path of
`overlay/`). Missing keywords: `~amd64` in `package.accept_keywords`.
@@ -62,9 +63,14 @@ add `overlay/` from this repository as a repository in
```sh
doas -n install -m644 host/portage/package.use/intel-microcode /etc/portage/package.use/
doas -n emerge sys-firmware/intel-microcode sys-kernel/cachyos-eac-kernel-bin \
sys-apps/eac-openrc-compat sys-auth/hyprpolkitagent
sys-apps/eac-openrc-compat games-util/epic-games-launcher-bin sys-auth/hyprpolkitagent
```
The launcher package replaces a downloaded AppImage; delete
`~/Downloads/EpicGamesLauncher-x86_64.AppImage` once the package works. Both
use the same data directory (`~/.local/share/com.epicgames.eglv2`), so logins
and installed games stay.
On lucifer the USE flag already sits in `/etc/portage/package.use/sys-fimware`;
skip the copy there. `intel-microcode` with `dist-kernel` reinstalls the normal
kernel, which is harmless.
@@ -73,12 +79,14 @@ Check:
```sh
ls /lib/modules/*-cachyos-eac/vmlinuz /usr/lib/cachyos-eac/systemd-bootx64.efi.signed
eac-boot esp # /efi
qfile /usr/bin/systemctl /usr/bin/systemd-run /usr/lib64/libsystemd.so.0
eac-boot esp; eac-boot kernel-dir; eac-boot loader # /efi, /efi/<machine-id>/linux-cachyos-eac, /efi/EFI/cachyos-eac/...
qfile /usr/bin/systemctl /usr/bin/systemd-run /usr/bin/eac-run /usr/lib64/libsystemd.so.0
ldd /opt/epic-games-launcher/bin/EpicGamesLauncher | grep 'not found' # empty
ldd /usr/libexec/hyprpolkitagent | grep 'not found' # empty
```
Libraries reported "not found" for hyprpolkitagent mean a live (`9999`) Hyprland
lucifer uses every `eac-boot` default, so it has no `/etc/eac-boot.conf`; do
not create one. Libraries reported "not found" for hyprpolkitagent mean a live (`9999`) Hyprland
library changed its SONAME: rebuild the packages that link the old one
(`emerge -1`), see troubleshooting.
@@ -98,16 +106,23 @@ doas -n openssl x509 -in /var/lib/sbctl/keys/KEK/KEK.pem -outform DER | sha256su
doas -n python3 tools/efi-sig-list.py $V/KEK-8be4df61-93ca-11d2-aa0d-00e098032b8c
```
The KEK fingerprint must appear in the script's list. Then:
The KEK fingerprint must appear in the script's list (`eac-boot enroll`
checks this as well and refuses otherwise). List db before and after:
```sh
doas -n python3 tools/efi-sig-list.py $V/db-d719b2cb-3d3a-4596-a3bc-dad00e67656f
doas -n eac-boot enroll
doas -n python3 tools/efi-sig-list.py $V/db-d719b2cb-3d3a-4596-a3bc-dad00e67656f
```
Expected: `7 entries, 7 unique`: Database Key (sbctl), Windows Production PCA
2011, Windows UEFI CA 2023, Microsoft Corporation UEFI CA 2011, Microsoft UEFI
CA 2023, Microsoft Option ROM UEFI CA 2023, CachyOS EAC CA.
`enroll` only appends the CachyOS EAC CA: every entry from the first listing
must still be there, plus the CA. When the CA is already enrolled it prints
"nothing to do" and writes nothing. On lucifer the CA is enrolled; expected
db: `7 entries, 7 unique`: Database Key (sbctl), Windows Production PCA 2011,
Windows UEFI CA 2023, Microsoft Corporation UEFI CA 2011, Microsoft UEFI CA
2023, Microsoft Option ROM UEFI CA 2023, CachyOS EAC CA. Duplicates in the
first listing are a separate problem: report them to the user, do not fix
them here (see troubleshooting).
`sbctl list-enrolled-keys` prints issuers, so two Microsoft names appear twice
there; that is correct.
@@ -157,24 +172,41 @@ ls -l /dev/dri/igpu
In `~/.config/hypr/env.lua`: `hl.env("AQ_DRM_DEVICES", "/dev/dri/igpu")`.
In `~/.config/hypr/autocmds.lua`, inside `hl.on("hyprland.start", function () ... end)`:
The polkit agent is the only addition to the session autostart. In
`~/.config/hypr/autocmds.lua`, inside `hl.on("hyprland.start", function () ... end)`:
```lua
hl.exec_cmd("/usr/libexec/hyprpolkitagent")
hl.exec_cmd("/usr/libexec/eac-openrc-compat/systemd-run-agent")
```
Start both in the running session without a relogin:
Do not autostart `systemd-run-agent` and do not add
`socket-activate.easyanticheat_eos` to a runlevel: `eac-run` starts both when
the launcher starts and stops them when it exits. Remove such lines if an older
setup left them (`grep -n systemd-run-agent ~/.config/hypr/*.lua`,
`rc-update show | grep socket-activate`).
Start the polkit agent in the running session without a relogin, then test
`eac-run` from the session (Hyprland's exec, not ssh, so polkit sees the active
session):
```sh
hyprctl -i 0 dispatch 'hl.dsp.exec_cmd("/usr/libexec/hyprpolkitagent")'
hyprctl -i 0 dispatch 'hl.dsp.exec_cmd("/usr/libexec/eac-openrc-compat/systemd-run-agent")'
ls -l /run/user/1000/systemd-run-agent.sock
systemd-run --user --wait --pipe cat /proc/self/sessionid # must equal the next line
hyprctl -i 0 dispatch 'hl.dsp.exec_cmd("eac-run sleep 20")'
sleep 5
rc-service socket-activate.easyanticheat_eos status # started (once EAC is installed, step 8)
systemd-run --user --wait --pipe cat /proc/self/sessionid # must equal the next line
cat /proc/$(pgrep -x Hyprland)/sessionid
sleep 20
rc-service socket-activate.easyanticheat_eos status # stopped
pgrep -f systemd-run-agent # nothing
```
Polkit check:
No password dialog may appear for `eac-run`: the polkit action
`org.gentoo.eac-openrc-compat.socket-activate` is allowed for the active
session (`pkcheck --action-id org.gentoo.eac-openrc-compat.socket-activate
--process $(pgrep -x Hyprland)` exits 0).
Polkit agent check, during the `eac-run` window:
`systemd-run --user --wait --pipe pkexec --disable-internal-agent /usr/bin/true`.
**(user)** A password dialog must appear; cancel it.
"No authentication agent found" means hyprpolkitagent is not running.
@@ -198,7 +230,10 @@ The next normal reboot returns to Gentoo.
## 8. First game launch (user)
1. **(user)** Start the Epic Games Launcher (AppImage) and Fortnite.
1. **(user)** Start the Epic Games Launcher from the application menu or as
`EpicGamesLauncher` (the package's wrapper runs it through `eac-run`), then
Fortnite. A launcher started any other way (an AppImage, a desktop file of
its own) has to be started as `eac-run <launcher>`.
2. **(user)** Answer "Easy Anti-Cheat service installation required. Install
now?" with Yes and enter the password in the polkit dialog.
@@ -218,22 +253,16 @@ Operation succeeded.
and `/var/lib/easyanticheat_eos/authorizedusers/1000` exists.
## 9. Start the service at boot
## 9. Check a protected game
EAC only runs `systemctl start`; on systemd its `sockets.target.d` drop-in
starts the socket at boot, which OpenRC does not read. Add it to the runlevel:
```sh
doas -n rc-update add socket-activate.easyanticheat_eos default
rc-service socket-activate.easyanticheat_eos status # started
```
## 10. Check a protected game
After the next launch, `/var/log/socket-activate.easyanticheat_eos.log` shows
**(user)** Close the launcher, start it again the same way, join a match.
`eac-run` starts the listener this time (the setup did it on the first launch).
After the launch, `/var/log/socket-activate.easyanticheat_eos.log` shows
`Running service, version ...`, and
`.../AppData/Local/FortniteGame/Saved/Logs/FortniteGame.log` in the Proton
prefix shows `[AntiCheatClient] [BeginSession-...]` when joining a match.
After the launcher exits, `rc-service socket-activate.easyanticheat_eos status`
is `stopped` again. Nothing EAC-related starts at boot.
## Updates
@@ -248,15 +277,19 @@ prefix shows `[AntiCheatClient] [BeginSession-...]` when joining a match.
```sh
pkexec /usr/local/bin/easyanticheat_eos uninstall standalone
doas -n rc-update del socket-activate.easyanticheat_eos default
doas -n efibootmgr -b 0201 -B
doas -n emerge -C sys-apps/eac-openrc-compat sys-kernel/cachyos-eac-kernel-bin
doas -n emerge -C sys-apps/eac-openrc-compat sys-kernel/cachyos-eac-kernel-bin games-util/epic-games-launcher-bin
```
Then remove `/efi/EFI/cachyos-eac`, `/efi/<machine-id>/linux-cachyos-eac` and
`/efi/loader/entries/cachyos-eac.conf`. The unmerge also removed the CA from
`/var/lib/sbctl/keys/custom/db/`; to drop it from the firmware db too, run
`doas -n sbctl enroll-keys --partial db --microsoft --ignore-immutable`.
`/efi/loader/entries/cachyos-eac.conf`.
The CachyOS EAC CA can stay in db: it only lets CachyOS-signed binaries boot.
Never remove it with `sbctl enroll-keys` (that rewrites db and drops every key
sbctl does not manage). To remove it, ask the user, then write back the db
backup from step 2, which predates the CA: the "Duplicate keys in db" recipe in
troubleshooting, with the backup file as input instead of `efi-readvar`'s
output. Keys enrolled after that backup are lost.
## systemd systems
@@ -264,9 +297,10 @@ The compatibility layer exists only because this machine runs OpenRC. On a
systemd system it may work without it (untested):
- **Gentoo with systemd:** install only `cachyos-eac-kernel-bin`
(`eac-openrc-compat` blocks `sys-apps/systemd`). Follow steps 0-5, 7 and 8,
with any polkit agent in the desktop session. Skip the `systemd-run-agent`
lines in step 6 and all of step 9.
and `epic-games-launcher-bin` (`eac-openrc-compat` blocks `sys-apps/systemd`).
Follow steps 0-5 and 7-9, with any polkit agent in the desktop session; skip
the `eac-run` parts of step 6. EAC's own socket unit then starts at boot and
starts the service on demand.
- **Other distributions:** use the distribution's signed kernel if Epic trusts
its key, or CachyOS's own packages and instructions
(wiki.cachyos.org/configuration/easy_anti_cheat). `eac-boot` and the ebuild