# Copyright 2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 MY_PV=${PV/_p/-} MY_KV=${MY_PV}-cachyos-eac SDBOOT_PV=262.2_1-1 KEY_PV=1-2 SETTINGS_PV=1.4.5-1 MIRROR=https://mirror.cachyos.org/repo/x86_64/cachyos DESCRIPTION="CachyOS-signed kernel and systemd-boot for Easy Anti-Cheat Linux v2" HOMEPAGE="https://wiki.cachyos.org/configuration/easy_anti_cheat/" SRC_URI=" ${MIRROR}/linux-cachyos-eac-${MY_PV}-x86_64.pkg.tar.zst ${MIRROR}/systemd-boot-cachyos-signed-${SDBOOT_PV}-x86_64.pkg.tar.zst ${MIRROR}/cachyos-eac-signing-key-${KEY_PV}-any.pkg.tar.zst ${MIRROR}/cachyos-settings-1%3A${SETTINGS_PV}-any.pkg.tar.zst -> cachyos-settings-${SETTINGS_PV}-any.pkg.tar.zst " S=${WORKDIR} LICENSE="GPL-2 LGPL-2.1+ GPL-3+ GPL-1" SLOT="0" KEYWORDS="~amd64" # Stripping or re-signing anything here breaks the CachyOS signatures EAC checks. RESTRICT="mirror strip" RDEPEND=" app-crypt/sbctl app-crypt/sbsigntools app-crypt/tpm2-tools dev-libs/openssl sys-apps/kmod[zstd] sys-boot/efibootmgr sys-kernel/dracut " BDEPEND="app-arch/zstd" src_unpack() { local f for f in ${A}; do tar -xf "${DISTDIR}/${f}" || die "unpacking ${f} failed" done } src_prepare() { default sed -i 's#esp=$(bootctl --print-esp-path 2>/dev/null || echo /boot)#esp=$(eac-boot esp)#' \ usr/bin/eac-status || die grep -q 'esp=$(eac-boot esp)' usr/bin/eac-status || die "eac-status: ESP patch did not apply" } src_install() { dodir /lib/modules cp -a "usr/lib/modules/${MY_KV}" "${ED}/lib/modules/" || die fowners -R root:root "/lib/modules/${MY_KV}" insinto /usr/lib/cachyos-eac doins usr/lib/systemd/boot/efi/systemd-bootx64.efi.signed insinto /usr/share/cachyos-eac doins usr/share/cachyos-eac/cachyos-eac-ca.{crt,der} insinto /var/lib/sbctl/keys/custom/db doins var/lib/sbctl/keys/custom/db/cachyos-eac-ca.der dosbin usr/bin/eac-status "${FILESDIR}"/eac-boot dodoc "${FILESDIR}"/README.md } pkg_postinst() { depmod -b "${EROOT:-/}" "${MY_KV}" || die if [[ -z ${ROOT} && -d $(eac-boot esp 2>/dev/null)/EFI/cachyos-eac ]]; then eac-boot update || ewarn "eac-boot update failed, run it by hand" else elog "First-time setup: eac-boot enroll, eac-boot setup, then enable Secure Boot." elog "Boot it with eac-boot boot and check it with eac-status." elog "Details: README in ${EROOT}/usr/share/doc/${PF}/" fi } pkg_postrm() { # depmod output is not owned by the package [[ -d ${EROOT}/lib/modules/${MY_KV}/kernel ]] || rm -rf "${EROOT}/lib/modules/${MY_KV}" }