Review: enroll keeps foreign db keys, configurable paths, on-demand eac-run, launcher ebuild, db dedupe tool
This commit is contained in:
@@ -4,10 +4,10 @@ Repackages the CachyOS Easy Anti-Cheat Linux v2 boot chain unchanged:
|
||||
|
||||
| From CachyOS | Installed to |
|
||||
|---|---|
|
||||
| `linux-cachyos-eac` (kernel + signed modules) | `/lib/modules/<ver>-cachyos-eac/` (kernel at `vmlinuz`) |
|
||||
| `linux-cachyos-eac` (kernel + signed modules) | `<modules>/<ver>-cachyos-eac/` (kernel at `vmlinuz`); `<modules>` is kmod's `module_directory`, `/lib/modules` on Gentoo |
|
||||
| `systemd-boot-cachyos-signed` | `/usr/lib/cachyos-eac/systemd-bootx64.efi.signed` |
|
||||
| `cachyos-eac-signing-key` (CachyOS EAC CA) | `/usr/share/cachyos-eac/`, `/var/lib/sbctl/keys/custom/db/` |
|
||||
| `eac-status` from `cachyos-settings` | `/usr/sbin/eac-status` (ESP lookup patched to `eac-boot esp`) |
|
||||
| `eac-status` from `cachyos-settings` | `/usr/sbin/eac-status` (ESP, kernel and loader paths patched to ask `eac-boot`) |
|
||||
|
||||
The kernel is not handled by installkernel or uefi-mkconfig, and nothing is
|
||||
re-signed. A second signature, or a kernel started without the CachyOS-signed
|
||||
@@ -17,37 +17,57 @@ systemd-boot, fails the EAC checks.
|
||||
|
||||
| Command | Does |
|
||||
|---|---|
|
||||
| `eac-boot enroll` | rewrites the Secure Boot db as: your sbctl db key, the Microsoft certificates, the CachyOS EAC CA |
|
||||
| `eac-boot setup [bootnum]` | `update`, then creates the `CachyOS EAC` firmware entry and puts it at the end of BootOrder; `bootnum` (4 hex digits) replaces the entry with that number |
|
||||
| `eac-boot enroll` | appends the CachyOS EAC CA to the Secure Boot db, signed with your KEK; every other entry stays |
|
||||
| `eac-boot setup [bootnum]` | `update`, then creates the firmware entry and puts it at the end of BootOrder; `bootnum` (4 hex digits) replaces the entry with that number |
|
||||
| `eac-boot update` | dracut initramfs, kernel and systemd-boot to the ESP, writes the loader entry |
|
||||
| `eac-boot boot` | sets BootNext to the EAC entry and reboots |
|
||||
| `eac-boot cmdline` | prints the EAC entry's kernel command line |
|
||||
| `eac-boot esp` | prints the ESP mount point |
|
||||
| `eac-boot boot` | starts the EAC entry once (BootNext, and systemd-boot's one-shot entry) and reboots |
|
||||
| `eac-boot cmdline`, `esp`, `kernel-dir`, `loader` | print the command line and the paths in use |
|
||||
|
||||
ESP layout (same as CachyOS with Limine, which `eac-status` checks):
|
||||
ESP layout with the defaults:
|
||||
|
||||
```
|
||||
<esp>/<machine-id>/linux-cachyos-eac/{vmlinuz,initramfs}
|
||||
<esp>/EFI/cachyos-eac/systemd-bootx64.efi
|
||||
<esp>/<machine-id>/linux-cachyos-eac/{vmlinuz,initramfs} KERNEL_DIR
|
||||
<esp>/EFI/cachyos-eac/systemd-bootx64.efi LOADER_DIR
|
||||
<esp>/loader/entries/cachyos-eac.conf ENTRY
|
||||
<esp>/loader/loader.conf
|
||||
<esp>/loader/entries/cachyos-eac.conf
|
||||
```
|
||||
|
||||
Settings:
|
||||
`<esp>/loader/` is where every systemd-boot looks, whatever its own directory.
|
||||
If the ESP already has a `loader.conf` from another systemd-boot, it is kept;
|
||||
`eac-boot boot` then picks the EAC entry through `LoaderEntryOneShot`.
|
||||
|
||||
- `EAC_ESP`: ESP mount point. Default: the first vfat mount of `/efi`, `/boot/efi`, `/boot`.
|
||||
- `/etc/kernel/cmdline`: base kernel command line. Default: `/proc/cmdline`.
|
||||
The EAC options are appended.
|
||||
## Settings: `/etc/eac-boot.conf`
|
||||
|
||||
Shell `KEY=value` lines, all optional:
|
||||
|
||||
| Key | Default |
|
||||
| --- | --- |
|
||||
| `ESP` | first vfat mount of `/efi`, `/boot/efi`, `/boot` |
|
||||
| `KERNEL_DIR` | `<machine-id>/linux-cachyos-eac` (relative to the ESP) |
|
||||
| `LOADER_DIR` | `EFI/cachyos-eac` (relative to the ESP) |
|
||||
| `ENTRY` | `cachyos-eac.conf` |
|
||||
| `LABEL` | `CachyOS EAC` (firmware entry name) |
|
||||
| `CMDLINE` | `/etc/kernel/cmdline`, else `/proc/cmdline`; the EAC options are appended |
|
||||
| `MODULES_DIR` | kmod's `module_directory` |
|
||||
| `KEK_KEY`, `KEK_CERT` | `KEK/KEK.key`, `KEK/KEK.pem` in sbctl's `keydir` (`/etc/sbctl/sbctl.conf`, default `/var/lib/sbctl/keys`) |
|
||||
| `OWNER_GUID` | sbctl's GUID file, else random |
|
||||
|
||||
`eac-status` checks the kernel only under `KERNEL_DIR` and the loader only
|
||||
under `LOADER_DIR`, and expects the kernel modules where kmod looks for them.
|
||||
|
||||
After the first `setup`, every package update runs `eac-boot update` from
|
||||
`pkg_postinst`.
|
||||
`pkg_postinst`. Changing `KERNEL_DIR`, `LOADER_DIR`, `ENTRY` or `LABEL` after
|
||||
`setup` leaves the old files and firmware entry behind: remove them by hand.
|
||||
|
||||
## One-time setup
|
||||
|
||||
1. `eac-boot enroll`: the db needs your own `Database Key`, the Microsoft
|
||||
certificates and `CachyOS EAC CA`. It is written with your sbctl KEK, so
|
||||
Setup Mode is not needed. Do not use `sbctl enroll-keys --append`: it adds
|
||||
every key again, and the firmware keeps the duplicates.
|
||||
1. `eac-boot enroll`: appends `CachyOS EAC CA` to db with an authenticated
|
||||
write signed by your KEK, so Setup Mode is not needed and nothing else in
|
||||
db changes: your own keys, Microsoft's and any other vendor's stay. Run it
|
||||
again and it sees the CA and does nothing. Do not use
|
||||
`sbctl enroll-keys --append`: it re-adds sbctl's keys and the Microsoft
|
||||
certificates, and the firmware keeps the duplicates. To remove duplicates
|
||||
that are already there, see the troubleshooting doc.
|
||||
`sbctl list-enrolled-keys` prints the issuer of each certificate, so some
|
||||
names appear twice in a correct db.
|
||||
2. Your normal kernels must be signed with the sbctl db key. With `USE=secureboot`
|
||||
|
||||
Reference in New Issue
Block a user