public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Using an old kernel .config as the basis for a new .config
@ 2017-12-28 19:52 Alan Mackenzie
  2017-12-28 20:05 ` Jack
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Alan Mackenzie @ 2017-12-28 19:52 UTC (permalink / raw
  To: gentoo-user

Hello, Gentoo.

Having just built linux-4.14.7-gentoo, suddenly a new version of the
kernel, linux-4.14.8-gentoo-r1 has become stable.  Configuring a kernel
from scratch is a repetitive drudge.

There is some way of initialising a new kernel .config from an existing
one, I am sure, but I can't find it.  I've looked at the Gentoo wiki,
I've looked at (some of) the kernel's own documentation.  The nearest I
can find is make oldconfig, which supposedly does what I want, but it
just seems to start off with a default .config and go through the
hundreds of questions one at a time.

So, would some kind soul please tell me how to get my old .config into a
new one properly.  Thanks!

-- 
Alan Mackenzie (Nuremberg, Germany).


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Using an old kernel .config as the basis for a new .config
  2017-12-28 19:52 [gentoo-user] Using an old kernel .config as the basis for a new .config Alan Mackenzie
@ 2017-12-28 20:05 ` Jack
  2017-12-28 20:13   ` Alan Mackenzie
                     ` (2 more replies)
  2017-12-28 20:24 ` [gentoo-user] " Francesco Turco
  2017-12-28 20:35 ` Ralph Seichter
  2 siblings, 3 replies; 9+ messages in thread
From: Jack @ 2017-12-28 20:05 UTC (permalink / raw
  To: gentoo-user

On 2017.12.28 14:52, Alan Mackenzie wrote:
> Hello, Gentoo.
> 
> Having just built linux-4.14.7-gentoo, suddenly a new version of the  
> kernel, linux-4.14.8-gentoo-r1 has become stable.  Configuring a  
> kernel from scratch is a repetitive drudge.
> 
> There is some way of initialising a new kernel .config from an  
> existing one, I am sure, but I can't find it.  I've looked at the  
> Gentoo wiki, I've looked at (some of) the kernel's own  
> documentation.  The nearest I can find is make oldconfig, which  
> supposedly does what I want, but it just seems to start off with a  
> default .config and go through the hundreds of questions one at a  
> time.
> 
> So, would some kind soul please tell me how to get my old .config  
> into a new one properly.  Thanks!

You need to copy your old .config into the new kernel source  
directory.  "make oldconfig" then uses those values, and only asks you  
about new items.  It sounds like it was asking about everything because  
it didn't have the old file as a starting point - so was starting from  
scratch.

Jack

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Using an old kernel .config as the basis for a new .config
  2017-12-28 20:05 ` Jack
@ 2017-12-28 20:13   ` Alan Mackenzie
  2017-12-28 20:16   ` Rich Freeman
  2017-12-29  0:58   ` [gentoo-user] " Kai Krakow
  2 siblings, 0 replies; 9+ messages in thread
From: Alan Mackenzie @ 2017-12-28 20:13 UTC (permalink / raw
  To: gentoo-user

Hello, Jack.

On Thu, Dec 28, 2017 at 15:05:04 -0500, Jack wrote:
> On 2017.12.28 14:52, Alan Mackenzie wrote:
> > Hello, Gentoo.

> > Having just built linux-4.14.7-gentoo, suddenly a new version of the  
> > kernel, linux-4.14.8-gentoo-r1 has become stable.  Configuring a  
> > kernel from scratch is a repetitive drudge.

> > There is some way of initialising a new kernel .config from an  
> > existing one, I am sure, but I can't find it.  I've looked at the  
> > Gentoo wiki, I've looked at (some of) the kernel's own  
> > documentation.  The nearest I can find is make oldconfig, which  
> > supposedly does what I want, but it just seems to start off with a  
> > default .config and go through the hundreds of questions one at a  
> > time.

> > So, would some kind soul please tell me how to get my old .config  
> > into a new one properly.  Thanks!

> You need to copy your old .config into the new kernel source  
> directory.  "make oldconfig" then uses those values, and only asks you  
> about new items.  It sounds like it was asking about everything because  
> it didn't have the old file as a starting point - so was starting from  
> scratch.

Thanks, that was exactly what I needed.  In the end, the configurer
didn't ask any questions.  It looks like there were no new options
introduced by 4.18.8-r1.

> Jack

-- 
Alan Mackenzie (Nuremberg, Germany).


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Using an old kernel .config as the basis for a new .config
  2017-12-28 20:05 ` Jack
  2017-12-28 20:13   ` Alan Mackenzie
@ 2017-12-28 20:16   ` Rich Freeman
  2017-12-28 20:31     ` Neil Bothwick
  2017-12-29  0:58   ` [gentoo-user] " Kai Krakow
  2 siblings, 1 reply; 9+ messages in thread
From: Rich Freeman @ 2017-12-28 20:16 UTC (permalink / raw
  To: gentoo-user

On Thu, Dec 28, 2017 at 3:05 PM, Jack <ostroffjh@users.sourceforge.net> wrote:
>
> You need to copy your old .config into the new kernel source directory.
> "make oldconfig" then uses those values, and only asks you about new items.

It will find an existing config in /boot if you have one named using
the upstream naming convention (which happens if you install the
kernel using make install on a vanilla kernel - I'm not sure about
genkernel or gentoo-sources offhand).

If you have /proc/config.gz enabled then you can also do a zcat
/proc/config.gz > .config to extract your current config.  I always
enable /proc/config.gz since it costs a few kb tops and comes in handy
anytime you're not sure what config you're running (though if you
built some modules after the fact it might not be entirely current).

-- 
Rich


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Using an old kernel .config as the basis for a new .config
  2017-12-28 19:52 [gentoo-user] Using an old kernel .config as the basis for a new .config Alan Mackenzie
  2017-12-28 20:05 ` Jack
@ 2017-12-28 20:24 ` Francesco Turco
  2017-12-28 20:35 ` Ralph Seichter
  2 siblings, 0 replies; 9+ messages in thread
From: Francesco Turco @ 2017-12-28 20:24 UTC (permalink / raw
  To: gentoo-user

On Thu, Dec 28, 2017, at 20:52, Alan Mackenzie wrote:
> There is some way of initialising a new kernel .config from an existing
> one, I am sure, but I can't find it.  I've looked at the Gentoo wiki,
> I've looked at (some of) the kernel's own documentation.  The nearest I
> can find is make oldconfig, which supposedly does what I want, but it
> just seems to start off with a default .config and go through the
> hundreds of questions one at a time.

What about: make olddefconfig
?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Using an old kernel .config as the basis for a new .config
  2017-12-28 20:16   ` Rich Freeman
@ 2017-12-28 20:31     ` Neil Bothwick
  0 siblings, 0 replies; 9+ messages in thread
From: Neil Bothwick @ 2017-12-28 20:31 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 413 bytes --]

On Thu, 28 Dec 2017 15:16:17 -0500, Rich Freeman wrote:

> It will find an existing config in /boot if you have one named using
> the upstream naming convention (which happens if you install the
> kernel using make install on a vanilla kernel - I'm not sure about
> genkernel or gentoo-sources offhand).

gentoo-sources does the same.


-- 
Neil Bothwick

Angular Momentum Makes The World Go 'Round

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Using an old kernel .config as the basis for a new .config
  2017-12-28 19:52 [gentoo-user] Using an old kernel .config as the basis for a new .config Alan Mackenzie
  2017-12-28 20:05 ` Jack
  2017-12-28 20:24 ` [gentoo-user] " Francesco Turco
@ 2017-12-28 20:35 ` Ralph Seichter
  2 siblings, 0 replies; 9+ messages in thread
From: Ralph Seichter @ 2017-12-28 20:35 UTC (permalink / raw
  To: gentoo-user

On 28.12.17 20:52, Alan Mackenzie wrote:

> There is some way of initialising a new kernel .config from an existing
> one, I am sure, but I can't find it.

If your previous kernel has IKCONFIG support(*) enabled, I recommend
these steps for a kernel update to keep as many configuration options
as possible:

# eselect kernel set {number}
# cd /usr/src/linux
# zcat /proc/config.gz > .config
# make silentoldconfig

-Ralph

(*) https://wiki.gentoo.org/wiki/Kernel/IKCONFIG_Support


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gentoo-user] Re: Using an old kernel .config as the basis for a new .config
  2017-12-28 20:05 ` Jack
  2017-12-28 20:13   ` Alan Mackenzie
  2017-12-28 20:16   ` Rich Freeman
@ 2017-12-29  0:58   ` Kai Krakow
  2017-12-29  1:24     ` Paige Thompson
  2 siblings, 1 reply; 9+ messages in thread
From: Kai Krakow @ 2017-12-29  0:58 UTC (permalink / raw
  To: gentoo-user

Am Thu, 28 Dec 2017 15:05:04 -0500 schrieb Jack:

> On 2017.12.28 14:52, Alan Mackenzie wrote:
>> Hello, Gentoo.
>> 
>> Having just built linux-4.14.7-gentoo, suddenly a new version of the
>> kernel, linux-4.14.8-gentoo-r1 has become stable.  Configuring a kernel
>> from scratch is a repetitive drudge.
>> 
>> There is some way of initialising a new kernel .config from an existing
>> one, I am sure, but I can't find it.  I've looked at the Gentoo wiki,
>> I've looked at (some of) the kernel's own documentation.  The nearest I
>> can find is make oldconfig, which supposedly does what I want, but it
>> just seems to start off with a default .config and go through the
>> hundreds of questions one at a time.
>> 
>> So, would some kind soul please tell me how to get my old .config into
>> a new one properly.  Thanks!
> 
> You need to copy your old .config into the new kernel source directory. 
> "make oldconfig" then uses those values, and only asks you about new
> items.  It sounds like it was asking about everything because it didn't
> have the old file as a starting point - so was starting from scratch.

You actually even don't have to copy the old config file as long as the 
currently running system provides the config you want to migrate.

You can just run

# make oldconfig

and it will figure out the config, looking at the current directory 
first. It will then interactively ask for each new config option. You can 
type "?" at each step to get a description. This is the way I do it.

I only copy a .config file if I want a specific known base configuration.

You can then run

# make menuconfig

to further fine-tune your decisions, or

# make localmodconfig

to disable modules not currently loaded. You should double-check it 
didn't disable important stuff. Take a backup of .config first, then run 
a diff. If in doubt, leave an option enabled as module.


# make olddefconfig

Doesn't ask questions but instead uses defaults. I wouldn't recommend 
this if you are already running optimized manual configs.


There are many more (and interesting ones), have a look at

# make help


You can also "emerge -a kergen" and let it build a .config based on and 
optimized for your hardware, tho it didn't work too well for me. You may 
want to double check what it does, and then manually change the config. 
You can also use it to migrate configs between kernel upgrades.


-- 
Regards,
Kai

Replies to list-only preferred.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Re: Using an old kernel .config as the basis for a new .config
  2017-12-29  0:58   ` [gentoo-user] " Kai Krakow
@ 2017-12-29  1:24     ` Paige Thompson
  0 siblings, 0 replies; 9+ messages in thread
From: Paige Thompson @ 2017-12-29  1:24 UTC (permalink / raw
  To: gentoo-user@lists.gentoo.org

From: Kai Krakow <hurikhan77@gmail.com>
Sent: Thursday, December 28, 2017 4:58 PM
To: gentoo-user@lists.gentoo.org
Cc: Spam Account
Subject: [gentoo-user] Re: Using an old kernel .config as the basis for a new .config

Am Thu, 28 Dec 2017 15:05:04 -0500 schrieb Jack:

> On 2017.12.28 14:52, Alan Mackenzie wrote:
>> Hello, Gentoo.
>>
>> Having just built linux-4.14.7-gentoo, suddenly a new version of the
>> kernel, linux-4.14.8-gentoo-r1 has become stable.  Configuring a kernel
>> from scratch is a repetitive drudge.
>>
>> There is some way of initialising a new kernel .config from an existing
>> one, I am sure, but I can't find it.  I've looked at the Gentoo wiki,
>> I've looked at (some of) the kernel's own documentation.  The nearest I
>> can find is make oldconfig, which supposedly does what I want, but it
>> just seems to start off with a default .config and go through the
>> hundreds of questions one at a time.
>>
>> So, would some kind soul please tell me how to get my old .config into
>> a new one properly.  Thanks!
>
> You need to copy your old .config into the new kernel source directory.
> "make oldconfig" then uses those values, and only asks you about new
> items.  It sounds like it was asking about everything because it didn't
> have the old file as a starting point - so was starting from scratch.

You actually even don't have to copy the old config file as long as the
currently running system provides the config you want to migrate.

You can just run

# make oldconfig

and it will figure out the config, looking at the current directory
first. It will then interactively ask for each new config option. You can
type "?" at each step to get a description. This is the way I do it.

I only copy a .config file if I want a specific known base configuration.

You can then run

# make menuconfig

to further fine-tune your decisions, or

# make localmodconfig

to disable modules not currently loaded. You should double-check it
didn't disable important stuff. Take a backup of .config first, then run
a diff. If in doubt, leave an option enabled as module.


# make olddefconfig

Doesn't ask questions but instead uses defaults. I wouldn't recommend
this if you are already running optimized manual configs.


There are many more (and interesting ones), have a look at

# make help


You can also "emerge -a kergen" and let it build a .config based on and
optimized for your hardware, tho it didn't work too well for me. You may
want to double check what it does, and then manually change the config.
You can also use it to migrate configs between kernel upgrades.


--
Regards,
Kai

Replies to list-only preferred.

________________________________________
If you were a genkernel user I'd say what I normally do is copy the current kernel config to match the name scheme of the new kernel / version:

➜  kernels ls -l
total 4452
-rw-r--r-- 1 root root 183895 May 22  2017 kernel-config-x86_64-4.10.10-aufs
-rw-r--r-- 1 root root 183895 May 22  2017 kernel-config-x86_64-4.10.11-aufs
-rw-r--r-- 1 root root 183895 May 22  2017 kernel-config-x86_64-4.10.12-aufs
-rw-r--r-- 1 root root 183895 May 22  2017 kernel-config-x86_64-4.10.13-aufs
-rw-r--r-- 1 root root 183895 May 22  2017 kernel-config-x86_64-4.10.14-aufs
-rw-r--r-- 1 root root 183895 May 22  2017 kernel-config-x86_64-4.10.15-aufs
-rw-r--r-- 1 root root 183894 May 22  2017 kernel-config-x86_64-4.10.8-aufs
-rw-r--r-- 1 root root 183894 May 22  2017 kernel-config-x86_64-4.10.9-aufs
-rw-r--r-- 1 root root 168142 May 22  2017 kernel-config-x86_64-4.4.52-aufs
-rw-r--r-- 1 root root 168109 May 22  2017 kernel-config-x86_64-4.4.65-aufs
-rw-r--r-- 1 root root 168109 May 22  2017 kernel-config-x86_64-4.4.66-aufs
-rw-r--r-- 1 root root 176132 Aug  3 16:36 kernel-config-x86_64-4.4.67-aufs
-rw-r--r-- 1 root root 181019 Sep 12  2016 kernel-config-x86_64-4.6.3-gentoo
-rw-r--r-- 1 root root 182663 Oct  2  2016 kernel-config-x86_64-4.7.3-gentoo
-rw-r--r-- 1 root root 178168 Nov 17  2016 kernel-config-x86_64-4.8.0-gentoo
-rw-r--r-- 1 root root 178213 Dec 25  2016 kernel-config-x86_64-4.8.9-gentoo
-rw-r--r-- 1 root root 180503 Jan 13  2017 kernel-config-x86_64-4.9.0-gentoo
-rw-r--r-- 1 root root 180737 Mar 28  2017 kernel-config-x86_64-4.9.10-gentoo
-rw-r--r-- 1 root root 181246 May 22  2017 kernel-config-x86_64-4.9.16-aufs
-rw-r--r-- 1 root root 180734 May 14  2017 kernel-config-x86_64-4.9.16-gentoo
-rw-r--r-- 1 root root 181246 May 22  2017 kernel-config-x86_64-4.9.25-aufs
-rw-r--r-- 1 root root 181246 May 22  2017 kernel-config-x86_64-4.9.26-aufs
-rw-r--r-- 1 root root 181246 May 22  2017 kernel-config-x86_64-4.9.27-aufs
-rw-r--r-- 1 root root 180654 Feb  8  2017 kernel-config-x86_64-4.9.2-gentoo
-rw-r--r-- 1 root root 183895 May 22  2017 kernel-config-x86_64-linux-aufs ➜  kernels

then after copying the file from the old version to a new version I just run `genkernel all` and that usually works just fine. Sometimes some options can get missed if the option name changes but it's rarely ever a problem; you usually find out pretty quick. I have changed some options in genkernel. If you'd like to try this for yourself you can probably also start with `zcat /proc/config.gz > /etc/kernels/kernel-config-<version_format_here> also here is my genkernel.conf: 

OLDCONFIG="yes"
MENUCONFIG="no"
CLEAN="yes"
MRPROPER="yes"
MOUNTBOOT="yes"
SAVE_CONFIG="yes"
USECOLOR="yes"
MAKEOPTS="$(portageq envvar MAKEOPTS)"
LVM="yes"
LUKS="yes"
GPG="yes"
BUSYBOX="yes"
MDADM="yes"
MDADM_CONFIG="/etc/mdadm.conf"
E2FSPROGS="yes"
BTRFS="yes"
FIRMWARE_DIR="/lib/firmware"
DISKLABEL="yes"
SPLASH_THEME="gentoo"
TMPDIR="/tmp/genkernel"
BOOTDIR="/boot"
GK_SHARE="${GK_SHARE:-/usr/share/genkernel}"
CACHE_DIR="/var/cache/genkernel"
DISTDIR="${GK_SHARE}/distfiles"
LOGFILE="/var/log/genkernel.log"
LOGLEVEL=3
DEFAULT_KERNEL_SOURCE="/usr/src/linux"
DEFAULT_KERNEL_CONFIG=/root/my_kernel_config
ALLRAMDISKMODULES="1"
COMPRESS_INITRD="yes"
COMPRESS_INITRD_TYPE="best"


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-12-29  1:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-28 19:52 [gentoo-user] Using an old kernel .config as the basis for a new .config Alan Mackenzie
2017-12-28 20:05 ` Jack
2017-12-28 20:13   ` Alan Mackenzie
2017-12-28 20:16   ` Rich Freeman
2017-12-28 20:31     ` Neil Bothwick
2017-12-29  0:58   ` [gentoo-user] " Kai Krakow
2017-12-29  1:24     ` Paige Thompson
2017-12-28 20:24 ` [gentoo-user] " Francesco Turco
2017-12-28 20:35 ` Ralph Seichter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox