Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Consistency in kernel compilation: Need tips.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2562

PostPosted: Thu Jan 01, 2015 11:59 pm    Post subject: Consistency in kernel compilation: Need tips. Reply with quote

Hi,

I have a problem with kernel consistency. I keep dropping features from one version to the next, and some other features seem to creep in.

I'm on the verge of writing a tool, but I want to make sure that some other tool doesn't exist already. Here's my intended process:

Code:

make defconfig
unset_banned
set_wanted


So rather than 'make oldconfig' which tries to copy your entire config from the last version, I want to take whatever the current default config is, because for the most part I don't care.

To start, I would make a kernel config with 'make defconfig' on my current setup. Then I would go through and set things the way I want, and save that kernel separately.

Once I do that, I'm thinking to diff the default config with the new one, and break that diff up into 2 parts: The things I turned off into one file and the things I turned on into another.

Then my two scripts (or two steps of the same script?) would apply the changes I want and, most importantly, complain if something I expected isn't there.

Does somebody already have this? Hate to spend the time if it's already out there.

Thanks.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7071

PostPosted: Sat Jan 03, 2015 11:04 pm    Post subject: Reply with quote

why not make silentoldconfig?
Anything new will be add as default
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43383
Location: 56N 3W

PostPosted: Sat Jan 03, 2015 11:09 pm    Post subject: Reply with quote

1clue,

Copy .config from one kernel to the next.
In the new kernel, run
Code:
make oldconfig

This will silently drop any options that no longer exist in the new kernel, port over your existiting settings and ask you how to set any new options.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3121
Location: Illinois, USA

PostPosted: Sun Jan 04, 2015 12:31 am    Post subject: Reply with quote

One simple script
Code:
#! /bin/bash

zcat /proc/config.gz >/root/config.now
cp /root/config.now /usr/src/linux/.config
cd /usr/src/linux
make oldconfig
cp .config /root/config.new
genkernel --menuconfig --install --kernel-config=/root/config.new  --bootloader=grub all


If you don't use genkernel, just substitute your usual commands. This will work fine starting with a kernel that has CONFIG_IKCONFIG=y and
CONFIG_IKCONFIG_PROC=y These store a copy of your configuration in the kernel where they are available as /proc/config.gz

When you emerge gentoo-sources a new default .config is set. Using this trick you can be sure you are starting from your existing working config instead of the default.


Last edited by Tony0945 on Sun Jan 04, 2015 12:34 am; edited 1 time in total
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2585

PostPosted: Sun Jan 04, 2015 12:33 am    Post subject: Re: Consistency in kernel compilation: Need tips. Reply with quote

1clue wrote:
So rather than 'make oldconfig' which tries to copy your entire config from the last version, I want to take whatever the current default config is, because for the most part I don't care.
This seems mutually exclusive to me. If you don't care, I would think that make oldnoconfig would be ideal for you and if you do care, make oldconfig followed by some diffing would seem to be the way to go.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2562

PostPosted: Sun Jan 04, 2015 1:41 am    Post subject: Reply with quote

Problems with oldconfig:

  1. I don't want it to silently drop old values. I want to get yelled at by the script so I can find out what happened and how to get the same functionality in the new kernel.
  2. oldconfig takes the old values no matter what they were whenin most cases i want the default for the new kernel.
  3. there are some values I want to keep, for drivers and functionality I need. The rest I want the default
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10306
Location: Córdoba (Spain)

PostPosted: Sun Jan 04, 2015 8:51 am    Post subject: Reply with quote

So you want a script that sometimes will use defaults and some other times will use value inherited from a previous config... This obviously won't work at all unless you have a consistent condition or criterion upon which to base when to go in one way or the opposite one.

Other than loosely grepping values and editing with sed I see no way to do what you want in an automated fashion. I don't know of a way to set CONFIG_ options at the make command line, and I am not taking into account the fact that a given driver or option might have different dependencies in two kernel versions, so, to do this correctly, you would need a way to ensure that the configuration is sane...
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43383
Location: 56N 3W

PostPosted: Sun Jan 04, 2015 10:18 am    Post subject: Reply with quote

1clue,

In response to your points.

1. Its very rare that there are any issues with dropping old config values.
They go through a depreciation stage first, so you tend to notice.
e.g. dmesg warnings.

2. Seems confused. How do you know you want the defaults, when you don't know what they are?
You also assume the defaults are sane on your arch, which is not true.
Do you recall the kernel that shipped with a default of PCI off for x86 and amd64?

3. is a subset of 2

None of this avoids the need to sanity check for the bare minimum you need to boot, but I've rarely seen problems.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2562

PostPosted: Sun Jan 04, 2015 4:18 pm    Post subject: Reply with quote

I thought we were past irrational defaults for defconfig.

I used kernel-seeds for awhile but since that no longer seems to be maintained I'm trying to avoid hours long kernel config sessions. I can read the help but that doesn't always make clear if the functionality is needed in a normal server or workstation.

It seems that every time I monkey around with the settings I lose something I wanted to be in there.

I guess what I'm after is going to have to be based on oldconfig rather than defconfig. I still want a script to force on certain settings so i can run it after I manually mess with menuconfig.

I guess it's time to dust off my sed and awk skills.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43383
Location: 56N 3W

PostPosted: Sun Jan 04, 2015 5:19 pm    Post subject: Reply with quote

1clue,

Don't mess with the .config file with a text editor or text processor. Ever.
The warning at the top means what it says.

The problem is that some menuconfig options fllp several flags in the .config file.
If you only get some of a group, you will have an illegal config file that often causes hard to find kernel bugs.
The config utilites flip the groups properly - if not, thats a kernel bug. If you mess up, you may get a broken kernel in a way that's not obvious.
You will need to take into account the sets and depends on in the kernel
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2562

PostPosted: Sun Jan 04, 2015 5:41 pm    Post subject: Reply with quote

I guess that makes the scripting part easier. I can at least grep the .config for settings I want and have it complain when they're wrong.
Back to top
View user's profile Send private message
EmaRsk
Apprentice
Apprentice


Joined: 07 Sep 2004
Posts: 158
Location: Italy

PostPosted: Sun Jan 04, 2015 8:59 pm    Post subject: Reply with quote

1clue, if you really want to go with your idea, you may want to look at scripts/config in the kernel source.
It's a bash script to set/unset options from the command line. I have no idea if it's robust enough and I never used it, I just found about it in some tutorial, but I suppose you could make a script with
Code:
./scripts/config --disable SOME_OPTION
./scripts/config --enable SOME_OTHER_OPTION
./scripts/config --module SOMETHING_ELSE
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2562

PostPosted: Mon Jan 05, 2015 1:24 am    Post subject: Reply with quote

Oh, my goodness!

I'll research it and see how good it is, but if that works then this is EXACTLY what I want.

Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum