#1136154 nvidia-kernel-dkms: DKMS build fails on kernel 7.0.4+deb14-amd64 — awk quote expansion breaks gen-btf.sh BTF generation

#1136154#5
Date:
2026-05-10 05:28:43 UTC
From:
To:
== ROOT CAUSE ==

The NVIDIA Makefile checks for scripts/pahole-flags.sh to decide
whether to inject a custom PAHOLE variable containing an awk
one-liner:

PAHOLE_VARIABLES=$(if $(wildcard
$(KERNEL_SOURCES)/scripts/pahole-flags.sh),, "PAHOLE=$(AWK)
'$(PAHOLE_AWK_PROGRAM)'")

Debian kernels >= 7.0.4 no longer ship scripts/pahole-flags.sh —
pahole flag handling moved to scripts/Makefile.btf (with
CONFIG_DEBUG_INFO_BTF_MODULES=y enabled by default). NVIDIA does not
detect this and injects:

PAHOLE="awk 'BEGIN { pahole_cmd = "pahole"; ... }'"

Kernel 7.0.4 ships a new scripts/gen-btf.sh which invokes ${PAHOLE}
directly in the shell. Shell variable expansion does NOT re-parse
quotes, so awk receives 'BEGIN (literal apostrophe + BEGIN) as its
program argument and errors out:

BTF [M] nvidia-modeset.ko awk: line 1: 'BEGIN awk: line 1: ^ invalid
char in expression make[4]: *** [scripts/Makefile.modfinal:62:
nvidia-modeset.ko] Error 1

== FIX ==

Creating a stub scripts/pahole-flags.sh in the kernel headers causes
NVIDIA to leave PAHOLE_VARIABLES empty. PAHOLE then defaults to the
system pahole binary, which works correctly with PAHOLE_FLAGS already
exported by Makefile.btf.

The permanent fix in the package would be to patch the NVIDIA Makefile
to replace the awk-in-variable approach with a proper wrapper script,
or to extend the detection to also check for Makefile.btf.

A workaround script is available at:
https://github.com/SoplosLinux/nvidia-patches/tree/main/kernel-debian-7.0.4

== AFFECTED ==

nvidia-kernel-dkms 580.126.20 and 590.x on Linux 7.0.4+deb14-amd64
with CONFIG_DEBUG_INFO_BTF_MODULES=y (Debian default). Linux <= 7.0.3
unaffected (gen-btf.sh not yet present).

== NOTE ==

The 580 branch is required for Maxwell (GTX 900) GPUs not supported by
590+. The same root cause affects the 590 branch maintained in Debian.

Regards, Sergi Perich

#1136154#10
Date:
2026-09-14 12:14:49 UTC
From:
To:
Control: reassign -1 nvidia-kernel-dkms
Control: retitle -1 nvidia-kernel-dkms: [580, 590] DKMS build fails on kernel 7.0.4+deb14-amd64 — awk quote expansion breaks gen-btf.sh BTF generation
Control: tags -1 + upstream
Control: block 1081302 by -1
Control: block 1104904 by -1
Control: block 1123801 by -1
...

These versions are not yet available from Debian. If
you obtained these versions from Nvidia, perhaps via
<https://docs.nvidia.com/datacenter/tesla/driver-installation-guide/debian.html>,
please contact Nvidia's support channels. Debian does not have any
control over the drivers provided by Nvidia.

Neither 580 nor 590 is currently in Debian
(https://bugs.debian.org/1081302, https://bugs.debian.org/1104904,
https://bugs.debian.org/1123801).

    smcv