Gentoo Archives: gentoo-server

From: Jean-Francois Maeyhieux <b4b1@××××.fr>
To: gentoo-server@l.g.o
Cc: gentoo-user@l.g.o
Subject: Re: [gentoo-server] Kernel configuration management
Date: Fri, 23 Nov 2012 12:22:55
Message-Id: 1353673717.22076.77.camel@localhost
In Reply to: [gentoo-server] Kernel configuration management by Matthias-Christian Ott
1 Hello,
2
3
4 kernel deployment is really a concern for our distribution.
5
6 I don't want be long on the topic but just give my own way.
7 I try to use the KISS principle as often as I could.
8 ( http://en.wikipedia.org/wiki/KISS_principle)
9
10 So I just manage one kernel for all servers.
11
12 - I use no module at all: good for security and easy for deployment, no
13 initrd creation and problems related.
14 - I have just created manually (the big part) my first kernel with all
15 the options I wish now and in the future. I try to stay really minimal
16 on hardware support.
17 - If I get new hardware, I add to the configuration options for this
18 specific hardware. Even if it's not in use on all servers.
19
20 This way, update are easy, you could use oldconfig to upgrade kernel
21 version and deployment is just about scp kernel,system.map files.
22
23 Since I don't use modules, specific arguments are specified on the grub
24 boot command line.
25
26
27 Few advices to test your kernel:
28
29 1) use qemu to test your firsts kernel/grub boot
30 (http://en.gentoo-wiki.com/wiki/Grub2#Verifying_.28qemu.29)
31 This way you don't lost your time with kvmip or vnc to reconnect to
32 your server console to boot on a working kernel in case of boot failure.
33
34 2) use sys-apps/kexec-tools (http://en.gentoo-wiki.com/wiki/Kexec)
35
36 To don't wait time with BIOS/RAID/BOOTP init of your server once your
37 base kernel boot and you want adjust some options: make a new
38 configuration, compile it, deploy it (I use a script to chain everything
39 from oldconfig to deployment) and adjust kexec config file if needed
40 then reboot.
41 Kexec just replace the reboot sequence and permit to reboot on a new
42 kernel really quickly since it's bypass all BIOS/RAID/BOOTP
43 initializations by loading the new kernel and boot on it after an init
44 1. (on my servers, reboot this way take about 30s instead of 4 minutes)
45
46
47
48 That's my 2 cents.
49
50 Jean-Francois
51
52
53
54
55 On Tue, 2012-11-06 at 22:27 +0100, Matthias-Christian Ott wrote:
56 > I'm planning to migrate several computers to Gentoo. At the moment I'm
57 > running two machines with ad-hoc kernel configurations based on the
58 > kernel configuration from the installation CD (which was created for
59 > 2.6.26). In order to keep the maintenance effort for the new machines
60 > low, I would like to have a unified/baseline kernel configuration with
61 > minor adjustments for some machines.
62 >
63 > I have been thinking about this for several weeks now and came to the
64 > conclusion, that there are two sub-problems: Creating a universal kernel
65 > configuration and merging and maintaining specific configurations with
66 > the baseline configuration.
67 >
68 > The second problem can be solved by simple concatenation and/or
69 > defconfigman, kccmp and make silentoldconfig. OpenWRT does this pretty
70 > much the same way.
71 >
72 > Creating the baseline configuration is much harder. So far I tried make
73 > defconfig, the installation CD configuration and kernel-seeds.org. None
74 > really satisfied my requirements and often resulted in ad-hoc changes
75 > when I simply went through a compile and reboot cycle until everything
76 > worked. I had a look at policies of other GNU/Linux distributions [1,2]
77 > and found that I need to develop or adopt a policy for my systems (the
78 > Ubuntu "modular where possible" policy seems reasonable to me and
79 > probably makes the curent ad-hoc configuration unnecessary). I also
80 > thought about reusing kernel configurations from other distributions,
81 > but have some doubts about kernel version mismatches (i.e. the kernel
82 > versions of Gentoo and the other distribution differ) and about
83 > unintended implications of kernel options that I don't fully understand.
84 >
85 > The mailing list archives show that this topic has been partly discussed
86 > before (especially whether Gentoo should have a default kernel
87 > configuration like other distributions), so I don't want to start a
88 > lengthy discussion about this here. I'm more interested in what other
89 > people do for larger deployments/installations on heterogeneous hardware.
90 >
91 > Regards,
92 > Matthias-Christian
93 >
94 > [1] https://wiki.ubuntu.com/Kernel/Dev/KernelConfig
95 > [2] https://wiki.linaro.org/KernelConfigPolicyDraft
96 >