Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Kernel configuration is not preserved when upgrading kernel.
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
Budoka
l33t
l33t


Joined: 03 Jun 2012
Posts: 777
Location: Tokyo, Japan

PostPosted: Wed Jun 18, 2014 4:56 am    Post subject: Kernel configuration is not preserved when upgrading kernel. Reply with quote

OK. I have done enough kernel upgrades now that I can state unequivocally that my kernel config is not being saved between upgrades. I always have to go back into the new kernel and manually configure it...again, and again, and again.

I understand that it may totally be due to some mistake on my part so in another attempt to solve this problem will outline my process and hopefully someone can tell me where I am going wrong. The problem was also addressed briefly in a previous thread but was never resolved. https://forums.gentoo.org/viewtopic-t-953956-start-25-postdays-0-postorder-asc-highlight-.html

I am using https://wiki.gentoo.org/wiki/Kernel/Upgrade and https://wiki.gentoo.org/wiki/Kernel/Configuration.

So I can emerge the new kernel successfully. In most cases I am using Gentoo-Sources but in the future would like to use the hardened kernel.

I can successfully set the symlink using
Code:
eselect kernel
.

Then I copy the previous kernel config from
Code:
...the kernel directory of the currently-running kernel:
root # cp /usr/src/oldkernel/.config /usr/src/linux/
I have verified that the old config is being copied into the directory!

Then I run
Code:

root # cd /usr/src/linux
root # make oldconfig


Sometimes it asks me questions if new kernel options are available. I usually just select the default option.

Then I reinstall the kernel modules and compile.

I am running LUKS over LVM so use genkernel to compile that way it will build the initramfs for me.
Code:
genkernel --lvm --luks --menuconfig all


It will run and compile successfully. BUT, none of the old kernel options are preserved. Ever. I must go in and reconfigure them manually. I was initially clued in to this because since the cryptography options aren't preserved the kernel won't boot. Then when I started looking at other options that are required for my setup...and options I know I have set or tweaked none are preserved.

Can someone please tell me where I am going wrong? I tried compiling manually and then using genkernel for just the initramfs as outlined here http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=1&chap=7#doc_chap3 but the end result is the same. Config options are lost.
Back to top
View user's profile Send private message
Navar
Guru
Guru


Joined: 20 Aug 2012
Posts: 355
Location: usa

PostPosted: Wed Jun 18, 2014 6:07 am    Post subject: Reply with quote

Disclaimer: I have not used genkernel since 2010.

http://wiki.gentoo.org/wiki/Genkernel#Using_previous_kernel_configuration_while_changing_the_sources

I'd start checking from that aspect (genkernel). In particular, if doing the old school method of cp path/priorconfig newpath/, make oldconfig, etc. seems to be working fine--especially if a simple diff of the priorconfig and newly revised shows only some changes you'd expect. But remember, genkernel does its own way (/etc/kernels /etc/genkernel.conf, etc.) That wiki will explain further details.

I make use of the /proc/config.gz kernel feature, so a simple cd /usr/src/linux && pwd -P && uname -r followed by zcat /proc/config.gz >.config does the job for me with the usual make oldconfig. The former is done just to ensure where the link is actually set as most of my setups have immediately auto eselected the newly installed kernel source on a world update while some don't. I usually forget to look into what would resolve the cause to this inconsistency. Which later borks update requirements on other package updates from that without being prior prepared or re-eselecting active compiled kernel source :roll:. Almost seems one of the main uses for --keep-going).
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9932
Location: almost Mile High in the USA

PostPosted: Wed Jun 18, 2014 6:39 pm    Post subject: Reply with quote

"works for me" ... though between different versions of the kernel, technically speaking, all bets are off. You will still have to look through your config whether it be menuconfig or not, to make sure the options haven't changed in the new version.

Hence yes, I hate upgrading kernels. It _is_ a PITA. Even if I didn't have to reboot...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Wed Jun 18, 2014 7:47 pm    Post subject: Reply with quote

Budoka,

Code:
genkernel --lvm --luks --menuconfig all
with that command genkernel overwrites your carefully updated .config with its own and drops you into menuconfig.

From memory, I've never used genkernel, there is an option to tell it to use the .config it finds in /usr/src/linux.

See the Wiki, under Kernel Configuration file used by genkernel
_________________
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
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 665

PostPosted: Wed Jun 18, 2014 8:16 pm    Post subject: Reply with quote

In my experience, genkernel will save a successful .config under /etc/kernels.
Back to top
View user's profile Send private message
Budoka
l33t
l33t


Joined: 03 Jun 2012
Posts: 777
Location: Tokyo, Japan

PostPosted: Sat Jun 21, 2014 7:44 am    Post subject: Reply with quote

NeddySeagoon wrote:
Budoka,

Code:
genkernel --lvm --luks --menuconfig all
with that command genkernel overwrites your carefully updated .config with its own and drops you into menuconfig.

From memory, I've never used genkernel, there is an option to tell it to use the .config it finds in /usr/src/linux.

See the Wiki, under Kernel Configuration file used by genkernel


Hmm. OK. I guess that explains it. I was using genkernel because at the moment creating an initramfs is outside of my limited skill set.

I checked the link you provided and it seems that there are two options that I could utilize.

Quote:
--oldconfig
Issues the make oldconfig command, which attempts to collect configuration information for the system's architecture from a generic script in /usr/share/genkernel. This is a non-interactive process; no user input is entertained. Also, if --oldconfig is used in conjunction with --clean, the latter option is negated, resulting in the activation of the --no-clean option.


Quote:
--kernel-config=/path/to/config-file
Specifies what alternative kernel configuration will be used, rather than the default /path/to/sources/.config file.


The
Code:
--oldconfig
option is a little confusing to me. When I ran "make oldconfig" on my own I had about 15 new kernel options that I was prompted to select. With the oldconfig option appended to genkernel command I wasn't prompted for anything. It indicates that "no user input is entertained" in the description but does that mean it is accepting all the default answers for new kernel options automatically?

It sounds like my best option at the moment is to continue as I have been but pass the
Quote:
--kernel-config=/path/to/config-file
that way I can still select new kernel options when running make oldconfig. Does this sound correct?
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Sat Jun 21, 2014 9:08 am    Post subject: Reply with quote

From my experience "make oldconfig" leads to unpredictable results.
If I want to build new kernel with old .config I just copying it to new sources directory, navigating to this directory and starting "make && make modules_install" without any .config changes. If new kernel has some new options that missed in old .config - you will be asked for these options during compilation and your answers will be saved into .config automatically.
Back to top
View user's profile Send private message
kick6
n00b
n00b


Joined: 22 Jan 2005
Posts: 29
Location: Golden, Colorado

PostPosted: Thu Jun 26, 2014 6:28 pm    Post subject: Reply with quote

Budoka wrote:


Hmm. OK. I guess that explains it. I was using genkernel because at the moment creating an initramfs is outside of my limited skill set.



What about having genkernel only build your initramfs?

Code:
genkernel --lvm --luks initramfs



should do it.
Back to top
View user's profile Send private message
N8Fear
Tux's lil' helper
Tux's lil' helper


Joined: 15 Apr 2013
Posts: 140
Location: Berlin (Germany)

PostPosted: Thu Jun 26, 2014 10:40 pm    Post subject: Reply with quote

creaker wrote:
From my experience "make oldconfig" leads to unpredictable results.
If I want to build new kernel with old .config I just copying it to new sources directory, navigating to this directory and starting "make && make modules_install" without any .config changes. If new kernel has some new options that missed in old .config - you will be asked for these options during compilation and your answers will be saved into .config automatically.


make oldconfig actually depends on an existing .config file. It'll only ask for new settings. You run it anyways actually: if you pay attention to the output of the kernel build you'll see that it runs make silentoldconfig anyways... :wink:
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