Commit 96c5ebd
kpatch-build: fix Fedora 42+ kernel source directory nesting
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 the traditional
flat layout and fails on this structure.
Extract the source-finding logic into find_rpm_linux_srcdir() in a new
kpatch-funcs.sh, using 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 deeper with find -maxdepth 3, excluding
configs/ directories, again requiring exactly one result.
Signed-off-by: Or Shoval <oshoval@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 7552b46 commit 96c5ebd
2 files changed
Lines changed: 35 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
1082 | 1083 | | |
1083 | 1084 | | |
1084 | 1085 | | |
1085 | | - | |
| 1086 | + | |
1086 | 1087 | | |
1087 | 1088 | | |
1088 | 1089 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
0 commit comments