From: Joe Lawrence <joe.lawrence@redhat.com>
To: live-patching@vger.kernel.org
Cc: Josh Poimboeuf <jpoimboe@kernel.org>, Song Liu <song@kernel.org>,
Jiri Kosina <jikos@kernel.org>, Miroslav Benes <mbenes@suse.cz>,
Petr Mladek <pmladek@suse.com>
Subject: Re: [PATCH v2 3/5] livepatch/klp-build: switch to GNU patch and recountdiff
Date: Tue, 3 Feb 2026 21:58:09 -0500 [thread overview]
Message-ID: <aYK1wf9Q2CZrpNNk@redhat.com> (raw)
In-Reply-To: <20260204025140.2023382-4-joe.lawrence@redhat.com>
On Tue, Feb 03, 2026 at 09:51:38PM -0500, Joe Lawrence wrote:
> The klp-build script is currently very strict with input patches,
> requiring them to apply cleanly via `git apply --recount`. This
> prevents the use of patches with minor contextual fuzz relative to the
> target kernel sources.
>
> To allow users to reuse a patch across similar kernel streams, switch to
> using GNU patch and patchutils for intermediate patch manipulation.
> Update the logic for applying, reverting, and regenerating patches:
>
> - Use 'patch -p1' for better handling of context fuzz.
> - Use 'recountdiff' to update line counts after FIX_PATCH_LINES.
> - Drop git_refresh() and related git-specific logic.
>
> Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
> ---
> scripts/livepatch/klp-build | 50 +++++++++++--------------------------
> 1 file changed, 14 insertions(+), 36 deletions(-)
>
Forgot to mention this was tested as per Josh's suggestion (slightly
modified*):
$ find . -type f -name '*.c' ! -path "./lib/*" -print0 | xargs -0 sed -i '1iasm("nop");'
$ git checkout tools arch/x86/lib/inat.c arch/x86/lib/insn.c kernel/configs.c
$ git diff > /tmp/oneline.patch
$ ./scripts/livepatch/klp-build /tmp/oneline.patch
...
error: klp-build: no changes detected
* modified to exclude lib/ to dodge unsupported patch complaints, avoid
symlinks (GNU patch does not like), and kernel/configs.o which objtool
couldn't find its .discard.sym_checksum section
--
Joe
next prev parent reply other threads:[~2026-02-04 2:58 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-04 2:51 [PATCH v2 0/5] livepatch-klp-build: small fixups and enhancements Joe Lawrence
2026-02-04 2:51 ` [PATCH v2 1/5] objtool/klp: Fix mkstemp() failure with long paths Joe Lawrence
2026-02-04 16:47 ` Josh Poimboeuf
2026-02-05 15:53 ` Joe Lawrence
2026-02-04 2:51 ` [PATCH v2 2/5] livepatch/klp-build: handle patches that add/remove files Joe Lawrence
2026-02-04 18:02 ` Josh Poimboeuf
2026-02-05 16:35 ` Joe Lawrence
2026-02-05 16:53 ` Josh Poimboeuf
2026-02-10 19:54 ` Joe Lawrence
2026-02-10 20:57 ` Josh Poimboeuf
2026-02-04 2:51 ` [PATCH v2 3/5] livepatch/klp-build: switch to GNU patch and recountdiff Joe Lawrence
2026-02-04 2:58 ` Joe Lawrence [this message]
2026-02-04 18:35 ` Josh Poimboeuf
2026-02-05 17:27 ` Joe Lawrence
2026-02-05 17:49 ` Josh Poimboeuf
2026-02-04 2:51 ` [PATCH v2 4/5] livepatch/klp-build: minor short-circuiting tweaks Joe Lawrence
2026-02-04 18:40 ` Josh Poimboeuf
2026-02-05 17:47 ` Joe Lawrence
2026-02-04 2:51 ` [PATCH v2 5/5] livepatch/klp-build: provide friendlier error messages Joe Lawrence
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=aYK1wf9Q2CZrpNNk@redhat.com \
--to=joe.lawrence@redhat.com \
--cc=jikos@kernel.org \
--cc=jpoimboe@kernel.org \
--cc=live-patching@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=pmladek@suse.com \
--cc=song@kernel.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