# Can Portage do a sanity check on your Kernel settings?

## Spankin Partier

While upgrading your Kernel, is it possible for Portage to do a sanity check on your configuration to insure all required or suggested Kernel settings are included based on the packages installed on your system?

For example, when installing a new package or upgrading an existing package, Portage will sometimes run a check on your Kernel settings to see if required settings set and if not it'll respond with a message like:

 *Quote:*   

> WARN: postinst
> 
> The following test report contains a missing kernel configuration option that you need,
> 
> you should reconfigure and rebuild your kernel before running FOO.
> ...

 

Ideally I would like to configure my Kernel, run the checks based on my @world, and then build, install and test it.  For with 1000+ packages installed, I'm bound to forget something.  :Wink: 

----------

## NeddySeagoon

Spankin Partier,

Its not very practical and the build time checks are at best, informational.

What kernel should portage check against?

The running kernel?

The kernel pointed to by /usr/src/linux, which may not be the running kernel.

What about when you are cross compiling?

It may be possible to write an external tool to do what you suggest but I don't know of one.

----------

## augustin

I think that generally, it is a very good idea.

Likely technical or human constraints should not prevent us from brainstorming together and start documenting a specific proposal, including a possible technical implementation.

Having just wasted many, many hours (days...) on trying to make sense of kernel configurations, I'd like to contribute by volunteering to document things...

----------

## NeddySeagoon

augustin,

There is the kernel context sensitive help and the now unmaintained kernel-seeds.

----------

## augustin

Cool, thanks. I added kernel seeds to this help page: http://linux.overshoot.tv/wiki/find_which_linux_modules_are_used_or_needed

Plenty of scattered resources do exist to help newbies with configuring their kernels. But running linux in general and gentoo linux in particular shouldn't require the user to become an expert in everything. 

The kind of tool suggested by Spankin Partier is at least an order of magnitude above anything that currently exists and would include the total of our collective knowledge about hardware and software requirements and linux kernel settings. 

Obviously, this tool will not write itself. We can still start to flesh out the proposal and the proposed technical implementation, and maybe one day someone will come forward who is both competent and willing to implement it.

http://linux.overshoot.tv/wiki/proposed_tool_check_kernel_configuration

----------

## NeddySeagoon

augustin,

Wouldn't that Wiki page fit better at wiki.gentoo.org?

----------

## Jaglover

http://kmuto.jp/debian/hcl/index.rhtml is outdated, not a single device in my computer is supported if I was to believe it. My computer is more than a year old. I find https://cateee.net/lkddb/ useful.

 *Quote:*   

> But running linux in general and gentoo linux in particular shouldn't require the user to become an expert in everything.

 

Not in everything, just in job at hand. Ebuilds for packages which need specific kernel options notify the user, that's enough for me. BTW, it is Gentoo Linux not gentoo linux.

----------

## augustin

NeddySeagoon,

Sure! If there is some real interest.  :Smile: Last edited by augustin on Wed Dec 14, 2016 4:25 am; edited 1 time in total

----------

## netfab

See bug #532674.

----------

## augustin

 *Jaglover wrote:*   

> http://kmuto.jp/debian/hcl/index.rhtml is outdated, not a single device in my computer is supported if I was to believe it. My computer is more than a year old. I find https://cateee.net/lkddb/ useful.
> 
> 

 

Is https://cateee.net/lkddb/ still maintained? The latest news dates back to 2007!! I had found this a few days ago but was unable to make sense of it, as I am battling various configuration and stability issues on my system. 

Regarding http://kmuto.jp/debian/hcl/index.rhtml , it appears to be still maintained, but can only be kept up to date if user contribute information about new hardware. 

In any case, generally speaking, Linux hardware and Linux kernel settings and the interaction between both is such a vast and complicated subject, with countless variations of hardware and system settings combinations, that any single user or even any single distribution project is doom to fail and not to be updated in a timely fashion. Also, a web-based tool is not appropriate. 

It has to be a script with a text-based database that can be version controlled and patched against. It has to be a 'simple', low-level tool that is useful to the whole wide Linux community, so that the whole Linux community starts to depend on it and offers patches to keep the tool's internal database up to date.

With this tool, we could create 'profiles', with each profile corresponding to a system or a computer. I could have my own profile called "My home computer", and I could configure this profile with the make of the motherboard within my computer, and the graphic card that I know I have plugged in into it, and the filesystems I know I am using in my hard drives, and the hardware I know I regularly plug into my computer.... and the script would perform the sanity check described above, against a given linux kernel .config file, and inform me about mis-configurations or possibly automatically disable kernel drivers for hardware that are not within my profile.

From the Gentoo perspective, portage could check emerged packages against that profile and provide additional information and possibly automatically adjust the profile according to specific package requirements.

----------

## augustin

I am thinking about how to name this tool. 

The phrase "Kernel Profile" came to mind, as it would mean profiling a kernel .config against a hardware/system settings/installed packaged configuration. 

However, searching the interwebs, I find that "kernel profiling" currently implies something else.

----------

## Spankin Partier

 *netfab wrote:*   

> See bug #532674.

 

Yes this is pretty much exactly what I was considering.

Neddy, my thoughts on what this should test to would be the /usr/src/linux simlink, as thats what the ebuilds check to currently, and why we have, and are supose to maintain that simlink.

I never intended to use this to aid in configuring hardware or anything like that.  But just to ensure installed ebuilds have the kernel configurations they require/recommend for full functionality.

----------

