Repository navigation
kpatch-build: initialize VARIANT variable - #1536
Merged
Merged
Conversation
usebeforefree
force-pushed
the
variant-bug
branch
2 times, most recently
from
November 11, 2026 16:32
c350fa2 to
e345d8f
Compare
Contributor
Author
|
Variant is in fact assigned in oot paths, via ARCHVERSION: kpatch/kpatch-build/kpatch-build Lines 980 to 982 in 943425a finally: kpatch/kpatch-build/kpatch-build Lines 1020 to 1022 in 943425a But it doesn't do anything as far as I can see. In order not to create bugs and/or raise cryptic errors, I suggest this fix for now: diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build
index 67a0e54..2bb02c3 100755
--- a/kpatch-build/kpatch-build
+++ b/kpatch-build/kpatch-build
@@ -939,6 +939,10 @@ if [[ -n "$SRCRPM" ]]; then
fi
fi
+if [[ -n "$KVARIANT" && -n "$OOT_MODULE" ]]; then
+ die "--variant is incompatible with --oot-module"
+fi
+
if [[ -n "$KVARIANT" && -z "$SRCRPM" && -z "$USERSRCDIR" ]]; then
die "--variant requires --sourcerpm or --sourcedir"
fi |
usebeforefree
force-pushed
the
variant-bug
branch
from
November 11, 2026 16:46
e345d8f to
7b14ecb
Compare
When the -s|--sourcedir option is not provided, kpatch-build sources /etc/os-release. On Fedora that file defines a variable called VARIANT, which in turn overwrites kpatch-build's user provided -V|--variant VARIANT value, producing a bug. Fixes: 5adfdd4 ("kpatch-build, lib.sh, man: add kernel variant support") Signed-off-by: Marko Kostić <mkostic@redhat.com> Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com> (commit msg)
joe-lawrence
force-pushed
the
variant-bug
branch
from
November 11, 2026 20:42
7b14ecb to
3505e45
Compare
joe-lawrence
approved these changes
Nov 11, 2026
Contributor
Author
|
Tests passed, merging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Otherwise the script is environment sensitive.
I've discovered this when running:
This is an edge case that should be handled as well in this, or another PR.