public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: bruce.ashfield@gmail.com
To: richard.purdie@linuxfoundation.org
Cc: openembedded-core@lists.openembedded.org
Subject: [PATCH 08/12] kernel-yocto: improve metadata patching
Date: Wed,  8 Nov 2023 09:16:26 -0500	[thread overview]
Message-ID: <e62eae56d99ddff005b6049834063d1d4f330230.1699452828.git.bruce.ashfield@gmail.com> (raw)
In-Reply-To: <cover.1699452828.git.bruce.ashfield@gmail.com>

From: Bruce Ashfield <bruce.ashfield@gmail.com>

The ability to patch the kernel-yocto metadata was added to support
debug and easier test cycles on kernel-cache provided fragments. As
such, it was very simple and has limited functionality.

That being said, it is an available feature and can be improved to
handle patches that fail to apply.

The main kernel patching is already handled by the kern-tools, so
we extend the patching of the meta-data to same tools and inherit
more functinality from the scripts.

[YOCTO #15266]

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
 meta/classes-recipe/kernel-yocto.bbclass | 30 ++++++++++++++++++++----
 1 file changed, 25 insertions(+), 5 deletions(-)

diff --git a/meta/classes-recipe/kernel-yocto.bbclass b/meta/classes-recipe/kernel-yocto.bbclass
index cb9cd26b09..9a86616dad 100644
--- a/meta/classes-recipe/kernel-yocto.bbclass
+++ b/meta/classes-recipe/kernel-yocto.bbclass
@@ -176,12 +176,32 @@ do_kernel_metadata() {
 		# kernel source tree, where they'll be used later.
 		check_git_config
 		patches="${@" ".join(find_patches(d,'kernel-meta'))}"
-		for p in $patches; do
+		if [ -n "$patches" ]; then
 		    (
-			cd ${WORKDIR}/kernel-meta
-			git am -s $p
-		    )
-		done
+			    cd ${WORKDIR}/kernel-meta
+
+			    # take the SRC_URI patches, and create a series file
+			    # this is required to support some better processing
+			    # of issues with the patches
+			    rm -f series
+			    for p in $patches; do
+				cp $p .
+				echo "$(basename $p)" >> series
+			    done
+
+			    # process the series with kgit-s2q, which is what is
+			    # handling the rest of the kernel. This allows us
+			    # more flexibility for handling failures or advanced
+			    # mergeing functinoality
+			    message=$(kgit-s2q --gen -v --patches ${WORKDIR}/kernel-meta 2>&1)
+			    if [ $? -ne 0 ]; then
+				# setup to try the patch again
+				kgit-s2q --prev
+				bberror "Problem applying patches to: ${WORKDIR}/kernel-meta"
+				bbfatal_log "\n($message)"
+			    fi
+			)
+		fi
 	fi
 
 	sccs_from_src_uri="${@" ".join(find_sccs(d))}"
-- 
2.34.1



  parent reply	other threads:[~2023-11-08 14:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-08 14:16 [PATCH 00/12] kernel-yocto: consolidated pull request bruce.ashfield
2023-11-08 14:16 ` [PATCH 01/12] linux-yocto/6.5: update to v6.5.8 bruce.ashfield
2023-11-08 14:16 ` [PATCH 02/12] linux-yocto/6.1: update to v6.1.59 bruce.ashfield
2023-11-08 14:16 ` [PATCH 03/12] linux-yocto/6.5: update to v6.5.9 bruce.ashfield
2023-11-08 14:16 ` [PATCH 04/12] linux-yocto/6.1: update to v6.1.60 bruce.ashfield
2023-11-08 14:16 ` [PATCH 05/12] kern-tools: make lower context patches reproducible bruce.ashfield
2023-11-08 14:16 ` [PATCH 06/12] kern-tools: bump SRCREV for queue processing changes bruce.ashfield
2023-11-08 14:16 ` [PATCH 07/12] kern-tools: update SRCREV to include SECURITY.md file bruce.ashfield
2023-11-08 14:16 ` bruce.ashfield [this message]
2023-11-08 14:16 ` [PATCH 09/12] linux-yocto/6.1: cfg: restore CONFIG_DEVMEM bruce.ashfield
2023-11-08 14:16 ` [PATCH 10/12] linux-yocto/6.5: " bruce.ashfield
2023-11-08 14:16 ` [PATCH 11/12] linux-yocto/6.5: update to v6.5.10 bruce.ashfield
2023-11-08 14:16 ` [PATCH 12/12] linux-yocto/6.1: update to v6.1.61 bruce.ashfield

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e62eae56d99ddff005b6049834063d1d4f330230.1699452828.git.bruce.ashfield@gmail.com \
    --to=bruce.ashfield@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox