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

Bug 656282

Summary: virtualbox-modules-5.1.36 fails to get kernel version from running kernel
Product: Gentoo Linux Reporter: groepaz
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED INVALID    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description groepaz 2018-05-22 15:25:20 UTC
first: i somehow managed to screw up the kernel directory of the kernel i am running right now, ie it was unmerged when it shouldn't - and now that kernel is no more in the tree. (so yes, i should update - but thats not the point here)

emerging other packages that need the kernel version (eg xf86-input-libinput-0.27.1) works just fine, they use the version of the running kernel instead (which is fine for the time being)

however, virtualbox ebuilds fail like this:

 * Could not find a Makefile in the kernel source directory.
 * Please ensure that /usr/src/linux points to a complete set of Linux sources
 * Unable to calculate Linux Kernel version for build, attempting to use running version
 * Could not find a usable .config in the kernel source directory.
 * Please ensure that /usr/src/linux points to a configured set of Linux sources.
 * If you are using KBUILD_OUTPUT, please set the environment var so that
 * it points to the necessary object directory so that it might find .config.
 * ERROR: app-emulation/virtualbox-modules-5.1.36::gentoo failed (setup phase):
 *   Kernel not configured; no .config found in 
 * 
 * Call stack:
 *                          ebuild.sh, line 124:  Called pkg_setup
 *   virtualbox-modules-5.1.36.ebuild, line  31:  Called linux-mod_pkg_setup
 *                   linux-mod.eclass, line 586:  Called linux-info_pkg_setup
 *                  linux-info.eclass, line 921:  Called check_extra_config
 *                  linux-info.eclass, line 731:  Called require_configured_kernel
 *                  linux-info.eclass, line 296:  Called die
 * The specific snippet of code:
 *              die "Kernel not configured; no .config found in ${KV_OUT_DIR}"

this looks like a bug to me, i'd expect it to work (using the running kernel version).
Comment 1 Marek Szuba archtester gentoo-dev 2018-05-22 15:48:04 UTC
As the name of the package suggests, app-emulation/virtualbox-modules builds kernel modules - and for that you need kernel sources, or to be precise kernel sources which have been configured and prepared for building external modules ('make modules_prepare'). No kernel sources, no modules. Packages like x11-drivers/xf86-input-libinput are different in this respect because while they depend on certain kernel features to be enabled (or sometimes disabled) they do not actually build any kernel modules, making it possible for emerge to continue even if all the ebuild finds is the kernel config file.
Comment 2 groepaz 2018-05-22 16:08:02 UTC
then at least the line

 * Unable to calculate Linux Kernel version for build, attempting to use running version

shouldnt be there - i'd still call that a bug