Install this version:
emerge -a =sys-kernel/cachyos-sources-7.1.8
If this version is masked, you can unmask it using the autounmask tool or standard emerge options:
autounmask =sys-kernel/cachyos-sources-7.1.8
Or alternatively:
emerge --autounmask-write -a =sys-kernel/cachyos-sources-7.1.8
| Version | EAPI | Keywords | Slot |
|---|---|---|---|
| 7.1.8 | 8 | ~amd64 |
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="8"
ETYPE="sources"
K_WANT_GENPATCHES="base extras"
K_GENPATCHES_VER="11"
K_SECURITY_UNSUPPORTED="1"
DESCRIPTION="Linux kernel sources with CachyOS patches, optionally with cjktty"
HOMEPAGE="
https://cachyos.org
https://github.com/CachyOS/linux
https://github.com/CachyOS/kernel-patches
https://github.com/gentoo-zh/cjktty-patches
"
CJKTTY_PV="7.1.7"
inherit check-reqs kernel-2 cjktty
detect_version
detect_arch
CACHYOS_RELEASE="1"
CACHYOS_SERIES="${KV_MAJOR}.${KV_MINOR}"
CACHYOS_SRC="cachyos-${PV}-${CACHYOS_RELEASE}"
CACHYOS_PATCH_URI="https://raw.githubusercontent.com/CachyOS/kernel-patches/master/${CACHYOS_SERIES}"
EXTRAVERSION="-cachyos${CACHYOS_RELEASE}"
KV_FULL="${PV}${EXTRAVERSION}"
KV="${KV_FULL}"
SRC_URI+="
https://github.com/CachyOS/linux/releases/download/${CACHYOS_SRC}/${CACHYOS_SRC}.tar.gz
-> ${P}.tar.gz
${GENPATCHES_URI}
bore? (
${CACHYOS_PATCH_URI}/sched/0001-bore-cachy.patch
-> ${P}-0001-bore-cachy.patch
)
prjc? (
${CACHYOS_PATCH_URI}/sched/0001-prjc-cachy.patch
-> ${P}-0001-prjc-cachy.patch
)
prjc-lfbmq? (
${CACHYOS_PATCH_URI}/sched/0001-prjc-cachy-lfbmq.patch
-> ${P}-0001-prjc-cachy-lfbmq.patch
)
${CACHYOS_PATCH_URI}/misc/0001-acpi-call.patch
-> ${P}-0001-acpi-call.patch
${CACHYOS_PATCH_URI}/misc/0001-aufs-7.1-merge-v20260713.patch
-> ${P}-0001-aufs.patch
${CACHYOS_PATCH_URI}/misc/0001-clang-polly.patch
-> ${P}-0001-clang-polly.patch
${CACHYOS_PATCH_URI}/misc/0001-handheld.patch
-> ${P}-0001-handheld.patch
rt? (
${CACHYOS_PATCH_URI}/misc/0001-rt-i915.patch
-> ${P}-0001-rt-i915.patch
)
${CACHYOS_PATCH_URI}/misc/dkms-clang.patch
-> ${P}-dkms-clang.patch
"
S="${WORKDIR}/linux-${KV_FULL}"
LICENSE+=" GPL-2"
KEYWORDS="~amd64"
IUSE+=" +bore cjk prjc prjc-lfbmq rt thin"
REQUIRED_USE+=" ?? ( bore prjc prjc-lfbmq )"
RDEPEND="
thin? (
llvm-core/clang
llvm-core/lld
)
"
apply_gentoo_genpatches() {
# genpatches must be the series that carries this point release, or the
# Gentoo fixes below were written against a different tree.
[[ -n $(find "${WORKDIR}" -maxdepth 1 -type f -name "10*linux-${PV}.patch" -print -quit) ]] ||
die "genpatches-${CACHYOS_SERIES}-${K_GENPATCHES_VER} predates ${PV}; raise K_GENPATCHES_VER"
# CachyOS already ships the full ${PV} tree, so skip genpatches stable bumps
# (10*_linux-*.patch). Also drop any listed fix already present in CachyOS.
find "${WORKDIR}" -maxdepth 1 -type f \
\( -name '10*linux*patch' \
-o -name '2700_drm-amdgpu-fix-check-in-amdgpu-hmm-invalidate-gfx.patch' \) \
-delete ||
die "Failed to delete obsolete genpatches"
local gentoo_patches=( "${WORKDIR}"/*.patch )
[[ -e ${gentoo_patches[0]} ]] ||
die "No Gentoo genpatches left to apply"
eapply "${gentoo_patches[@]}"
}
apply_cachyos_patches() {
local cachyos_patches=()
if use bore; then
cachyos_patches+=( "${DISTDIR}/${P}-0001-bore-cachy.patch" )
elif use prjc; then
cachyos_patches+=( "${DISTDIR}/${P}-0001-prjc-cachy.patch" )
elif use prjc-lfbmq; then
cachyos_patches+=( "${DISTDIR}/${P}-0001-prjc-cachy-lfbmq.patch" )
fi
cachyos_patches+=(
"${DISTDIR}/${P}-0001-acpi-call.patch"
"${DISTDIR}/${P}-0001-aufs.patch"
"${DISTDIR}/${P}-0001-clang-polly.patch"
"${DISTDIR}/${P}-0001-handheld.patch"
)
use rt && cachyos_patches+=( "${DISTDIR}/${P}-0001-rt-i915.patch" )
cachyos_patches+=( "${DISTDIR}/${P}-dkms-clang.patch" )
eapply "${cachyos_patches[@]}"
}
pkg_pretend() {
CHECKREQS_DISK_BUILD="4G"
check-reqs_pkg_pretend
}
pkg_setup() {
ewarn
ewarn "${PN} is *not* supported by the Gentoo Kernel Project in any way."
ewarn "For support, contact https://github.com/gentoo-zh/overlay or the CachyOS developers."
ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
ewarn "the ebuilds. Thank you."
ewarn
kernel-2_pkg_setup
}
src_unpack() {
local genpatches_type
unpack "${P}.tar.gz"
mv "${WORKDIR}/${CACHYOS_SRC}" "${S}" ||
die "Failed to rename CachyOS source directory"
for genpatches_type in ${K_WANT_GENPATCHES}; do
unpack "genpatches-${CACHYOS_SERIES}-${K_GENPATCHES_VER}.${genpatches_type}.tar.xz"
done
}
src_prepare() {
if use thin; then
cp "${FILESDIR}/${PN}-cachyos-thin.config" \
"${S}/kernel/configs/cachyos-thin.config" || die
fi
rm -f "${S}/tools/testing/selftests/tc-testing/action-ebpf" || die
apply_gentoo_genpatches
apply_cachyos_patches
cjktty_apply_patches
eapply_user
sed -i -e "s:^\(EXTRAVERSION =\).*:\1 ${EXTRAVERSION}:" \
"${S}/Makefile" || die
sed -i -e 's:#export\tINSTALL_PATH:export\tINSTALL_PATH:' \
"${S}/Makefile" || die
}
pkg_postinst() {
kernel-2_pkg_postinst
elog "For more information about CachyOS kernels, see https://wiki.cachyos.org/features/kernel/."
if use thin; then
elog "USE=thin installed kernel/configs/cachyos-thin.config."
elog "To merge it into an existing kernel .config, run from /usr/src/linux-${KV_FULL}:"
elog " make LLVM=1 LLVM_IAS=1 CC=clang LD=ld.lld cachyos-thin.config olddefconfig"
elog "Build the kernel with the same LLVM=1 LLVM_IAS=1 CC=clang LD=ld.lld arguments."
fi
}
pkg_postrm() {
kernel-2_pkg_postrm
}
Manage flags for this package:
euse -i <flag> -p sys-kernel/cachyos-sources |
euse -E <flag> -p sys-kernel/cachyos-sources |
euse -D <flag> -p sys-kernel/cachyos-sources