1 |
Hello everyone! |
2 |
|
3 |
|
4 |
There are at least two sets of kernel configs in Gentoo: those in |
5 |
genkernel [1] and those used with Gentoo live media [2]. |
6 |
|
7 |
Currently these configs are stored as a set of varying .config files. |
8 |
This approach has a number of drawbacks: |
9 |
|
10 |
- Keeping all arches in sync is cumbersome and prone to error |
11 |
|
12 |
- No one really dares to touch non-mainstream configs and often |
13 |
changes end up at x84 and x86_64 only. |
14 |
|
15 |
- The config files carry no documentation on |
16 |
|
17 |
- why a certain option was enabled or disabled and |
18 |
|
19 |
- if that option is (A) default, (B) an intended choice or |
20 |
(C) a consequence from a dependency, |
21 |
|
22 |
which makes well-informed changes hard and means carrying |
23 |
around lots of defaults of little value |
24 |
|
25 |
I would like to discuss an idea of mine on improving the situation. |
26 |
What if we had a single file with rules (declarative) or instructions |
27 |
(imperative) like this: |
28 |
|
29 |
if arch x86_64 |
30 |
# x86_64 doesn't like foo, therefore we do bar (bug #123456) |
31 |
CONFIG_ABC=y |
32 |
else |
33 |
CONFIG_ABC=N |
34 |
fi |
35 |
|
36 |
A tool would then |
37 |
|
38 |
1) take defconfig of the arch (of any version of the kernel) |
39 |
|
40 |
2) apply the requested changes |
41 |
|
42 |
3) run "make silentoldconfig"(?) to fix config dependencies |
43 |
|
44 |
Conditional checks could work on: arch, kernel version, |
45 |
desktop/liveDVD/netboot environment, etc. |
46 |
|
47 |
|
48 |
Would that work in theory? I suppose it would be easy to rip out the |
49 |
part from the kernel necessary to make use of its "make silentoldconfig" |
50 |
logic without re-implementing things. For 2.6.39.1 this tar command |
51 |
seemed to ripp everything needed: |
52 |
|
53 |
tar xf linux-2.6.39.1.tar.bz2 --wildcards \ |
54 |
"*/Kconfig*" \ |
55 |
"linux-*/scripts/" \ |
56 |
"linux-*/arch/" \ |
57 |
"linux-*/Makefile" |
58 |
|
59 |
A problem I am facing though is: how do I "make silentoldconfig" as if I |
60 |
were on say sparc on my x86_64 box. Is that that no problem, a small or |
61 |
a big one? Plain overridding of ARCH got me into compile errors. |
62 |
|
63 |
Ignoring the work needed to reverse document our current configs for |
64 |
now: What do you think about such an approach? |
65 |
|
66 |
Thanks for your feedback, best, |
67 |
|
68 |
|
69 |
|
70 |
Sebastian |
71 |
|
72 |
|
73 |
[1] |
74 |
http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=tree;f=arch;hb=master |
75 |
[2] |
76 |
http://sources.gentoo.org/cgi-bin/viewvc.cgi/releng/trunk/releases/weekly/kconfig/ |