Skip to content

Commit

Permalink
chore: Adjust stable kernel PKGBUILDs for 6.12
Browse files Browse the repository at this point in the history
Sync changes from `linux-cachyos-rc/PKGBUILD` to all stable kernel PKGBUILDs where applicable.

Signed-off-by: Eric Naim <[email protected]>
  • Loading branch information
1Naim committed Nov 14, 2024
1 parent d236e17 commit 9b3f8a3
Show file tree
Hide file tree
Showing 7 changed files with 203 additions and 210 deletions.
59 changes: 29 additions & 30 deletions linux-cachyos-bmq/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ _cachy_config=${_cachy_config-y}
# 'bore' - select 'Burst-Oriented Response Enhancer'
# 'bmq' - select 'BMQ Scheduler'
# 'hardened' - select 'BORE Scheduler hardened' ## kernel with hardened config and hardening patches with the bore scheduler
# 'cachyos' - select 'Sched-Ext Scheduler Framework Variant Scheduler with BORE Scheduler'
# 'cachyos' - select 'CachyOS Default Scheduler (BORE)'
# 'eevdf' - select 'EEVDF Scheduler'
# 'rt' - select EEVDF, but includes a series of realtime patches
# 'rt-bore' - select Burst-Oriented Response Enhancer, but includes a series of realtime patches
# 'sched-ext' - select 'sched-ext' Scheduler, based on EEVDF
_cpusched=${_cpusched-bmq}

### Tweak kernel options prior to a build via nconfig
Expand Down Expand Up @@ -146,6 +145,12 @@ _build_nvidia_open=${_build_nvidia_open-}
# Build a debug package with non-stripped vmlinux
_build_debug=${_build_debug-}

# ATTENTION: Do not modify after this line
_is_clang_kernel() {
[[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] || [ -n "$_use_kcfi" ]
return $?
}

if [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] && [ "$_use_lto_suffix" = "y" ]; then
_pkgsuffix="cachyos-${_cpusched}-lto"
elif [ "$_use_llvm_lto" = "none" ] && [ -z "$_use_kcfi" ] && [ "$_use_gcc_suffix" = "y" ]; then
Expand All @@ -155,13 +160,13 @@ else
fi

pkgbase="linux-$_pkgsuffix"
_major=6.11
_minor=7
_major=6.12
_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 @@ -197,7 +202,7 @@ source=(
"${_patchsource}/all/0001-cachyos-base-all.patch")

# LLVM makedepends
if [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] || [ -n "$_use_kcfi" ]; then
if _is_clang_kernel; then
makedepends+=(clang llvm lld)
source+=("${_patchsource}/misc/dkms-clang.patch")
BUILD_FLAGS=(
Expand All @@ -216,45 +221,37 @@ fi
# ZFS support
if [ -n "$_build_zfs" ]; then
makedepends+=(git)
source+=("git+https://github.com/cachyos/zfs.git#commit=baa50314567afd986a00838f0fa65fdacbd12daf")
source+=("git+https://github.com/cachyos/zfs.git#commit=965343f1141aeb38aa7f8bb8f27f82278b87db6e")
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/0006-nvidia-drm-Set-FOP_UNSIGNED_OFFSET-for-nv_drm_fops.f.patch")
fi

if [ -n "$_build_nvidia_open" ]; then
source+=("nvidia-open-${_nv_ver}.tar.gz::https://github.com/NVIDIA/open-gpu-kernel-modules/archive/refs/tags/${_nv_ver}.tar.gz"
"${_patchsource}/misc/nvidia/0001-Make-modeset-and-fbdev-default-enabled.patch"
"${_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/0006-silence-event-assert-until-570.patch"
"${_patchsource}/misc/nvidia/0009-fix-hdmi-names.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/0006-nvidia-drm-Set-FOP_UNSIGNED_OFFSET-for-nv_drm_fops.f.patch")
fi

## List of CachyOS schedulers
case "$_cpusched" in
cachyos) # CachyOS Scheduler (Sched-ext + BORE + Cachy Sauce)
source+=("${_patchsource}/sched/0001-sched-ext.patch"
"${_patchsource}/sched/0001-bore-cachy-ext.patch");;
bore) ## BORE Scheduler
cachyos|bore) # CachyOS Scheduler (BORE)
source+=("${_patchsource}/sched/0001-bore-cachy.patch");;
bmq) ## Project C Scheduler
source+=("${_patchsource}/sched/0001-prjc-cachy.patch");;
eevdf) ## 6.12 EEVDF patches
source+=("${_patchsource}/sched/0001-eevdf-next.patch");;
rt) ## EEVDF with RT patches
source+=("${_patchsource}/misc/0001-rt.patch");;
rt-bore) ## RT with BORE Scheduler
source+=("${_patchsource}/misc/0001-rt.patch"
"${_patchsource}/sched/0001-bore-cachy-rt.patch");;
source+=("${_patchsource}/sched/0001-bore-cachy-rt.patch");;
hardened) ## Hardened Patches with BORE Scheduler
source+=("${_patchsource}/sched/0001-bore-cachy.patch"
"${_patchsource}/misc/0001-hardened.patch");;
sched-ext) ## SCHED-EXT
source+=("${_patchsource}/sched/0001-sched-ext.patch");;
esac

export KBUILD_BUILD_HOST=cachyos
Expand Down Expand Up @@ -315,13 +312,11 @@ prepare() {
[ -z "$_cpusched" ] && _die "The value is empty. Choose the correct one again."

case "$_cpusched" in
cachyos) scripts/config -e SCHED_CLASS_EXT -e SCHED_BORE;;
bore|hardened) scripts/config -e SCHED_BORE;;
cachyos|bore|hardened) scripts/config -e SCHED_BORE;;
bmq) scripts/config -e SCHED_ALT -e SCHED_BMQ;;
eevdf) ;;
rt) scripts/config -e PREEMPT_COUNT -e PREEMPTION -d PREEMPT_VOLUNTARY -d PREEMPT -d PREEMPT_NONE -d PREEMPT_RT -d PREEMPT_DYNAMIC -e PREEMPT_BUILD -e PREEMPT_BUILD_AUTO -e PREEMPT_AUTO;;
rt-bore) scripts/config -e SCHED_BORE -e PREEMPT_COUNT -e PREEMPTION -d PREEMPT_VOLUNTARY -d PREEMPT -d PREEMPT_NONE -d PREEMPT_RT -d PREEMPT_DYNAMIC -e PREEMPT_BUILD -e PREEMPT_BUILD_AUTO -e PREEMPT_AUTO;;
sched-ext) scripts/config -e SCHED_CLASS_EXT;;
*) _die "The value $_cpusched is invalid. Choose the correct one again.";;
esac

Expand Down Expand Up @@ -530,18 +525,22 @@ prepare() {

# Use fbdev and modeset as default
patch -Np1 -i "${srcdir}/0001-Make-modeset-and-fbdev-default-enabled.patch" -d "${srcdir}/${_nv_pkg}/kernel"
# Fix for 6.12
patch -Np2 -i "${srcdir}/0006-nvidia-drm-Set-FOP_UNSIGNED_OFFSET-for-nv_drm_fops.f.patch" -d "${srcdir}/${_nv_pkg}/kernel"
fi

if [ -n "$_build_nvidia_open" ]; then
patch -Np1 -i "${srcdir}/0001-Make-modeset-and-fbdev-default-enabled.patch" -d "${srcdir}/${_nv_open_pkg}/kernel-open"
# 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 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}/0006-silence-event-assert-until-570.patch" -d "${srcdir}/${_nv_open_pkg}"
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}/0009-fix-hdmi-names.patch" -d "${srcdir}/${_nv_open_pkg}"
patch -Np1 --no-backup-if-mismatch -i "${srcdir}/0005-nvkms-Sanitize-trim-ELD-product-name-strings.patch" -d "${srcdir}/${_nv_open_pkg}"
# Add fix for 6.12 Display Open issue
patch -Np1 --no-backup-if-mismatch -i "${srcdir}/0006-nvidia-drm-Set-FOP_UNSIGNED_OFFSET-for-nv_drm_fops.f.patch" -d "${srcdir}/${_nv_open_pkg}"
fi
}

Expand Down
59 changes: 29 additions & 30 deletions linux-cachyos-bore/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ _cachy_config=${_cachy_config-y}
# 'bore' - select 'Burst-Oriented Response Enhancer'
# 'bmq' - select 'BMQ Scheduler'
# 'hardened' - select 'BORE Scheduler hardened' ## kernel with hardened config and hardening patches with the bore scheduler
# 'cachyos' - select 'Sched-Ext Scheduler Framework Variant Scheduler with BORE Scheduler'
# 'cachyos' - select 'CachyOS Default Scheduler (BORE)'
# 'eevdf' - select 'EEVDF Scheduler'
# 'rt' - select EEVDF, but includes a series of realtime patches
# 'rt-bore' - select Burst-Oriented Response Enhancer, but includes a series of realtime patches
# 'sched-ext' - select 'sched-ext' Scheduler, based on EEVDF
_cpusched=${_cpusched-bore}

### Tweak kernel options prior to a build via nconfig
Expand Down Expand Up @@ -146,6 +145,12 @@ _build_nvidia_open=${_build_nvidia_open-}
# Build a debug package with non-stripped vmlinux
_build_debug=${_build_debug-}

# ATTENTION: Do not modify after this line
_is_clang_kernel() {
[[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] || [ -n "$_use_kcfi" ]
return $?
}

if [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] && [ "$_use_lto_suffix" = "y" ]; then
_pkgsuffix="cachyos-${_cpusched}-lto"
elif [ "$_use_llvm_lto" = "none" ] && [ -z "$_use_kcfi" ] && [ "$_use_gcc_suffix" = "y" ]; then
Expand All @@ -155,13 +160,13 @@ else
fi

pkgbase="linux-$_pkgsuffix"
_major=6.11
_minor=7
_major=6.12
_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 @@ -197,7 +202,7 @@ source=(
"${_patchsource}/all/0001-cachyos-base-all.patch")

# LLVM makedepends
if [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] || [ -n "$_use_kcfi" ]; then
if _is_clang_kernel; then
makedepends+=(clang llvm lld)
source+=("${_patchsource}/misc/dkms-clang.patch")
BUILD_FLAGS=(
Expand All @@ -216,45 +221,37 @@ fi
# ZFS support
if [ -n "$_build_zfs" ]; then
makedepends+=(git)
source+=("git+https://github.com/cachyos/zfs.git#commit=baa50314567afd986a00838f0fa65fdacbd12daf")
source+=("git+https://github.com/cachyos/zfs.git#commit=965343f1141aeb38aa7f8bb8f27f82278b87db6e")
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/0006-nvidia-drm-Set-FOP_UNSIGNED_OFFSET-for-nv_drm_fops.f.patch")
fi

if [ -n "$_build_nvidia_open" ]; then
source+=("nvidia-open-${_nv_ver}.tar.gz::https://github.com/NVIDIA/open-gpu-kernel-modules/archive/refs/tags/${_nv_ver}.tar.gz"
"${_patchsource}/misc/nvidia/0001-Make-modeset-and-fbdev-default-enabled.patch"
"${_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/0006-silence-event-assert-until-570.patch"
"${_patchsource}/misc/nvidia/0009-fix-hdmi-names.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/0006-nvidia-drm-Set-FOP_UNSIGNED_OFFSET-for-nv_drm_fops.f.patch")
fi

## List of CachyOS schedulers
case "$_cpusched" in
cachyos) # CachyOS Scheduler (Sched-ext + BORE + Cachy Sauce)
source+=("${_patchsource}/sched/0001-sched-ext.patch"
"${_patchsource}/sched/0001-bore-cachy-ext.patch");;
bore) ## BORE Scheduler
cachyos|bore) # CachyOS Scheduler (BORE)
source+=("${_patchsource}/sched/0001-bore-cachy.patch");;
bmq) ## Project C Scheduler
source+=("${_patchsource}/sched/0001-prjc-cachy.patch");;
eevdf) ## 6.12 EEVDF patches
source+=("${_patchsource}/sched/0001-eevdf-next.patch");;
rt) ## EEVDF with RT patches
source+=("${_patchsource}/misc/0001-rt.patch");;
rt-bore) ## RT with BORE Scheduler
source+=("${_patchsource}/misc/0001-rt.patch"
"${_patchsource}/sched/0001-bore-cachy-rt.patch");;
source+=("${_patchsource}/sched/0001-bore-cachy-rt.patch");;
hardened) ## Hardened Patches with BORE Scheduler
source+=("${_patchsource}/sched/0001-bore-cachy.patch"
"${_patchsource}/misc/0001-hardened.patch");;
sched-ext) ## SCHED-EXT
source+=("${_patchsource}/sched/0001-sched-ext.patch");;
esac

export KBUILD_BUILD_HOST=cachyos
Expand Down Expand Up @@ -315,13 +312,11 @@ prepare() {
[ -z "$_cpusched" ] && _die "The value is empty. Choose the correct one again."

case "$_cpusched" in
cachyos) scripts/config -e SCHED_CLASS_EXT -e SCHED_BORE;;
bore|hardened) scripts/config -e SCHED_BORE;;
cachyos|bore|hardened) scripts/config -e SCHED_BORE;;
bmq) scripts/config -e SCHED_ALT -e SCHED_BMQ;;
eevdf) ;;
rt) scripts/config -e PREEMPT_COUNT -e PREEMPTION -d PREEMPT_VOLUNTARY -d PREEMPT -d PREEMPT_NONE -d PREEMPT_RT -d PREEMPT_DYNAMIC -e PREEMPT_BUILD -e PREEMPT_BUILD_AUTO -e PREEMPT_AUTO;;
rt-bore) scripts/config -e SCHED_BORE -e PREEMPT_COUNT -e PREEMPTION -d PREEMPT_VOLUNTARY -d PREEMPT -d PREEMPT_NONE -d PREEMPT_RT -d PREEMPT_DYNAMIC -e PREEMPT_BUILD -e PREEMPT_BUILD_AUTO -e PREEMPT_AUTO;;
sched-ext) scripts/config -e SCHED_CLASS_EXT;;
*) _die "The value $_cpusched is invalid. Choose the correct one again.";;
esac

Expand Down Expand Up @@ -530,18 +525,22 @@ prepare() {

# Use fbdev and modeset as default
patch -Np1 -i "${srcdir}/0001-Make-modeset-and-fbdev-default-enabled.patch" -d "${srcdir}/${_nv_pkg}/kernel"
# Fix for 6.12
patch -Np2 -i "${srcdir}/0006-nvidia-drm-Set-FOP_UNSIGNED_OFFSET-for-nv_drm_fops.f.patch" -d "${srcdir}/${_nv_pkg}/kernel"
fi

if [ -n "$_build_nvidia_open" ]; then
patch -Np1 -i "${srcdir}/0001-Make-modeset-and-fbdev-default-enabled.patch" -d "${srcdir}/${_nv_open_pkg}/kernel-open"
# 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 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}/0006-silence-event-assert-until-570.patch" -d "${srcdir}/${_nv_open_pkg}"
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}/0009-fix-hdmi-names.patch" -d "${srcdir}/${_nv_open_pkg}"
patch -Np1 --no-backup-if-mismatch -i "${srcdir}/0005-nvkms-Sanitize-trim-ELD-product-name-strings.patch" -d "${srcdir}/${_nv_open_pkg}"
# Add fix for 6.12 Display Open issue
patch -Np1 --no-backup-if-mismatch -i "${srcdir}/0006-nvidia-drm-Set-FOP_UNSIGNED_OFFSET-for-nv_drm_fops.f.patch" -d "${srcdir}/${_nv_open_pkg}"
fi
}

Expand Down
Loading

0 comments on commit 9b3f8a3

Please sign in to comment.