1 |
Am Donnerstag, 11. März 2021, 17:41:45 CET schrieb Peter Stuge: |
2 |
> Hi, |
3 |
> |
4 |
> Gerion Entrup wrote: |
5 |
> > the Linux kernel has _a lot of_ configuration options, way too many to configure them by hand. |
6 |
> |
7 |
> I actually disagree strongly with that; I think it's important to |
8 |
> actively decide what kernels include, and I routinely do, but of |
9 |
> course not everyone will. I've made sure to include a kernel build |
10 |
> when teaching systems administration courses and would again. |
11 |
> |
12 |
> As the kernel becomes more complex the threshold for the first |
13 |
> configuration also rises, but it's still completely possible to learn |
14 |
> what you need in order to successfully configure your own kernel. |
15 |
> I guess it's on the order of a weekend project given some basic |
16 |
> understanding of computer architecture and programming. |
17 |
|
18 |
I think, we mean two different things here. I for myself also configured |
19 |
my own kernel(s) for years. I also actively teach students to do so. |
20 |
However, I have never looked into all 18000 configuration options. I |
21 |
don't understand them all (by far). |
22 |
|
23 |
Actually, most of the times, I do a `make localmodconfig`, click through |
24 |
various subsystems and activate what I think that it is useful or sounds |
25 |
nice. Then, to update a kernel, I use `make oldconfig` and answer the |
26 |
questions as good as I can (taking the default otherwise). |
27 |
|
28 |
If my kernel is not capable to do something (for example run docker |
29 |
containers), I take a look in the Gentoo Wiki and "copy" the options |
30 |
into my own config. |
31 |
|
32 |
But for me, this is not an informed decision. Of course, I learn |
33 |
something in this process, maybe also more than a precompiled kernel |
34 |
user, but I have by far not created a minimal config or even begin |
35 |
to understand all subsystems and different configuration options. |
36 |
|
37 |
I'm sure that this is similar to most Gentoo users. |
38 |
|
39 |
BTW, here is a project to create a minimal config (kind of "ideal" |
40 |
config) based on a "golden run" [1]. However, I have not compared such |
41 |
a config with my own homegrown config. |
42 |
|
43 |
|
44 |
> > This requires a mapping between user oriented "features" and the kernel |
45 |
> > internal configuration options. |
46 |
> |
47 |
> So the challenge here is that the kernel is disjoint from user space, |
48 |
> and while the kernel API remains stable over time consumer requirements |
49 |
> such as "docker" or "cryptsetup" will mean different things for |
50 |
> different versions of particular user space software. |
51 |
> |
52 |
> |
53 |
> > Do you think that it is useful and feasible to combine these two mechanisms? |
54 |
> |
55 |
> AFAIK there's no generic method for formal kernel requirements in user |
56 |
> space packages and there's also no sanctioned method for quering |
57 |
> kernel capabilities. The only thing available is /proc/config if that |
58 |
> was enabled in the kernel build, and there are of course reasons to |
59 |
> leave it out, and it only applies to the particular running kernel, |
60 |
> e.g. useless for cross-compilation. There, it would be possible to |
61 |
> read the kernel configuration file if the kernel source code is |
62 |
> available when the userspace package is being built, but that's not |
63 |
> guaranteed. |
64 |
> |
65 |
> In Gentoo, linux-info.eclass provides linux_config_exists() to do all |
66 |
> of this, but order to become a widespread success there would have to |
67 |
> be one method for upstreams to maintain these requirements as part of |
68 |
> their packages, rather than forcing the burden on package maintainers |
69 |
> to repeat the same detective task in every single distribution. |
70 |
> |
71 |
> I think it would be very useful to create something generic for that, |
72 |
> but that's certainly no small task. |
73 |
> |
74 |
> And realistically I only see it succeeding if Linux Foundation decides |
75 |
> to push it onto the world. |
76 |
|
77 |
Sorry, I may have expressed this not clearly. I guess, we actually have |
78 |
the same opinion here. I don't want to do this mapping automatically. I |
79 |
don't want a "fully automatic" config or touch any (user space) ebuilds. |
80 |
|
81 |
My idea is to patch Kconfig (as part of gentoo-sources) to provide the |
82 |
same "features" (i.e. mappings) that are already present in the Gentoo |
83 |
wiki. |
84 |
|
85 |
For example this could result in this installation description for Docker |
86 |
(within the Wiki): |
87 |
"To enable kernel support for Docker, enable |
88 |
'Gentoo Linux -> Support for user space programs -> Docker'" |
89 |
|
90 |
This Kconfig flag than depends on all options that are needed for proper |
91 |
Docker support (as already described in the Wiki) like cgroups etc.. |
92 |
|
93 |
This would allow users to configure there kernels the same way as before |
94 |
but with some additional convenience shortcuts. |
95 |
|
96 |
Of course, this is a high maintenance burden for the kernel package |
97 |
maintainers. Therefore, this mechanism maybe can be automated: |
98 |
Grep the wiki pages for kernel config snippets and automatically |
99 |
condense that in a Kconfig readable configuration option. |
100 |
|
101 |
|
102 |
> > A possible way could be to automatically extract the kernel config |
103 |
> > flags from the wiki pages and map them to Kconfig options. |
104 |
> |
105 |
> At very best that will only be valid for some particular point in time, |
106 |
> like current CONFIG_CHECK in ebuilds using linux_config_exists() are |
107 |
> only valid for particular package versions. At worst it's plain wrong |
108 |
> because the requirements have to be reverse-engineered downstream. |
109 |
|
110 |
Of course, the already existing kernel config snippets in the Wiki are |
111 |
best effort. My idea is to combine these snippets directly with Kconfig. |
112 |
|
113 |
|
114 |
Best regards, |
115 |
Gerion |
116 |
|
117 |
[1] https://vamos.informatik.uni-erlangen.de/trac/undertaker/wiki/UndertakerTailor |