Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 626678

Summary: >=x11-drivers/nvidia-drivers-381.22-r1 fails to compile with KERNELRELEASE envvar
Product: Gentoo Linux Reporter: Corin Lawson <corin>
Component: Current packagesAssignee: Jeroen Roovers (RETIRED) <jer>
Status: RESOLVED FIXED    
Severity: normal CC: jstein
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=613578
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info x11-drivers/nvidia-drivers

Description Corin Lawson 2017-07-31 02:49:42 UTC
Created attachment 487424 [details]
emerge --info x11-drivers/nvidia-drivers

My typical kernel upgrade flow involves exporting a value for KERNELRELEASE into my environment e.g. `export KERNELRELEASE=$(make kernelrelease)`

However when it comes time to `emerge @module-rebuild`, nvidia-drivers fails with the following message:

     * abi_x86_32.x86: running multilib-minimal_abi_src_configure
     * abi_x86_64.amd64: running multilib-minimal_abi_src_configure
     * Preparing nvidia module
    Makefile:19: /Kbuild: No such file or directory
    make: *** No rule to make target '/Kbuild'.  Stop.
     * ERROR: x11-drivers/nvidia-drivers-378.13-r1::gentoo failed (compile phase):
     *   emake failed

Digging into /var/tmp/portage/x11-drivers/nvidia-drivers-381.22/work/kernel/Makefile, I discovered that I am following this code path:

    18  ifneq ($(KERNELRELEASE),)
    19    include $(src)/Kbuild

And it appears that $(src) is not defined anyplace.

My workaround is to simply unset KERNELRELEASE:

    env KERNELRELEASE= emerge @module-rebuild

But I'm not sure if there's a better fix(?)
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2019-01-16 10:48:27 UTC
Looks like this was accidentally fixed when the build system was adapted for parallel make.