Skip to content

Commit

Permalink
chore: Sync stable PKGBUILDs and config to 6.13
Browse files Browse the repository at this point in the history
linux-cachyos-bmq and linux-cachyos-hardened are not updated for now because no existing 6.13 patchset
has been created yet.

Signed-off-by: Eric Naim <[email protected]>
  • Loading branch information
1Naim committed Jan 16, 2025
1 parent 26263aa commit 14a7b4e
Show file tree
Hide file tree
Showing 12 changed files with 4,851 additions and 442 deletions.
77 changes: 57 additions & 20 deletions linux-cachyos-bore/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ _per_gov=${_per_gov-}
### Enable TCP_CONG_BBR3
_tcp_bbr3=${_tcp_bbr3-}

### Running with a 1000HZ, 750Hz, 625Hz, 600 Hz, 500Hz, 300Hz, 250Hz and 100Hz tick rate
### Running with a 1000HZ, 750Hz, 600 Hz, 500Hz, 300Hz, 250Hz and 100Hz tick rate
_HZ_ticks=${_HZ_ticks-1000}

## Choose between perodic, idle or full
### Full tickless can give higher performances in various cases but, depending on hardware, lower consistency.
_tickrate=${_tickrate-full}

## Choose between full(low-latency), voluntary or server
## Choose between full(low-latency), lazy, voluntary or none
_preempt=${_preempt-full}

### Transparent Hugepages
Expand Down Expand Up @@ -157,13 +157,13 @@ else
fi

pkgbase="linux-$_pkgsuffix"
_major=6.12
_minor=9
_major=6.13
_minor=0
#_minorc=$((_minor+1))
#_rcver=rc8
pkgver=${_major}.${_minor}
_stable=${_major}.${_minor}
#_stable=${_major}
#_stable=${_major}.${_minor}
_stable=${_major}
#_stablerc=${_major}-${_rcver}
_srcname=linux-${_stable}
#_srcname=linux-${_major}
Expand Down Expand Up @@ -224,7 +224,10 @@ fi
# NVIDIA pre-build module support
if [ -n "$_build_nvidia" ]; then
source+=("https://us.download.nvidia.com/XFree86/Linux-x86_64/${_nv_ver}/${_nv_pkg}.run"
"${_patchsource}/misc/nvidia/0001-Make-modeset-and-fbdev-default-enabled.patch")
"${_patchsource}/misc/nvidia/0001-Make-modeset-and-fbdev-default-enabled.patch"
"${_patchsource}/misc/nvidia/0008-Kbuild-Use-absolute-paths-for-symbolic-links.patch"
"${_patchsource}/misc/nvidia/0009-FROM-AOSC-Use-linux-aperture.c-for-removing-conflict.patch"
"${_patchsource}/misc/nvidia/0010-FROM-AOSC-TTM-fbdev-emulation-for-Linux-6.13.patch")
fi

if [ -n "$_build_nvidia_open" ]; then
Expand All @@ -233,7 +236,12 @@ if [ -n "$_build_nvidia_open" ]; then
"${_patchsource}/misc/nvidia/0002-Do-not-error-on-unkown-CPU-Type-and-add-Zen5-support.patch"
"${_patchsource}/misc/nvidia/0003-Add-IBT-Support.patch"
"${_patchsource}/misc/nvidia/0004-silence-event-assert-until-570.patch"
"${_patchsource}/misc/nvidia/0005-nvkms-Sanitize-trim-ELD-product-name-strings.patch")
"${_patchsource}/misc/nvidia/0005-nvkms-Sanitize-trim-ELD-product-name-strings.patch"
"${_patchsource}/misc/nvidia/0006-crypto-Add-fix-for-6.13-Module-compilation.patch"
"${_patchsource}/misc/nvidia/0007-nvidia-nv-Convert-symbol-namespace-to-string-literal.patch"
"${_patchsource}/misc/nvidia/0008-Kbuild-Use-absolute-paths-for-symbolic-links.patch"
"${_patchsource}/misc/nvidia/0009-FROM-AOSC-Use-linux-aperture.c-for-removing-conflict.patch"
"${_patchsource}/misc/nvidia/0010-FROM-AOSC-TTM-fbdev-emulation-for-Linux-6.13.patch")
fi

## List of CachyOS schedulers
Expand All @@ -244,10 +252,8 @@ case "$_cpusched" in
source+=("${_patchsource}/sched/0001-prjc-cachy.patch");;
hardened) ## Hardened Patches
source+=("${_patchsource}/misc/0001-hardened.patch");;
rt) ## EEVDF with RT patches
source+=("${_patchsource}/misc/0001-rt.patch");;
rt-bore) ## RT with BORE Scheduler
source+=("${_patchsource}/misc/0001-rt.patch");;
rt|rt-bore) ## RT patches
source+=("${_patchsource}/misc/0001-rt-i915.patch");;
esac

export KBUILD_BUILD_HOST=cachyos
Expand Down Expand Up @@ -311,8 +317,8 @@ prepare() {
cachyos|bore|hardened) scripts/config -e SCHED_BORE;;
bmq) scripts/config -e SCHED_ALT -e SCHED_BMQ;;
eevdf) ;;
rt) scripts/config -d PREEMPT -d PREEMPT_DYNAMIC -e PREEMPT_RT;;
rt-bore) scripts/config -e SCHED_BORE -d PREEMPT -d PREEMPT_DYNAMIC -e PREEMPT_RT;;
rt) scripts/config -e PREEMPT_RT;;
rt-bore) scripts/config -e SCHED_BORE -e PREEMPT_RT;;
*) _die "The value $_cpusched is invalid. Choose the correct one again.";;
esac

Expand All @@ -328,8 +334,8 @@ prepare() {
[ -z "$_use_llvm_lto" ] && _die "The value is empty. Choose the correct one again."

case "$_use_llvm_lto" in
thin) scripts/config -e LTO -e LTO_CLANG -e ARCH_SUPPORTS_LTO_CLANG -e ARCH_SUPPORTS_LTO_CLANG_THIN -d LTO_NONE -e HAS_LTO_CLANG -d LTO_CLANG_FULL -e LTO_CLANG_THIN -e HAVE_GCC_PLUGINS;;
full) scripts/config -e LTO -e LTO_CLANG -e ARCH_SUPPORTS_LTO_CLANG -e ARCH_SUPPORTS_LTO_CLANG_THIN -d LTO_NONE -e HAS_LTO_CLANG -e LTO_CLANG_FULL -d LTO_CLANG_THIN -e HAVE_GCC_PLUGINS;;
thin) scripts/config -e LTO_CLANG_THIN;;
full) scripts/config -e LTO_CLANG_FULL;;
none) scripts/config -e LTO_NONE;;
*) _die "The value '$_use_llvm_lto' is invalid. Choose the correct one again.";;
esac
Expand All @@ -340,7 +346,7 @@ prepare() {
[ -z "$_HZ_ticks" ] && _die "The value is empty. Choose the correct one again."

case "$_HZ_ticks" in
100|250|500|600|625|750|1000)
100|250|500|600|750|1000)
scripts/config -d HZ_300 -e "HZ_${_HZ_ticks}" --set-val HZ "${_HZ_ticks}";;
300)
scripts/config -e HZ_300 --set-val HZ 300;;
Expand Down Expand Up @@ -394,9 +400,10 @@ prepare() {
[ -z "$_preempt" ] && _die "The value is empty. Choose the correct one again."

case "$_preempt" in
full) scripts/config -e PREEMPT_BUILD -d PREEMPT_NONE -d PREEMPT_VOLUNTARY -e PREEMPT -e PREEMPT_COUNT -e PREEMPTION -e PREEMPT_DYNAMIC;;
voluntary) scripts/config -e PREEMPT_BUILD -d PREEMPT_NONE -e PREEMPT_VOLUNTARY -d PREEMPT -e PREEMPT_COUNT -e PREEMPTION -d PREEMPT_DYNAMIC;;
server) scripts/config -e PREEMPT_NONE_BUILD -e PREEMPT_NONE -d PREEMPT_VOLUNTARY -d PREEMPT -d PREEMPTION -d PREEMPT_DYNAMIC;;
full) scripts/config -e PREEMPT_DYNAMIC -e PREEMPT -d PREEMPT_VOLUNTARY -d PREEMPT_LAZY -d PREEMPT_NONE;;
lazy) scripts/config -e PREEMPT_DYNAMIC -d PREEMPT -d PREEMPT_VOLUNTARY -e PREEMPT_LAZY -d PREEMPT_NONE;;
voluntary) scripts/config -d PREEMPT_DYNAMIC -d PREEMPT -e PREEMPT_VOLUNTARY -d PREEMPT_LAZY -d PREEMPT_NONE;;
none) scripts/config -d PREEMPT_DYNAMIC -d PREEMPT -d PREEMPT_VOLUNTARY -d PREEMPT_LAZY -e PREEMPT_NONE;;
*) _die "The value '$_preempt' is invalid. Choose the correct one again.";;
esac

Expand Down Expand Up @@ -514,18 +521,48 @@ prepare() {

# Use fbdev and modeset as default
patch -Np1 -i "${srcdir}/0001-Make-modeset-and-fbdev-default-enabled.patch" -d "${srcdir}/${_nv_pkg}/kernel"

# https://github.com/NVIDIA/open-gpu-kernel-modules/issues/747
patch -Np2 -i "${srcdir}/0008-Kbuild-Use-absolute-paths-for-symbolic-links.patch" -d "${srcdir}/${_nv_pkg}/kernel"

# Fixes fbdev on 6.13+
# https://github.com/NVIDIA/open-gpu-kernel-modules/issues/749
# https://gist.github.com/xtexChooser/da92d9df902788b75f746f348552ae80
patch -Np2 -i "${srcdir}/0009-FROM-AOSC-Use-linux-aperture.c-for-removing-conflict.patch" -d "${srcdir}/${_nv_pkg}/kernel"
patch -Np2 -i "${srcdir}/0010-FROM-AOSC-TTM-fbdev-emulation-for-Linux-6.13.patch" -d "${srcdir}/${_nv_pkg}/kernel"
fi

if [ -n "$_build_nvidia_open" ]; then
# Use fbdev and modeset as default
patch -Np1 -i "${srcdir}/0001-Make-modeset-and-fbdev-default-enabled.patch" -d "${srcdir}/${_nv_open_pkg}/kernel-open"

# Fix for Zen5 error print in dmesg
patch -Np1 --no-backup-if-mismatch -i "${srcdir}/0002-Do-not-error-on-unkown-CPU-Type-and-add-Zen5-support.patch" -d "${srcdir}/${_nv_open_pkg}"

# Fix for https://bugs.archlinux.org/task/74886
patch -Np1 --no-backup-if-mismatch -i "${srcdir}/0003-Add-IBT-Support.patch" -d "${srcdir}/${_nv_open_pkg}"

# Fix for CS2 dmesg spam
patch -Np1 --no-backup-if-mismatch -i "${srcdir}/0004-silence-event-assert-until-570.patch" -d "${srcdir}/${_nv_open_pkg}"

# Fix for HDMI names
patch -Np1 --no-backup-if-mismatch -i "${srcdir}/0005-nvkms-Sanitize-trim-ELD-product-name-strings.patch" -d "${srcdir}/${_nv_open_pkg}"

# Fix build errors on 6.13+
# https://github.com/NVIDIA/open-gpu-kernel-modules/issues/746
patch -Np1 --no-backup-if-mismatch -i "${srcdir}/0006-crypto-Add-fix-for-6.13-Module-compilation.patch" -d "${srcdir}/${_nv_open_pkg}"

# https://github.com/NVIDIA/open-gpu-kernel-modules/issues/751
patch -Np1 --no-backup-if-mismatch -i "${srcdir}/0007-nvidia-nv-Convert-symbol-namespace-to-string-literal.patch" -d "${srcdir}/${_nv_open_pkg}"

# https://github.com/NVIDIA/open-gpu-kernel-modules/issues/747
patch -Np1 --no-backup-if-mismatch -i "${srcdir}/0008-Kbuild-Use-absolute-paths-for-symbolic-links.patch" -d "${srcdir}/${_nv_open_pkg}"

# Fixes fbdev on 6.13+
# https://github.com/NVIDIA/open-gpu-kernel-modules/issues/749
# https://gist.github.com/xtexChooser/da92d9df902788b75f746f348552ae80
patch -Np1 --no-backup-if-mismatch -i "${srcdir}/0009-FROM-AOSC-Use-linux-aperture.c-for-removing-conflict.patch" -d "${srcdir}/${_nv_open_pkg}"
patch -Np1 --no-backup-if-mismatch -i "${srcdir}/0010-FROM-AOSC-TTM-fbdev-emulation-for-Linux-6.13.patch" -d "${srcdir}/${_nv_open_pkg}"
fi
}

Expand Down
Loading

0 comments on commit 14a7b4e

Please sign in to comment.