So this turns out to offer many twists and turns. Looking closer at a kernel installation which caused FTBS reports from DKMS, I found that the apt installer is unpacking all packages before calling the post install hooks. So all checking for existing headers that the postinst hook script does is succeeding as the files are already there.
>From what I saw it looked like the DKMS autobuild was attempted 3 times. Once for kernel-image and another one for kernel-image-extra, both of those failed. Then another one for headers which looked to be successful. After that I checked the hooks and found that we (Debian/Ubuntu) seem to have two places. The kernel postinst hook, but also one exclusively for the headers. So it seemed reasonable to reduce this to one hook. After all building external modules only makes sense after the headers are configured. The attached patch would do this and also fix up the hook to do what we think was intended. *However*, this actually was not our real problem. The _REAL_ problem is the ingenious cross-module action (I have an itch to call it evil layer violation) which the nvidia driver is causing (Alberto, is this your work?). Doing a complete run of DKMS autoinstallation seems to have a certain chance to always fail on the first attempt. I *should* have been suspicious after nvidia seemed to be the only one affected by FTBS reports which had everything installed after all. Really I am not entirely sure any DKMS module ever should meddle in another modules build directory like nvidia-uvm does. >:-( Bottom line: The changes to the DKMS package that I attached might be nice improvements, but not necessarily worth backporting. The real fix very likely has to be made to the nvidia DKMS build procedure. ** Patch added: "DKMS changes" https://bugs.launchpad.net/ubuntu/+source/dkms/+bug/1427175/+attachment/4343170/+files/dkms.debdiff -- You received this bug notification because you are a member of Kernel Packages, which is subscribed to dkms in Ubuntu. https://bugs.launchpad.net/bugs/1427175 Title: dkms postinst should handle missing headers Status in dkms package in Ubuntu: Confirmed Bug description: In the kernel post-install script of DKMS we have the following: if [ -x /usr/lib/dkms/dkms_autoinstaller ]; then exec /usr/lib/dkms/dkms_autoinstaller start $inst_kern > /dev/null fi if ! _check_kernel_dir $inst_kern ; then echo "dkms: WARNING: $kernel headers are missing, which may explain the above failures." >&2 echo " please install the $header_pkg package to fix this." >&2 fi Supposedly the intention is to produce a warning if the kernel-headers are missing (might also cause the overall exit code to be 0). But execution of this script stops and is replaced by the dkms_autoinstaller when using exec. So it probably should be: if [ -x /usr/lib/dkms/dkms_autoinstaller ]; then if ! /usr/lib/dkms/dkms_autoinstaller start $inst_kern > /dev/null; then if !_check_kernel_dir $inst_kern ; then ... To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/dkms/+bug/1427175/+subscriptions -- Mailing list: https://launchpad.net/~kernel-packages Post to : [email protected] Unsubscribe : https://launchpad.net/~kernel-packages More help : https://help.launchpad.net/ListHelp

