kpatch-build: fix Fedora 42+ kernel source directory nesting#1496
Draft
oshoval wants to merge 1 commit intodynup:masterfrom
Draft
kpatch-build: fix Fedora 42+ kernel source directory nesting#1496oshoval wants to merge 1 commit intodynup:masterfrom
oshoval wants to merge 1 commit intodynup:masterfrom
Conversation
Starting with Fedora 42, the kernel SRPM unpacks with an extra level of nesting: BUILD/kernel-6.14.0-build/kernel-6.14/linux-6.14.0-63.fc42.x86_64/ The existing glob BUILD/kernel-*/linux-* only matches one level deep and fails on this layout. Use nullglob with a bash array to safely count flat-glob matches: - Exactly one match: move it (traditional RHEL/CentOS/Fedora < 42). - Multiple matches: die with a clear diagnostic. - Zero matches: search one level deeper with find -maxdepth 3, again requiring exactly one result before proceeding. All mv calls preserve the original "2>&1 | logger || die" error handling, and ambiguous matches are always fatal. Tested on Fedora 42 with kernel 6.14.0-63.fc42.x86_64. Signed-off-by: Or Shoval <oshoval@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
5446018 to
5bd7160
Compare
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.
Starting with Fedora 42, the kernel SRPM unpacks with an extra level of nesting:
The existing glob
BUILD/kernel-*/linux-*only matches one level deep and fails on this layout.Approach
Use
nullglobwith a bash array to safely count flat-glob matches:diewith a clear diagnostic.find -maxdepth 3, again requiring exactly one result before proceeding.All
mvcalls preserve the original2>&1 | logger || dieerror handling, and ambiguous matches are always fatal.Test plan