/[gentoo]/xml/htdocs/proj/en/glep/glep-0026.txt
Gentoo

Contents of /xml/htdocs/proj/en/glep/glep-0026.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Mon May 3 01:48:45 2004 UTC (10 years, 7 months ago) by g2boojum
Branch: MAIN
File MIME type: text/plain
New GLEP

1 GLEP: 26
2 Title: Handling kernels with portage
3 Version: $Revision: $
4 Last-Modified: $Date: $
5 Author: Nathaniel McCallum <npmccallum@gentoo.org>, Joshua Campbell <warpzero@gentoo.org>
6 Status: Draft
7 Type: Standards Track
8 Content-Type: text/x-rst
9 Created: 2-May-2004
10 Post-History: 2-May-2004
11
12 Abstract
13 ========
14
15 This GLEP proposes to create a more consistent handling of kernels and kernel building.
16 Currently "emerge kernel-name" only installs the sources and does not build anything.
17 "emerge kernel-name" should install only sources OR only a binary kernel, its modules,
18 and a tarballed package of kernel-headers, depending on USE flag.
19
20 Motivation
21 ==========
22
23 Currently, the only automated kernel build proceedure that we have is genkernel. While
24 genkernel is a great tool, its main weakness is that it does not port well to other
25 arches because of the initrd and the lack of good "generic" settings for other arches.
26 This GLEP hopes to overcome this by abstracting the various layers of genkernel and
27 implementing the most common aspect (the build proceedure) into a portage eclass.
28
29 Specification
30 =============
31
32 There would be 3 layers to kernel building: (place of implementation)
33
34 - Stage 1 - Configuring the kernel (optional) -- external utility
35 - Stage 2 - Building the kernel -- in an eclass
36 - Stage 3 - Building the initrd (optional) -- in an ebuild
37
38 Stages 1 and 3 are optional on most arches.
39
40 Stage 1 would be achieved through a seperate utility (perhaps like the current
41 genkernel). This utility would help the user configure the kernel and any kernel/build
42 related settings. This stage is optional and would only be used if a person wanted a
43 customized kernel settings. One optional thought is to have this utility a part of the
44 base Gentoo system. That way there are less steps to make a custom kernel.
45
46 Stage 2 would be implimented through an eclass. This stage is not optional. One would
47 perform this step by typing "emerge kernel-name", where "kernel-name" is the name of
48 the kernel package you want to use (ie. "gentoo-dev"). This package would have a
49 "buildkernel" USE flag. If the flag was not set, it would simply download and install
50 sources like we do currently. However, if the "buildkernel" flag is set, portage will
51 perform the following steps:
52
53 1. (as a dependency) download and install a tarball of "generic" kernel config files.
54 2. Check to see if customized kernel config/settings have been set via Stage 1.
55 3. Portage will use a custom config, if available. Otherwise, a "generic" config.
56 4. If neither a custom config or a "generic" config is available, die (with message).
57 This is needed as some arches don't/can't have "generic" configs, so they will
58 simply be presented a message telling them to run the utility from Stage 1 (which
59 they obviously skipped).
60 5. Build the kernel and modules and install them
61 6. Remove unnecessary files from the sources and tarball it as "kernel-headers".
62 This tarball provides the appropriate files to build external modules against, like
63 nvidia-kernel, etc... The external modules (when built) will determine the running
64 kernel and unpack the appropriate tarball, to build against, then remove the files.
65
66 Stage 3 would merely be an ebuild that constructs an initrd image for either the running
67 kernel or, lacking a running kernel, the newest kernel installed (by version/date installed?).
68 Initrd's can't be used on all arches, so this ebuild can be keyword masked as appropriate.
69 The initrd package would also have a "bootsplash" USE flag (on x86, maybe others) that
70 would build in bootsplash support. Any non-default actions desired by the user can be
71 handled with the utility from Stage 1.
72
73 This would lead us to several case scenarios (assuming kernel-config is part of the base
74 system):
75
76 1. default kernel, no initrd: "emerge gentoo-kernel"
77
78 2. default kernel, initrd: "emerge aa-kernel initrd"
79
80 3. default kernel, bootsplash initrd: "USE=bootsplash emerge mm-kernel initrd"
81
82 4. non-default kernel, no initrd: "kernel-config gentoo-dev-kernel"
83 "emerge gentoo-dev-kernel"
84
85 5. non-default kernel, initrd: "kernel-config alpha-kernel"
86 "emerge alpha-kernel initrd"
87
88 6. JUST sources, no binary "USE=-buildkernel emerge grsec-kernel"
89
90 Rationale
91 =========
92
93 There are many advantages gained by this method:
94
95 1. Full arch support (GentooInstaller really could use this)
96 2. More consistent with the rest of portage (installs binaries by building from source)
97 3. Better user experience
98 4. More flexability (genkernel forces building of initrd on x86)
99 5. Don't have to store full kernel sources (each source tree is ~200MB unpacked)
100 6. Creates the ability to make binary kernel packages for fast installs (think GRP kernel)
101 7. A seperate package for "generic" kernel config files gives us better version tracking
102
103 The major problem is, however, that we currently have two different build systems,
104 portage and genkernel. Having competing build systems is not a GoodThing TM. Therefore,
105 we can either make portage build kernels or we can make genkernel build everything else.
106
107 Backwards Compatibility
108 =======================
109
110 If you want to emerge kernel sources the old way, just do: USE="-buildkernel" emerge kernel-name
111
112 Perhaps we could also name the new kernel-config program (from Stage 1) "genkernel" so that users
113 can have a seemless transition.
114
115 Reference Implementation
116 ========================
117
118 not yet ..
119
120 Copyright
121 =========
122
123 This document has been placed in the public domain.

  ViewVC Help
Powered by ViewVC 1.1.20