Problem
kpatch-build on Fedora 42 fails when extracting kernel source from the SRPM. The mv glob at the source-finding step doesn't match, and die is called with the generic message:
ERROR: kpatch build failed
The build log shows mv failing because the glob BUILD/kernel-*/linux-* doesn't match the Fedora 42 directory layout.
Cause
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 used by Fedora < 42, RHEL, and CentOS:
BUILD/kernel-6.12.0/linux-6.12.0-100.fc41.x86_64/
Environment
- Fedora 42 (kernel
6.14.0-63.fc42.x86_64)
- kpatch master (
7552b46)
Fix
#1496
Co-assisted by Claude (Anthropic).