Groups | Search | Server Info | Login | Register


Groups > linux.gentoo.dev > #70497

[gentoo-dev] [PATCH 1/1] kernel-2.eclass: Check to ensure genpatches contains the intended linux patch version

From Mike Pagano <mpagano@gentoo.org>
Newsgroups linux.gentoo.dev
Subject [gentoo-dev] [PATCH 1/1] kernel-2.eclass: Check to ensure genpatches contains the intended linux patch version
Date 2026-05-04 17:10 +0200
Message-ID <MR35M-2yEl-9@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Iterate through the patch set files names looking for the kernel
version to be installed. Die on failure.

Signed-off-by: Mike Pagano <mpagano@gentoo.org>
---
  eclass/kernel-2.eclass | 22 ++++++++++++++++++++++
  1 file changed, 22 insertions(+)

diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
index 9484eab5b..7676e7276 100644
--- a/eclass/kernel-2.eclass
+++ b/eclass/kernel-2.eclass
@@ -1115,6 +1115,28 @@ unipatch() {
  			fi
  		fi

+        # If we use genpatches, let's make sure it includes the
+        # kernel patch for the version we are trying to install
+        # This is a sanity check to make sure the genpatches version
+        # in the ebuild is correct
+        #
+        # Iterate through patch and look for OKV
+        if [[ -n "${K_WANT_GENPATCHES}" ]]; then
+            KV_PATCH_FOUND=
+            for file in ${KPATCH_DIR}/*; do
+                filename="${file##*/}"
+                if [[ "$filename" == *"${OKV}"* ]]; then
+                    KV_PATCH_FOUND=yes
+                    break;
+                fi
+            done
+            if [[ -z ${KV_PATCH_FOUND} ]]; then
+                eerror "GENPATCHES does not contain linux patch ${OKV}"
+                eerror "Please check your ebuild for the proper 
K_GENPATCHES_VER=N"
+                die "GENPATCHES appears to be missing Linux patch ${OKV}"
+            fi
+        fi
+
  		# If experimental was not chosen by the user, drop experimental 
patches not in K_EXP_GENPATCHES_LIST.
  		if [[ ${i} == *genpatches-*.experimental.* && -n 
${K_EXP_GENPATCHES_PULL} ]]; then
  			if [[ -z ${K_EXP_GENPATCHES_NOUSE} ]] && use experimental; then
-- 
2.53.0

Mike Pagano
Gentoo Developer
E-Mail     : mpagano@gentoo.org
GnuPG FP   : 52CC A0B0 F631 0B17 0142 F83F 92A6 DBEC 81F2 B137
Public Key : 
http://pgp.mit.edu/pks/lookup?search=0x92A6DBEC81F2B137&op=index

Back to linux.gentoo.dev | Previous | NextNext in thread | Find similar


Thread

[gentoo-dev] [PATCH 1/1] kernel-2.eclass: Check to ensure genpatches contains the intended linux patch version Mike Pagano <mpagano@gentoo.org> - 2026-05-04 17:10 +0200
  Re: [gentoo-dev] [PATCH 1/1] kernel-2.eclass: Check to ensure  genpatches contains the intended linux patch version Sam James <sam@gentoo.org> - 2026-05-04 18:10 +0200
    Re: [gentoo-dev] [PATCH 1/1] kernel-2.eclass: Check to ensure  genpatches contains the intended linux patch version Sam James <sam@gentoo.org> - 2026-05-04 18:40 +0200
      Re: [gentoo-dev] [PATCH 1/1] kernel-2.eclass: Check to ensure  genpatches contains the intended linux patch version Mike Pagano <mpagano@gentoo.org> - 2026-05-04 19:00 +0200

csiph-web