Gentoo Archives: gentoo-user

From: Paige Thompson <spam@××××××××××.sx>
To: "gentoo-user@l.g.o" <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] Re: Using an old kernel .config as the basis for a new .config
Date: Fri, 29 Dec 2017 01:24:37
Message-Id: 1a9b60fec5f541e8bb4232d9b3a4c839@yourstruly.sx
In Reply to: [gentoo-user] Re: Using an old kernel .config as the basis for a new .config by Kai Krakow
1 From: Kai Krakow <hurikhan77@×××××.com>
2 Sent: Thursday, December 28, 2017 4:58 PM
3 To: gentoo-user@l.g.o
4 Cc: Spam Account
5 Subject: [gentoo-user] Re: Using an old kernel .config as the basis for a new .config
6
7 Am Thu, 28 Dec 2017 15:05:04 -0500 schrieb Jack:
8
9 > On 2017.12.28 14:52, Alan Mackenzie wrote:
10 >> Hello, Gentoo.
11 >>
12 >> Having just built linux-4.14.7-gentoo, suddenly a new version of the
13 >> kernel, linux-4.14.8-gentoo-r1 has become stable. Configuring a kernel
14 >> from scratch is a repetitive drudge.
15 >>
16 >> There is some way of initialising a new kernel .config from an existing
17 >> one, I am sure, but I can't find it. I've looked at the Gentoo wiki,
18 >> I've looked at (some of) the kernel's own documentation. The nearest I
19 >> can find is make oldconfig, which supposedly does what I want, but it
20 >> just seems to start off with a default .config and go through the
21 >> hundreds of questions one at a time.
22 >>
23 >> So, would some kind soul please tell me how to get my old .config into
24 >> a new one properly. Thanks!
25 >
26 > You need to copy your old .config into the new kernel source directory.
27 > "make oldconfig" then uses those values, and only asks you about new
28 > items. It sounds like it was asking about everything because it didn't
29 > have the old file as a starting point - so was starting from scratch.
30
31 You actually even don't have to copy the old config file as long as the
32 currently running system provides the config you want to migrate.
33
34 You can just run
35
36 # make oldconfig
37
38 and it will figure out the config, looking at the current directory
39 first. It will then interactively ask for each new config option. You can
40 type "?" at each step to get a description. This is the way I do it.
41
42 I only copy a .config file if I want a specific known base configuration.
43
44 You can then run
45
46 # make menuconfig
47
48 to further fine-tune your decisions, or
49
50 # make localmodconfig
51
52 to disable modules not currently loaded. You should double-check it
53 didn't disable important stuff. Take a backup of .config first, then run
54 a diff. If in doubt, leave an option enabled as module.
55
56
57 # make olddefconfig
58
59 Doesn't ask questions but instead uses defaults. I wouldn't recommend
60 this if you are already running optimized manual configs.
61
62
63 There are many more (and interesting ones), have a look at
64
65 # make help
66
67
68 You can also "emerge -a kergen" and let it build a .config based on and
69 optimized for your hardware, tho it didn't work too well for me. You may
70 want to double check what it does, and then manually change the config.
71 You can also use it to migrate configs between kernel upgrades.
72
73
74 --
75 Regards,
76 Kai
77
78 Replies to list-only preferred.
79
80 ________________________________________
81 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:
82
83 ➜ kernels ls -l
84 total 4452
85 -rw-r--r-- 1 root root 183895 May 22 2017 kernel-config-x86_64-4.10.10-aufs
86 -rw-r--r-- 1 root root 183895 May 22 2017 kernel-config-x86_64-4.10.11-aufs
87 -rw-r--r-- 1 root root 183895 May 22 2017 kernel-config-x86_64-4.10.12-aufs
88 -rw-r--r-- 1 root root 183895 May 22 2017 kernel-config-x86_64-4.10.13-aufs
89 -rw-r--r-- 1 root root 183895 May 22 2017 kernel-config-x86_64-4.10.14-aufs
90 -rw-r--r-- 1 root root 183895 May 22 2017 kernel-config-x86_64-4.10.15-aufs
91 -rw-r--r-- 1 root root 183894 May 22 2017 kernel-config-x86_64-4.10.8-aufs
92 -rw-r--r-- 1 root root 183894 May 22 2017 kernel-config-x86_64-4.10.9-aufs
93 -rw-r--r-- 1 root root 168142 May 22 2017 kernel-config-x86_64-4.4.52-aufs
94 -rw-r--r-- 1 root root 168109 May 22 2017 kernel-config-x86_64-4.4.65-aufs
95 -rw-r--r-- 1 root root 168109 May 22 2017 kernel-config-x86_64-4.4.66-aufs
96 -rw-r--r-- 1 root root 176132 Aug 3 16:36 kernel-config-x86_64-4.4.67-aufs
97 -rw-r--r-- 1 root root 181019 Sep 12 2016 kernel-config-x86_64-4.6.3-gentoo
98 -rw-r--r-- 1 root root 182663 Oct 2 2016 kernel-config-x86_64-4.7.3-gentoo
99 -rw-r--r-- 1 root root 178168 Nov 17 2016 kernel-config-x86_64-4.8.0-gentoo
100 -rw-r--r-- 1 root root 178213 Dec 25 2016 kernel-config-x86_64-4.8.9-gentoo
101 -rw-r--r-- 1 root root 180503 Jan 13 2017 kernel-config-x86_64-4.9.0-gentoo
102 -rw-r--r-- 1 root root 180737 Mar 28 2017 kernel-config-x86_64-4.9.10-gentoo
103 -rw-r--r-- 1 root root 181246 May 22 2017 kernel-config-x86_64-4.9.16-aufs
104 -rw-r--r-- 1 root root 180734 May 14 2017 kernel-config-x86_64-4.9.16-gentoo
105 -rw-r--r-- 1 root root 181246 May 22 2017 kernel-config-x86_64-4.9.25-aufs
106 -rw-r--r-- 1 root root 181246 May 22 2017 kernel-config-x86_64-4.9.26-aufs
107 -rw-r--r-- 1 root root 181246 May 22 2017 kernel-config-x86_64-4.9.27-aufs
108 -rw-r--r-- 1 root root 180654 Feb 8 2017 kernel-config-x86_64-4.9.2-gentoo
109 -rw-r--r-- 1 root root 183895 May 22 2017 kernel-config-x86_64-linux-aufs ➜ kernels
110
111 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:
112
113 OLDCONFIG="yes"
114 MENUCONFIG="no"
115 CLEAN="yes"
116 MRPROPER="yes"
117 MOUNTBOOT="yes"
118 SAVE_CONFIG="yes"
119 USECOLOR="yes"
120 MAKEOPTS="$(portageq envvar MAKEOPTS)"
121 LVM="yes"
122 LUKS="yes"
123 GPG="yes"
124 BUSYBOX="yes"
125 MDADM="yes"
126 MDADM_CONFIG="/etc/mdadm.conf"
127 E2FSPROGS="yes"
128 BTRFS="yes"
129 FIRMWARE_DIR="/lib/firmware"
130 DISKLABEL="yes"
131 SPLASH_THEME="gentoo"
132 TMPDIR="/tmp/genkernel"
133 BOOTDIR="/boot"
134 GK_SHARE="${GK_SHARE:-/usr/share/genkernel}"
135 CACHE_DIR="/var/cache/genkernel"
136 DISTDIR="${GK_SHARE}/distfiles"
137 LOGFILE="/var/log/genkernel.log"
138 LOGLEVEL=3
139 DEFAULT_KERNEL_SOURCE="/usr/src/linux"
140 DEFAULT_KERNEL_CONFIG=/root/my_kernel_config
141 ALLRAMDISKMODULES="1"
142 COMPRESS_INITRD="yes"
143 COMPRESS_INITRD_TYPE="best"