Skip to content

Commit

Permalink
Merge pull request #302 from ventureoo/nvidia-patches-refactor
Browse files Browse the repository at this point in the history
Make nvidia patches skip via URL instead of filenames
  • Loading branch information
ptr1337 authored Sep 27, 2024
2 parents 3ff0ac1 + 63cc8b3 commit 8a10d0f
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 231 deletions.
34 changes: 13 additions & 21 deletions linux-cachyos-bmq/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Maintainer: Peter Jung ptr1337 <[email protected]> && Piotr Gorski <[email protected]>
# Maintainer: Peter Jung ptr1337 <[email protected]>
# Maintainer: Piotr Gorski <[email protected]>
# Maintainer: Vasiliy Stelmachenok <[email protected]>
# Contributor: Jan Alexander Steffens (heftig) <[email protected]>
# Contributor: Tobias Powalowski <[email protected]>
# Contributor: Thomas Baechler <[email protected]>
Expand Down Expand Up @@ -269,13 +271,10 @@ prepare() {
local src
for src in "${source[@]}"; do
src="${src%%::*}"
# Skip nvidia patches
[[ "$src" == "${_patchsource}"/misc/nvidia/*.patch ]] && continue
src="${src##*/}"
src="${src%.zst}"
[[ $src = 0001-Make-modeset-and-fbdev-default-enabled.patch ]] && continue
[[ $src = 0002-Do-not-error-on-unkown-CPU-Type-and-add-Zen5-support.patch ]] && continue
[[ $src = 0003-Add-IBT-Support.patch ]] && continue
[[ $src = 0004-6.11-Add-fix-for-fbdev.patch ]] && continue
[[ $src = 0005-6.12-drm_outpull_pill-changed-check.patch ]] && continue
[[ $src = *.patch ]] || continue
echo "Applying patch $src..."
patch -Np1 < "../$src"
Expand Down Expand Up @@ -542,29 +541,22 @@ build() {
make "${BUILD_FLAGS[@]}" -j"$(nproc)" all
make -C tools/bpf/bpftool vmlinux.h feature-clang-bpf-co-re=1

local MODULE_FLAGS=(
KERNEL_UNAME="${_kernuname}"
IGNORE_PREEMPT_RT_PRESENCE=1
SYSSRC="${srcdir}/${_srcname}"
SYSOUT="${srcdir}/${_srcname}"
)
if [ -n "$_build_nvidia" ]; then
local MODULE_FLAGS=(
KERNEL_UNAME="${_kernuname}"
IGNORE_PREEMPT_RT_PRESENCE=1
NV_EXCLUDE_BUILD_MODULES='__EXCLUDE_MODULES'
SYSSRC="${srcdir}/${_srcname}"
SYSOUT="${srcdir}/${_srcname}"
)

MODULE_FLAGS+=(NV_EXCLUDE_BUILD_MODULES='__EXCLUDE_MODULES')
cd "${srcdir}/${_nv_pkg}/kernel"
make "${BUILD_FLAGS[@]}" "${MODULE_FLAGS[@]}" -j"$(nproc)" modules

fi

if [ -n "$_build_nvidia_open" ]; then
cd "${srcdir}/${_nv_open_pkg}"
local MODULE_FLAGS=(
KERNEL_UNAME="${_kernuname}"
IGNORE_PREEMPT_RT_PRESENCE=1
IGNORE_CC_MISMATCH=yes
SYSSRC="${srcdir}/${_srcname}"
SYSOUT="${srcdir}/${_srcname}"
)
MODULE_FLAGS+=(IGNORE_CC_MISMATCH=yes)
CFLAGS= CXXFLAGS= LDFLAGS= make "${BUILD_FLAGS[@]}" "${MODULE_FLAGS[@]}" -j"$(nproc)" modules
fi

Expand Down
34 changes: 13 additions & 21 deletions linux-cachyos-bore/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Maintainer: Peter Jung ptr1337 <[email protected]> && Piotr Gorski <[email protected]>
# Maintainer: Peter Jung ptr1337 <[email protected]>
# Maintainer: Piotr Gorski <[email protected]>
# Maintainer: Vasiliy Stelmachenok <[email protected]>
# Contributor: Jan Alexander Steffens (heftig) <[email protected]>
# Contributor: Tobias Powalowski <[email protected]>
# Contributor: Thomas Baechler <[email protected]>
Expand Down Expand Up @@ -270,13 +272,10 @@ prepare() {
local src
for src in "${source[@]}"; do
src="${src%%::*}"
# Skip nvidia patches
[[ "$src" == "${_patchsource}"/misc/nvidia/*.patch ]] && continue
src="${src##*/}"
src="${src%.zst}"
[[ $src = 0001-Make-modeset-and-fbdev-default-enabled.patch ]] && continue
[[ $src = 0002-Do-not-error-on-unkown-CPU-Type-and-add-Zen5-support.patch ]] && continue
[[ $src = 0003-Add-IBT-Support.patch ]] && continue
[[ $src = 0004-6.11-Add-fix-for-fbdev.patch ]] && continue
[[ $src = 0005-6.12-drm_outpull_pill-changed-check.patch ]] && continue
[[ $src = *.patch ]] || continue
echo "Applying patch $src..."
patch -Np1 < "../$src"
Expand Down Expand Up @@ -543,29 +542,22 @@ build() {
make "${BUILD_FLAGS[@]}" -j"$(nproc)" all
make -C tools/bpf/bpftool vmlinux.h feature-clang-bpf-co-re=1

local MODULE_FLAGS=(
KERNEL_UNAME="${_kernuname}"
IGNORE_PREEMPT_RT_PRESENCE=1
SYSSRC="${srcdir}/${_srcname}"
SYSOUT="${srcdir}/${_srcname}"
)
if [ -n "$_build_nvidia" ]; then
local MODULE_FLAGS=(
KERNEL_UNAME="${_kernuname}"
IGNORE_PREEMPT_RT_PRESENCE=1
NV_EXCLUDE_BUILD_MODULES='__EXCLUDE_MODULES'
SYSSRC="${srcdir}/${_srcname}"
SYSOUT="${srcdir}/${_srcname}"
)

MODULE_FLAGS+=(NV_EXCLUDE_BUILD_MODULES='__EXCLUDE_MODULES')
cd "${srcdir}/${_nv_pkg}/kernel"
make "${BUILD_FLAGS[@]}" "${MODULE_FLAGS[@]}" -j"$(nproc)" modules

fi

if [ -n "$_build_nvidia_open" ]; then
cd "${srcdir}/${_nv_open_pkg}"
local MODULE_FLAGS=(
KERNEL_UNAME="${_kernuname}"
IGNORE_PREEMPT_RT_PRESENCE=1
IGNORE_CC_MISMATCH=yes
SYSSRC="${srcdir}/${_srcname}"
SYSOUT="${srcdir}/${_srcname}"
)
MODULE_FLAGS+=(IGNORE_CC_MISMATCH=yes)
CFLAGS= CXXFLAGS= LDFLAGS= make "${BUILD_FLAGS[@]}" "${MODULE_FLAGS[@]}" -j"$(nproc)" modules
fi

Expand Down
34 changes: 13 additions & 21 deletions linux-cachyos-deckify/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Maintainer: Peter Jung ptr1337 <[email protected]> && Piotr Gorski <[email protected]>
# Maintainer: Peter Jung ptr1337 <[email protected]>
# Maintainer: Piotr Gorski <[email protected]>
# Maintainer: Vasiliy Stelmachenok <[email protected]>
# Contributor: Jan Alexander Steffens (heftig) <[email protected]>
# Contributor: Tobias Powalowski <[email protected]>
# Contributor: Thomas Baechler <[email protected]>
Expand Down Expand Up @@ -274,13 +276,10 @@ prepare() {
local src
for src in "${source[@]}"; do
src="${src%%::*}"
# Skip nvidia patches
[[ "$src" == "${_patchsource}"/misc/nvidia/*.patch ]] && continue
src="${src##*/}"
src="${src%.zst}"
[[ $src = 0001-Make-modeset-and-fbdev-default-enabled.patch ]] && continue
[[ $src = 0002-Do-not-error-on-unkown-CPU-Type-and-add-Zen5-support.patch ]] && continue
[[ $src = 0003-Add-IBT-Support.patch ]] && continue
[[ $src = 0004-6.11-Add-fix-for-fbdev.patch ]] && continue
[[ $src = 0005-6.12-drm_outpull_pill-changed-check.patch ]] && continue
[[ $src = *.patch ]] || continue
echo "Applying patch $src..."
patch -Np1 < "../$src"
Expand Down Expand Up @@ -547,29 +546,22 @@ build() {
make "${BUILD_FLAGS[@]}" -j"$(nproc)" all
make -C tools/bpf/bpftool vmlinux.h feature-clang-bpf-co-re=1

local MODULE_FLAGS=(
KERNEL_UNAME="${_kernuname}"
IGNORE_PREEMPT_RT_PRESENCE=1
SYSSRC="${srcdir}/${_srcname}"
SYSOUT="${srcdir}/${_srcname}"
)
if [ -n "$_build_nvidia" ]; then
local MODULE_FLAGS=(
KERNEL_UNAME="${_kernuname}"
IGNORE_PREEMPT_RT_PRESENCE=1
NV_EXCLUDE_BUILD_MODULES='__EXCLUDE_MODULES'
SYSSRC="${srcdir}/${_srcname}"
SYSOUT="${srcdir}/${_srcname}"
)

MODULE_FLAGS+=(NV_EXCLUDE_BUILD_MODULES='__EXCLUDE_MODULES')
cd "${srcdir}/${_nv_pkg}/kernel"
make "${BUILD_FLAGS[@]}" "${MODULE_FLAGS[@]}" -j"$(nproc)" modules

fi

if [ -n "$_build_nvidia_open" ]; then
cd "${srcdir}/${_nv_open_pkg}"
local MODULE_FLAGS=(
KERNEL_UNAME="${_kernuname}"
IGNORE_PREEMPT_RT_PRESENCE=1
IGNORE_CC_MISMATCH=yes
SYSSRC="${srcdir}/${_srcname}"
SYSOUT="${srcdir}/${_srcname}"
)
MODULE_FLAGS+=(IGNORE_CC_MISMATCH=yes)
CFLAGS= CXXFLAGS= LDFLAGS= make "${BUILD_FLAGS[@]}" "${MODULE_FLAGS[@]}" -j"$(nproc)" modules
fi

Expand Down
34 changes: 13 additions & 21 deletions linux-cachyos-eevdf/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Maintainer: Peter Jung ptr1337 <[email protected]> && Piotr Gorski <[email protected]>
# Maintainer: Peter Jung ptr1337 <[email protected]>
# Maintainer: Piotr Gorski <[email protected]>
# Maintainer: Vasiliy Stelmachenok <[email protected]>
# Contributor: Jan Alexander Steffens (heftig) <[email protected]>
# Contributor: Tobias Powalowski <[email protected]>
# Contributor: Thomas Baechler <[email protected]>
Expand Down Expand Up @@ -270,13 +272,10 @@ prepare() {
local src
for src in "${source[@]}"; do
src="${src%%::*}"
# Skip nvidia patches
[[ "$src" == "${_patchsource}"/misc/nvidia/*.patch ]] && continue
src="${src##*/}"
src="${src%.zst}"
[[ $src = 0001-Make-modeset-and-fbdev-default-enabled.patch ]] && continue
[[ $src = 0002-Do-not-error-on-unkown-CPU-Type-and-add-Zen5-support.patch ]] && continue
[[ $src = 0003-Add-IBT-Support.patch ]] && continue
[[ $src = 0004-6.11-Add-fix-for-fbdev.patch ]] && continue
[[ $src = 0005-6.12-drm_outpull_pill-changed-check.patch ]] && continue
[[ $src = *.patch ]] || continue
echo "Applying patch $src..."
patch -Np1 < "../$src"
Expand Down Expand Up @@ -543,29 +542,22 @@ build() {
make "${BUILD_FLAGS[@]}" -j"$(nproc)" all
make -C tools/bpf/bpftool vmlinux.h feature-clang-bpf-co-re=1

local MODULE_FLAGS=(
KERNEL_UNAME="${_kernuname}"
IGNORE_PREEMPT_RT_PRESENCE=1
SYSSRC="${srcdir}/${_srcname}"
SYSOUT="${srcdir}/${_srcname}"
)
if [ -n "$_build_nvidia" ]; then
local MODULE_FLAGS=(
KERNEL_UNAME="${_kernuname}"
IGNORE_PREEMPT_RT_PRESENCE=1
NV_EXCLUDE_BUILD_MODULES='__EXCLUDE_MODULES'
SYSSRC="${srcdir}/${_srcname}"
SYSOUT="${srcdir}/${_srcname}"
)

MODULE_FLAGS+=(NV_EXCLUDE_BUILD_MODULES='__EXCLUDE_MODULES')
cd "${srcdir}/${_nv_pkg}/kernel"
make "${BUILD_FLAGS[@]}" "${MODULE_FLAGS[@]}" -j"$(nproc)" modules

fi

if [ -n "$_build_nvidia_open" ]; then
cd "${srcdir}/${_nv_open_pkg}"
local MODULE_FLAGS=(
KERNEL_UNAME="${_kernuname}"
IGNORE_PREEMPT_RT_PRESENCE=1
IGNORE_CC_MISMATCH=yes
SYSSRC="${srcdir}/${_srcname}"
SYSOUT="${srcdir}/${_srcname}"
)
MODULE_FLAGS+=(IGNORE_CC_MISMATCH=yes)
CFLAGS= CXXFLAGS= LDFLAGS= make "${BUILD_FLAGS[@]}" "${MODULE_FLAGS[@]}" -j"$(nproc)" modules
fi

Expand Down
34 changes: 13 additions & 21 deletions linux-cachyos-hardened/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Maintainer: Peter Jung ptr1337 <[email protected]> && Piotr Gorski <[email protected]>
# Maintainer: Peter Jung ptr1337 <[email protected]>
# Maintainer: Piotr Gorski <[email protected]>
# Maintainer: Vasiliy Stelmachenok <[email protected]>
# Contributor: Jan Alexander Steffens (heftig) <[email protected]>
# Contributor: Tobias Powalowski <[email protected]>
# Contributor: Thomas Baechler <[email protected]>
Expand Down Expand Up @@ -268,13 +270,10 @@ prepare() {
local src
for src in "${source[@]}"; do
src="${src%%::*}"
# Skip nvidia patches
[[ "$src" == "${_patchsource}"/misc/nvidia/*.patch ]] && continue
src="${src##*/}"
src="${src%.zst}"
[[ $src = 0001-Make-modeset-and-fbdev-default-enabled.patch ]] && continue
[[ $src = 0002-Do-not-error-on-unkown-CPU-Type-and-add-Zen5-support.patch ]] && continue
[[ $src = 0003-Add-IBT-Support.patch ]] && continue
[[ $src = 0004-6.11-Add-fix-for-fbdev.patch ]] && continue
[[ $src = 0005-6.12-drm_outpull_pill-changed-check.patch ]] && continue
[[ $src = *.patch ]] || continue
echo "Applying patch $src..."
patch -Np1 < "../$src"
Expand Down Expand Up @@ -541,29 +540,22 @@ build() {
cd ${srcdir}/${_srcname}
make ${BUILD_FLAGS[*]} -j$(nproc) all

local MODULE_FLAGS=(
KERNEL_UNAME="${_kernuname}"
IGNORE_PREEMPT_RT_PRESENCE=1
SYSSRC="${srcdir}/${_srcname}"
SYSOUT="${srcdir}/${_srcname}"
)
if [ -n "$_build_nvidia" ]; then
local MODULE_FLAGS=(
KERNEL_UNAME="${_kernuname}"
IGNORE_PREEMPT_RT_PRESENCE=1
NV_EXCLUDE_BUILD_MODULES='__EXCLUDE_MODULES'
SYSSRC="${srcdir}/${_srcname}"
SYSOUT="${srcdir}/${_srcname}"
)

MODULE_FLAGS+=(NV_EXCLUDE_BUILD_MODULES='__EXCLUDE_MODULES')
cd "${srcdir}/${_nv_pkg}/kernel"
make "${BUILD_FLAGS[@]}" "${MODULE_FLAGS[@]}" -j"$(nproc)" modules

fi

if [ -n "$_build_nvidia_open" ]; then
cd "${srcdir}/${_nv_open_pkg}"
local MODULE_FLAGS=(
KERNEL_UNAME="${_kernuname}"
IGNORE_PREEMPT_RT_PRESENCE=1
IGNORE_CC_MISMATCH=yes
SYSSRC="${srcdir}/${_srcname}"
SYSOUT="${srcdir}/${_srcname}"
)
MODULE_FLAGS+=(IGNORE_CC_MISMATCH=yes)
CFLAGS= CXXFLAGS= LDFLAGS= make "${BUILD_FLAGS[@]}" "${MODULE_FLAGS[@]}" -j"$(nproc)" modules
fi

Expand Down
34 changes: 13 additions & 21 deletions linux-cachyos-lts/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Maintainer: Peter Jung ptr1337 <[email protected]> && Piotr Gorski <[email protected]>
# Maintainer: Peter Jung ptr1337 <[email protected]>
# Maintainer: Piotr Gorski <[email protected]>
# Maintainer: Vasiliy Stelmachenok <[email protected]>
# Contributor: Jan Alexander Steffens (heftig) <[email protected]>
# Contributor: Tobias Powalowski <[email protected]>
# Contributor: Thomas Baechler <[email protected]>
Expand Down Expand Up @@ -295,13 +297,10 @@ prepare() {
local src
for src in "${source[@]}"; do
src="${src%%::*}"
# Skip nvidia patches
[[ "$src" == "${_patchsource}"/misc/nvidia/*.patch ]] && continue
src="${src##*/}"
src="${src%.zst}"
[[ $src = 0001-Make-modeset-and-fbdev-default-enabled.patch ]] && continue
[[ $src = 0002-Do-not-error-on-unkown-CPU-Type-and-add-Zen5-support.patch ]] && continue
[[ $src = 0003-Add-IBT-Support.patch ]] && continue
[[ $src = 0004-6.11-Add-fix-for-fbdev.patch ]] && continue
[[ $src = 0005-6.12-drm_outpull_pill-changed-check.patch ]] && continue
[[ $src = *.patch ]] || continue
echo "Applying patch $src..."
patch -Np1 < "../$src"
Expand Down Expand Up @@ -625,29 +624,22 @@ build() {
make "${BUILD_FLAGS[@]}" -j"$(nproc)" all
make -C tools/bpf/bpftool vmlinux.h feature-clang-bpf-co-re=1

local MODULE_FLAGS=(
KERNEL_UNAME="${_kernuname}"
IGNORE_PREEMPT_RT_PRESENCE=1
SYSSRC="${srcdir}/${_srcname}"
SYSOUT="${srcdir}/${_srcname}"
)
if [ -n "$_build_nvidia" ]; then
local MODULE_FLAGS=(
KERNEL_UNAME="${_kernuname}"
IGNORE_PREEMPT_RT_PRESENCE=1
NV_EXCLUDE_BUILD_MODULES='__EXCLUDE_MODULES'
SYSSRC="${srcdir}/${_srcname}"
SYSOUT="${srcdir}/${_srcname}"
)

MODULE_FLAGS+=(NV_EXCLUDE_BUILD_MODULES='__EXCLUDE_MODULES')
cd "${srcdir}/${_nv_pkg}/kernel"
make "${BUILD_FLAGS[@]}" "${MODULE_FLAGS[@]}" -j"$(nproc)" modules

fi

if [ -n "$_build_nvidia_open" ]; then
cd "${srcdir}/${_nv_open_pkg}"
local MODULE_FLAGS=(
KERNEL_UNAME="${_kernuname}"
IGNORE_PREEMPT_RT_PRESENCE=1
IGNORE_CC_MISMATCH=yes
SYSSRC="${srcdir}/${_srcname}"
SYSOUT="${srcdir}/${_srcname}"
)
MODULE_FLAGS+=(IGNORE_CC_MISMATCH=yes)
CFLAGS= CXXFLAGS= LDFLAGS= make "${BUILD_FLAGS[@]}" "${MODULE_FLAGS[@]}" -j"$(nproc)" modules
fi

Expand Down
Loading

0 comments on commit 8a10d0f

Please sign in to comment.