Skip to content

[DKMS] Debian 13: Module build fails during kernel update due to non-executable .sh scripts in build directory #1258

Description

@GRbit

NVIDIA Open GPU Kernel Modules Version

595.71.05

Operating System and Version

Description: Debian GNU/Linux 13 (trixie)

Kernel Release

Linux amr5 6.12.94+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.94-1 (2026-06-20) x86_64 GNU/Linux

Please confirm you are running a stable release kernel (e.g. not a -rc). We do not accept bug reports for unreleased kernels.

  • I am running on a stable kernel release.

Build Command

Just a standard DKMS build while updating to a new kernel version via apt

Terminal output/Build Log

Setting up linux-image-6.12.96+deb13-amd64 (6.12.96-1) ...
I: /initrd.img is now a symlink to boot/initrd.img-6.12.96+deb13-amd64
/etc/kernel/postinst.d/dkms:
Sign command: /lib/modules/6.12.96+deb13-amd64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Autoinstall of module nvidia/595.71.05 for kernel 6.12.96+deb13-amd64 (x86_64)
Building module(s).........(bad exit status: 2)
Failed command:
'make' -j32 NV_EXCLUDE_BUILD_MODULES='' KERNEL_UNAME=6.12.96+deb13-amd64 modules

Error! Bad return status for module build on kernel: 6.12.96+deb13-amd64 (x86_64)
Consult /var/lib/dkms/nvidia/595.71.05/build/make.log for more information.

Autoinstall on 6.12.96+deb13-amd64 failed for module(s) nvidia(10).

Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
run-parts: /etc/kernel/postinst.d/dkms exited with return code 1
dpkg: error processing package linux-image-6.12.96+deb13-amd64 (--configure):
installed linux-image-6.12.96+deb13-amd64 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-headers-6.12.96+deb13-amd64:
linux-headers-6.12.96+deb13-amd64 depends on linux-image-6.12.96+deb13-amd64 (= 6.12.96-1) | linux-image-6.12.96+deb13-amd64-unsigned (= 6.12.96-1); however:
Package linux-image-6.12.96+deb13-amd64 is not configured yet.
Package linux-image-6.12.96+deb13-amd64-unsigned is not installed.

dpkg: error processing package linux-headers-6.12.96+deb13-amd64 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-amd64:
linux-image-amd64 depends on linux-image-6.12.96+deb13-amd64 (= 6.12.96-1); however:
Package linux-image-6.12.96+deb13-amd64 is not configured yet.

dpkg: error processing package linux-image-amd64 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-headers-amd64:
linux-headers-amd64 depends on linux-headers-6.12.96+deb13-amd64 (= 6.12.96-1); however:
Package linux-headers-6.12.96+deb13-amd64 is not configured yet.

More Info

When DKMS triggers an automated build for the NVIDIA kernel module during kernel updates (via dpkg / apt post-installation hooks), the process fails with a bad return status (exit code 2).

The root cause is that shell helper scripts (*.sh) located inside the DKMS build directory (/var/lib/dkms/nvidia//build/) lack executable permissions (0644 instead of 0755). When make attempts to execute them during the compilation phase, execution is denied.

Since sources are overwritten every install, only fixes like this helps:

while true; do chmod +x /var/lib/dkms/nvidia/595*/build/*.sh; done

Currently I fix it by adding PRE_BUILD="chmod +x *.sh" to /usr/src/nvidia-595.71.05/dkms.conf

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions