Gentoo Archives: gentoo-dev

From: Nathaniel McCallum <npmccallum@g.o>
To: Greg KH <gregkh@g.o>
Cc: gentoo-dev@l.g.o, gentoo-core@l.g.o
Subject: [gentoo-dev] Re: [gentoo-core] Re: [gentoo-dev] GLEP 26 -- Handling kernels with portage
Date: Mon, 03 May 2004 04:31:21
Message-Id: 1083558574.28957.55.camel@aquinas.natemccallum.com
In Reply to: Re: [gentoo-dev] GLEP 26 -- Handling kernels with portage by Greg KH
1 On Sun, 2004-05-02 at 20:56 -0700, Greg KH wrote:
2 > On Sun, May 02, 2004 at 10:04:35PM -0400, Nathaniel McCallum wrote:
3 > > The new glep is here: http://www.gentoo.org/proj/en/glep/glep-0026.html
4 >
5 > My formal objections:
6 >
7 > Basically the idea is nice, but I think the proposed solution is not
8 > correct. Here is why I feel this way:
9 >
10 > > Stage 1 would be achieved through a seperate utility (perhaps like the
11 > > current genkernel). This utility would help the user configure the
12 > > kernel and any kernel/build related settings. This stage is optional
13 > > and would only be used if a person wanted a customized kernel
14 > > settings. One optional thought is to have this utility a part of the
15 > > base Gentoo system. That way there are less steps to make a custom
16 > > kernel.
17 >
18 > Why reinvent the wheel here? The kernel has a _wonderful_ configuration
19 > system already. It's provided in about 4 different interfaces at least
20 > (command line, ncurses, gtk, qt), and in library form. Are you
21 > proposing hooking into that library to do the configuration? If so,
22 > what is lacking in the current implementation that is needing another
23 > tool?
24
25 ok, perhaps the name is a little misleading. The program itself doesn't
26 generate .config files, it just manages all aspects of creating them.
27 To actually create the file, it just calls "make menuconfig" or whatever
28 is appropriate. However, what it does do is manage the config files
29 (not create them). And by that I simply mean making sure they get
30 copied to the right place, etc... This is not really much more than
31 genkernel does (if at all)
32
33 > > Stage 2 would be implimented through an eclass. This stage is not
34 > > optional. One would perform this step by typing "emerge kernel-name",
35 > > where "kernel-name" is the name of the kernel package you want to use
36 > > (ie. "gentoo-dev"). This package would have a "buildkernel" USE flag.
37 > > If the flag was not set, it would simply download and install sources
38 > > like we do currently. However, if the "buildkernel" flag is set,
39 > > portage will perform the following steps:
40 > >
41 > > 1. (as a dependency) download and install a tarball of "generic"
42 > > kernel config files.
43 >
44 > Is this really needed? Don't we already do this today?
45 Yes, but:
46 A. It isn't its own package. Therefore, kernel configs cannot be
47 version tracked by users. this is not good open development practice.
48 B. The BUILD system isn't integrated into portage.
49
50 > Does this work? As specified before, I really think you need the whole
51 > tree around in order to build external modules. Now with 2.6, building
52 > those modules is a world easier (1 line makefile), and it works if you
53 > are not root (no write access necessary). But again, all of this is
54 > already being addressed in the genkernel rewrite that is happening (and
55 > you can see it already in cvs.)
56
57 I'm pretty sure you don't need them all. However, even if you do, with
58 this idea, you can just keep them tarballed, rather than unpacked. This
59 still saves space.
60
61 >
62 > > Stage 3 would merely be an ebuild that constructs an initrd image for
63 > > either the running kernel or, lacking a running kernel, the newest
64 > > kernel installed (by version/date installed?). Initrd's can't be used
65 > > on all arches, so this ebuild can be keyword masked as appropriate.
66 > > The initrd package would also have a "bootsplash" USE flag (on x86,
67 > > maybe others) that would build in bootsplash support. Any non-default
68 > > actions desired by the user can be handled with the utility from Stage
69 > > 1.
70 >
71 > So "bootsplash" will be the only USE flag? Why stop there?
72 >
73 > Oh, and initrd images are dead. I predict that by the end of this year
74 > we will not be using them at all, as there is no need to (other distros
75 > are already proving this is possible.) We also get a much more
76 > flexible, portable (works on all platforms) and cleaner implementation
77 > with initramfs, so that is what we will be moving to soon. So your
78 > "initrd" options are pretty moot.
79
80 Fine, but people use them now, so we need to support them. However,
81 with the abstraction of initrd into its own ebuild, when initrd's go by
82 the wayside, just make a new initramfs ebuild.
83
84 >
85 > > There are many advantages gained by this method:
86 > >
87 > > 1. Full arch support (GentooInstaller really could use this)
88 >
89 > We should fix genkernel to do this, if it doesn't already today. There
90 > is no reason this should not be possible today without a total rework.
91
92 True, but why fix something that isn't integrated into portage? Plus,
93 it is much easier to fix/maintain things when they are cleanly
94 abstracted. This is not at all the case with genkernel.
95
96 > > 2. More consistent with the rest of portage (installs binaries
97 > > by building from source)
98 >
99 > True, it isn't as "clean"
100 >
101 > > 3. Better user experience
102 >
103 > You forgot "mom and apple pie" here too :)
104
105 You joke, but think about being able to manage kernels from porthole
106 (http://porthole.sf.net)? or another application? It really does add to
107 better user experience.
108
109 > > 4. More flexability (genkernel forces building of initrd on x86)
110 >
111 > I've already outlined the issues of initrd going away, so this isn't an
112 > issue.
113
114 Even if initrd DOES go away, all the more reason to integrate into
115 portage. I mean, you'll be rewriting over half of genkernel anyway!
116
117 Better to just abstract the stuff first...
118
119 > > 5. Don't have to store full kernel sources (each source tree is
120 > > ~200MB unpacked)
121 >
122 > You don't have to that today if you don't want to build any other kernel
123 > modules that are outside of the main kernel tree. I have a number of
124 > boxes set up this way right now. In fact, those boxes do not even have
125 > a single kernel package on them at all, I just rolled my own and
126 > installed it. Once of the niceties of Gentoo is that you do not have to
127 > install a Gentoo kernel in order to have a working box (which for my
128 > job, is a very good thing.)
129
130 But try installing a kernel, building it, then emerge -C'ing it. You
131 are left with all the extra junk behind. YES, I know that this is the
132 correct behavior, and I agree. However, it is sloppy. Adding the
133 building into portage cleans that up while still maintaining correct
134 behavior.
135
136
137 > > 6. Creates the ability to make binary kernel packages for fast
138 > > installs (think GRP kernel)
139 >
140 > I see no where in your proposal for how this will be accomplished. In
141 > fact, this is the first place in the GLEP that "binary kernel packages"
142 > are even mentioned. Please either add the description of how you are
143 > going to do this to the SPECIFICATION portion of the document, or take
144 > it out of the RATIONAL portion.
145
146 I would think this is rather self evident. To over-simplify, when you
147 use the "-b" option with emerge it makes a tarball of all the files you
148 install and appends the ebuild to the end of the file. If building is
149 handled by portage, and it is "installing" not source files but binary
150 files, the "-b" option will make a tarball of the kernel binary, the
151 modules, and the kernel-headers/sources. all you have to do to install
152 this kernel now is an "emerge -k kernel". This is the same exact
153 fashion as all other packages. And thus, I don't think it needs
154 clarification.
155
156 >
157 > > 7. A seperate package for "generic" kernel config files gives us
158 > > better version tracking
159 >
160 > "better version tracking"? What do you mean here? Kernel config files
161 > can not be kept identical across 2 different kernel versions. And they
162 > are not supposed to be. They are a vital portion of the kernel version
163 > itself and can not be split out. To think otherwise is to not fully
164 > understand the kernel build process.
165 >
166 > Also, is this a problem today? I have not seen issues related to this
167 > in the past, have you? Are there any bugs you can point us at that
168 > would show how this would help out?
169
170 OK, the way genkernel currently does this is by storing a "template"
171 config file for each major kernel version (ie. 2.4, 2.6, etc). When
172 genkernel decides to use the "default config", it copies the "template"
173 config to the source directory and does a "yes | make oldconfig". I'm
174 not proposing anything different than this. I'm MOSTLY talking about a
175 restructuring of genkernel, NOT a start from scratch. The restructuring
176 abstracts the config from the kernel building from the initrd/initramfs.
177 This is cleaner, and in the process, gives us portage integration.
178
179 By version tracking I simply mean this: I have a tarball of "generic"
180 kernel configs. Lets call it "sys-kernel/generic-kernel-configs" for
181 fun. The first time I release them it is version 1.0. If I find a bug
182 and fix it, we now have version 1.1. This lets our users know when
183 something has changed in the kernel config. Its just more "open" and
184 that is really all I meant by it.
185
186 At this point I'd also like to say that this GLEP is a proposal. It is
187 in "draft" stage. So by all means, propose ideas. But don't just say
188 "what we are doing now is great" because, even though it is, it could be
189 better. That is all I'm pointing out.
190
191 Nathaniel
192
193
194 --
195 gentoo-dev@g.o mailing list

Replies