Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 551430 - [Future EAPI] Remember kernel config options from packages
Summary: [Future EAPI] Remember kernel config options from packages
Status: CONFIRMED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: PMS/EAPI (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PMS/EAPI
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: future-eapi
  Show dependency tree
 
Reported: 2015-06-07 08:23 UTC by Jason Zaman
Modified: 2020-10-25 16:35 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Zaman gentoo-dev 2015-06-07 08:23:25 UTC
A lot of ebuilds check the current kernel config if it is missing some options that are required for the package. ie using linux-info.eclass check_extra_config.

Once the package is installed, there is no way to re-check all the options. On my server I generally rebuild the kernel infrequently and have forgotten if there are any recommended or required options by the time I do it next. Also There is no way to make sure I have not accidentally removed an option.

There should be an emaint kconfigcheck or similar tool that will check that a kernel is configured properly and list all the options that are missing.
Comment 1 Zac Medico gentoo-dev 2015-06-07 23:27:59 UTC
I've noticed that some ebuilds set the CONFIG_CHECK variable in pkg_pretend, and use conditional logic there. For example, xf86-video-ati/xf86-video-ati-7.5.0 does this:

pkg_pretend() {
	if use kernel_linux ; then
		if kernel_is -ge 3 9; then
			CONFIG_CHECK="~!DRM_RADEON_UMS ~!FB_RADEON"
		else
			CONFIG_CHECK="~DRM_RADEON_KMS ~!FB_RADEON"
		fi
	fi
	check_extra_config
}

We could have PMS specify a standard method for a package manager to obtain this information from the ebuild.
Comment 2 Zac Medico gentoo-dev 2015-06-07 23:34:01 UTC
Maybe we should have a way for linux-info.eclass to install the requested kernel settings in a file inside a /etc/kernel-config.d directory. Maybe it doesn't need to involve PMS?
Comment 3 Zac Medico gentoo-dev 2015-06-07 23:42:20 UTC
Considering that we have a doenvd function, maybe a dokernconfd helper makes sense?
Comment 4 Jason Zaman gentoo-dev 2015-06-08 08:19:14 UTC
(In reply to Zac Medico from comment #2)
> Maybe we should have a way for linux-info.eclass to install the requested
> kernel settings in a file inside a /etc/kernel-config.d directory. Maybe it
> doesn't need to involve PMS?

I was originally thinking something like this. Usually the tests involve the type of videocard or something which wont change, things like kernel_is -ge 3 9 makes this a lot more complicated. Another problem is if a new kernel comes out which changes a kconfig option, the files in /etc/kernel-config.d would not be updated without a revbump and a revbump would be unneccesary since the new kernel options do not affect the running machine at all.

Or perhaps we can change check_extra_config and then just call only the pkg_setup phase on packages that inherit linux-info. The problem is that some packages do it in pkg_setup() and some in pkg_pretend(). Kind of ugly but would be update-able easily when new kernels change options (such at the ati one above).
Comment 5 Manuel Rüger (RETIRED) gentoo-dev 2015-07-11 12:38:42 UTC
I'm using this script for that purpose:
https://gist.github.com/mrueg/cd19a20d2e712f61d2ea

Should we get that into gentoolkit? Maybe call it ekcc (e-kernel-config-check)?
Comment 6 Zac Medico gentoo-dev 2020-01-19 05:13:59 UTC
*** Bug 705806 has been marked as a duplicate of this bug. ***