Gentoo Archives: gentoo-dev

From: Peter Stuge <peter@×××××.se>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Idea: User centric kernel configuration
Date: Thu, 11 Mar 2021 16:41:54
Message-Id: 20210311164145.31097.qmail@stuge.se
In Reply to: [gentoo-dev] Idea: User centric kernel configuration by Gerion Entrup
1 Hi,
2
3 Gerion Entrup wrote:
4 > the Linux kernel has _a lot of_ configuration options, way too many to configure them by hand.
5
6 I actually disagree strongly with that; I think it's important to
7 actively decide what kernels include, and I routinely do, but of
8 course not everyone will. I've made sure to include a kernel build
9 when teaching systems administration courses and would again.
10
11 As the kernel becomes more complex the threshold for the first
12 configuration also rises, but it's still completely possible to learn
13 what you need in order to successfully configure your own kernel.
14 I guess it's on the order of a weekend project given some basic
15 understanding of computer architecture and programming.
16
17
18 > This requires a mapping between user oriented "features" and the kernel
19 > internal configuration options.
20
21 So the challenge here is that the kernel is disjoint from user space,
22 and while the kernel API remains stable over time consumer requirements
23 such as "docker" or "cryptsetup" will mean different things for
24 different versions of particular user space software.
25
26
27 > Do you think that it is useful and feasible to combine these two mechanisms?
28
29 AFAIK there's no generic method for formal kernel requirements in user
30 space packages and there's also no sanctioned method for quering
31 kernel capabilities. The only thing available is /proc/config if that
32 was enabled in the kernel build, and there are of course reasons to
33 leave it out, and it only applies to the particular running kernel,
34 e.g. useless for cross-compilation. There, it would be possible to
35 read the kernel configuration file if the kernel source code is
36 available when the userspace package is being built, but that's not
37 guaranteed.
38
39 In Gentoo, linux-info.eclass provides linux_config_exists() to do all
40 of this, but order to become a widespread success there would have to
41 be one method for upstreams to maintain these requirements as part of
42 their packages, rather than forcing the burden on package maintainers
43 to repeat the same detective task in every single distribution.
44
45 I think it would be very useful to create something generic for that,
46 but that's certainly no small task.
47
48 And realistically I only see it succeeding if Linux Foundation decides
49 to push it onto the world.
50
51
52 > A possible way could be to automatically extract the kernel config
53 > flags from the wiki pages and map them to Kconfig options.
54
55 At very best that will only be valid for some particular point in time,
56 like current CONFIG_CHECK in ebuilds using linux_config_exists() are
57 only valid for particular package versions. At worst it's plain wrong
58 because the requirements have to be reverse-engineered downstream.
59
60
61 //Peter

Replies

Subject Author
Re: [gentoo-dev] Idea: User centric kernel configuration Gerion Entrup <gerion.entrup@×××××.de>