Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 528530 - linux-info.eclass should support /proc/config.gz for linux-info_pkg_setup
Summary: linux-info.eclass should support /proc/config.gz for linux-info_pkg_setup
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-07 05:41 UTC by W. Trevor King
Modified: 2021-08-28 16:52 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
linux-info.eclass.patch (linux-info.eclass.patch,349 bytes, patch)
2016-04-05 23:07 UTC, Fpemud
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description W. Trevor King 2014-11-07 05:41:11 UTC
Emerging app-emulation/docker-1.2.0 in a Docker container (which had /proc/config.gz but not /usr/src/linux) died with the following output:

>>> Emerging (32 of 32) app-emulation/docker-1.2.0
 * docker-1.2.0.zip SHA256 SHA512 WHIRLPOOL size ;-) ...            [ ok ]
 * Determining the location of the kernel source code
 * Unable to find kernel sources at /usr/src/linux
 * Please make sure that /usr/src/linux points at your running kernel, 
 * (or the kernel you wish to build against).
 * Alternatively, set the KERNEL_DIR environment variable to the kernel sources location
 * 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/docker-1.2.0::gentoo failed (setup phase):
 *   Kernel not configured; no .config found in 
 * 
 * Call stack:
 *             ebuild.sh, line  93:  Called pkg_setup
 *   docker-1.2.0.ebuild, line 126:  Called linux-info_pkg_setup
 *     linux-info.eclass, line 914:  Called check_extra_config
 *     linux-info.eclass, line 724:  Called require_configured_kernel
 *     linux-info.eclass, line 297:  Called die
 * The specific snippet of code:
 *              die "Kernel not configured; no .config found in ${KV_OUT_DIR}"

The reason is that require_configured_kernel relies on linux_config_src_exists instead of the more generic linux_config_exists.

It would be nice if check_extra_config and linux-info_pkg_setup supported /proc/config.gz for checking the kernel config.  However, *always* falling back to /proc/config.gz might make it harder to reliably build kernel modules.  For example, linux-mod.eclass uses:

  linux-info_pkg_setup;
  require_configured_kernel
  check_kernel_built;

to verify that a kernel is available for building modules against.  That's not going to work if the checks are using /proc/config.gz.  Perhaps an option to linux-info_pkg_setup, which was passed down through check_extra_config to require_configured_kernel that selected between linux_config_src_exists and linux_config_exists?


Reproducible: Always

Steps to Reproduce:
1. docker run --rm -it wking/gentoo-portage:20141023 /bin/bash
2. echo 'app-emulation/docker ~amd64' > /etc/portage/package.accept_keywords
3. emerge -v app-emulation/docker

Actual Results:  
The crash shown above.

Expected Results:  
A successfully installed Docker.

I can attach the emerge --info if you want, but the image is just stage3-amd64-20141023.tar.bz2 with a Portage tree from the same day.
Comment 1 Fpemud 2016-04-05 22:44:05 UTC
My system don't have /usr/src/linux since I use my own way to build linux kernel. Emerging fails for dev-lang/mono:

fpemud-workstation / # USE=minimal emerge -1 mono
Calculating dependencies... done!

>>> Verifying ebuild manifests
>>> Running pre-merge checks for dev-lang/mono-4.2.3.4
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * 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: dev-lang/mono-4.2.3.4::gentoo failed (pretend phase):
 *   Kernel not configured; no .config found in 
 * 
 * Call stack:
 *             ebuild.sh, line 133:  Called pkg_pretend
 *   mono-4.2.3.4.ebuild, line  44:  Called check_extra_config
 *     linux-info.eclass, line 734:  Called require_configured_kernel
 *     linux-info.eclass, line 297:  Called die
 * The specific snippet of code:
 *   		die "Kernel not configured; no .config found in ${KV_OUT_DIR}"

I don't see the reason why dev-lang/mono needs a full kernel source.
Comment 2 Fpemud 2016-04-05 23:05:45 UTC
For my problem above, I modified check_extra_config() in linux-info.eclass and successfully emerges dev-lang/mono.
Comment 3 Fpemud 2016-04-05 23:07:26 UTC
Created attachment 429716 [details, diff]
linux-info.eclass.patch
Comment 4 Mike Pagano gentoo-dev 2021-08-28 16:52:09 UTC
This support is currently in the eclass. Mono compiles without any /usr/src/linux/.config and a /proc/config.gz