Skip to content

kpatch-build fails on Fedora 42: cannot find kernel source directory #1497

@oshoval

Description

@oshoval

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions