summaryrefslogtreecommitdiff
blob: 874ae603539cf4a2c82af98f2aa50f499a9edf5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
.TH GENKERNEL "8" "July 2005" "genkernel 3.3" "Gentoo Linux"
.SH NAME
genkernel \- the Gentoo Linux automatic kernel compiler.
.SH SYNOPSIS
genkernel [options...] action
.SH INTRODUCTION
Genkernel is designed to allow users who are not previously used to
compiling a kernel to use a similar setup to that one that is used on
the Gentoo LiveCDs which auto-detects your hardware.
.PP
Some users may also be interested in using genkernel for hardware
which requires initialization and a working kernel before it can be
booted because genkernel also automatically compiles your kernel
modules, allowing hardware which needs to be loaded with module
parameters to be used.
.SH USAGE
All that is needed to run genkernel is just ``genkernel'' with an action
and any flags you might need:
.PP
# genkernel --menuconfig --no-clean --no-install --bootsplash all
.PP
This would produce a kernel, asking you what how to configure it
to your desire, leaving alone any existing compiled object files, enabling
bootsplash support but not installing anything.
.SH ACTIONS
An action tells genkernel what you want it to do - the following
actions are supported:
.PP
.I \fBall\fR
.RS
Build all steps - the kernel, modules, and the initrd.
.RE
.I \fBbzImage\fR
.RS
Build only the kernel.
.RE
.I \fBkernel\fR
.RS
Build only the kernel and the modules.
.RE
.I \fBinitrd\fR
.RS
Build only the initrd.
.RE
.SH OPTIONS
Genkernel supports the following options which alter its
behaviour. Certain options have ``\fB--no-\fR'' variants which
do the opposite thing. You can specify your options in any order.
.PP
.BR Debugging \ Options
.TP
\fB\-\-debuglevel=\fR<0-5>
This controls the out verbosity level of genkernel output - if this is set
to 0, minimal debugging is done; if this is set to 5 as much output as
possible is given.
.TP
\fB\-\-debugfile=\fR<outfile>
This outputs full debugging data; regardless of --debuglevel to the file 
<outfile>. By default this is
.I /var/log/genkernel.log\fR.
.TP
\fB\-\-\fR[no\-]\fBcolor\fR
Turns on, or off, output in color using escape sequences.
.PP
.BR Kernel \ Configuration
.TP
\fB\-\-\fR[no\-]\fBmenuconfig\fR
Runs, or does not run "make menuconfig" after running "make oldconfig".
.TP
\fB\-\-\fR[no\-]\fBsave\-config\fR
Saves, or does not save the kernel configuration to
.I /etc/kernels
if the kernel is successfully compiled.
.TP
\fB\-\-gconfig\fR
Run "make gconfig" after "make oldconfig".
.TP
\fB\-\-xconfig\fR
Run "make xconfig" after "make oldconfig".
.PP
.BR Kernel \ Compilation
.TP
\fB\-\-\fR[no\-]\fBclean\fR
Runs, or does not run, "make clean" before compilation - this erases any
compiled object files in the kernel source tree but does not have an impact
on the kernel configuration. Specifying \fB\-\-no\-clean\fR implies
\fB\-\-no\-mrproper\fR.
.TP
\fB\-\-\fR[no\-]\fBmrproper\fR
Runs, or does not run, "make mrproper" before compilation - this erases both
any compiled object files in the kernel source tree as well as the kernel
configuration.
.TP
\fB\-\-\fR[no\-]\fBinstall\fR
Installs, or does not install the kernel to
.I /boot
after building. If MOUNTBOOT is set in
.I /etc/genkernel.conf
then
.I /boot
will be automatically mounted if it is
not already mounted before the initrd and kernel image is copied over.
.TP
\fB\-\-no\-initrdmodules\fR
Don't copy any modules to the initrd.
.TP
\fB\-\-oldconfig\fR
Implies \fB\-\-no\-clean\fR, and thus \fB\-\-no\-mrproper\fR, running a
"make oldconfig".
.TP
\fB\-\-callback=\fR<...>
Run the specified arguments in the current environment after the kernel and
modules have been compiled.
.PP
.BR Kernel \ Locations
.TP
\fB\-\-kerneldir=\fR<dir>
This specifies the location of the kernel sources; the default is
/usr/src/linux.
.TP
\fB\-\-kernel\-config=\fR<file>
This specifies a kernel configuration file to use for compilation; by default
.config in the kernel source tree is used.
.PP
.BR Low-Level \ Compilation \ Options
.TP
\fB\-\-kernel\-cc=\fR<compiler>
Compiler to use for the kernel compilation (e.g. distcc).
.TP
\fB\-\-kernel\-as=\fR<assembler>
Assembler to use for the kernel compilation.
.TP
\fB\-\-kernel\-ld=\fR<linker>
Linker to use for the kernel compilation.
.TP
\fB\-\-kernel\-make=\fR<makeprg>
GNU Make to use for the kernel compilation.
.TP
\fB\-\-utils\-cc=\fR<compiler>
Compiler to use for utilities.
.TP
\fB\-\-utils\-as=\fR<assembler>
Assembler to use for utilities.
.TP
\fB\-\-utils\-ld=\fR<linker>
Linker to use for utilities.
.TP
\fB\-\-utils\-make=\fR<makeprog>
GNU Make to use for utilities.
.TP
\fB\-\-makeopts=\fR<makeopts>
GNU Make options such as \fB\-j2\fR, etc. \fB\-j\fRX is filtered during the
module compilation stage of 2.4 series kernels to avoid bottlenecks; the
2.6 build system does not have this issue and \fB\-j\fRX is not filtered for it.
.PP
.BR Initialization
.TP
\fB\-\-do\-keymap\-auto\fR
Force keymap selection at boot.
.TP
\fB\-\-\fR[no\-]\fBbootsplash=\fR<theme>
If the extra argument is specified, bootsplash is forced using <theme>
rather than the default theme specified in your bootsplash
configuration. If \fB\-\-no-bootsplash\fR is specified, then
bootsplash is disabled.
.TP
\fB\-\-\fR[no\-]\fBgensplash=\fR<theme>
If the extra argument is specified, gensplash is forced using <theme>
rather than the default theme specified in your gensplash
configuration. If \fB\-\-no-gensplash\fR is specified, then
gensplash is disabled.
.TP
\fB\-\-gensplash-res=\fR<resolutions>
Optionally select gensplash resolutions to include.
.TP
\fB\-\-evms2\fR
Add in EVMS2 support from static binaries if they exist on the system:
you should run "emerge evms2" first.
.TP
\fB\-\-lvm2\fR
.RS
Add in LVM2 support from static binaries if they exist on the system,
or compile static LVM2 binaries if static ones do not exist.
.RE
.TP
\fB\-\-unionfs\fR
Add unionfs support.
.TP
\fB\-\-dmraid\fR
Add DMRAID support.
.TP
\fB\-\-linuxrc=\fR<file>
Use <file> for the linuxrc instead of the genkernel linuxrc.
.PP
.BR Internals
.TP
\fB\-\-arch\-override=\fR<arch>
Force the architecture settings described by the <arch> profile
instead of autodetecting the running architecture.
.TP
\fB\-\-busybox\-config=\fR<file>
Busybox configuration file to use when compiling busybox.
.TP
\fB\-\-busybox\-bin=\fR<file>
Don't compile busybox, and use this static .bz2 binary instead.
.PP
.BR Output \ Settings
.TP
\fB\-\-kernname=\fR<...>
Tag the kernel and initrd with a name, if not defined this option defaults to genkernel
.TP
\fB\-\-minkernpackage=\fR<tbz2>
File to output a .tar.bz2'd kernel and initrd: no modules outside of the
initrd will be included...
.TP
\fB\-\-modulespackage=\fR<tbz2>
File to output a .tar.bz2'd modules after the callbacks have run
.TP
\fB\-\-kerncache=\fR<tbz2>
File to output a .tar.bz2'd kernel, contents of /lib/modules/ and the kernel config.
\fBNOTE\fR: This is created before the callbacks are run.
.TP
\fB\-\-no\-kernel\-sources=\fR<tbz2>
This option is only valid if kerncache is defined
If there is a valid kerncache no checks will be made
against a kernel source tree.
.TP
\fB\-\-initramfs\-overlay=\fR<dir>
Directory structure to inject into the initramfs.
Only available on 2.6 kernels that don't use bootsplash; use a CPIO
archive as a parameter.
.SH INITRD OPTIONS
The following options can be passed as kernel parameters from the
bootloader, which the initrd scripts would recognize.
.TP
\fBreal_root=\fR<...>
Specifies the device node of the root filesystem to mount.
.TP
\fBdodmraid=\fR<...>
Passes arguments to dmraid on bootup.
.TP
\fBreal_init=\fR<...>
Passes arguments to init on bootup.
.TP
\fBscandelay\fR=<...>
Pauses for 10 seconds before running devfsd if no argument is specified;
otherwise pauses for the number of specified seconds.
.TP 
\fBip\fR=<...>
Normally used to tell the kernel that it should start a network interface. If present, the initrd will try to mount a livecd over NFS.
.TP 
\fBnfsroot\fR=<...>
If present, the initrd will try to mount a livecd from that location. Otherwise the location will be deduced from the DCHP request (option root\-path)

.SH NETBOOTING
The initrd scripts have limited support for network booting.
This is activated if the ip=<...> kernel parameter was given. Please refer to the genkernel guide at http://www.gentoo.org/doc/en/genkernel.xml for more information.

The initrd scripts will extract any *.tar.gz files found in the \fB/add\fR directory of the livecd into the root filesystem during boot. This way it is easy to extend a netbooted LiveCD i.e. add custom tools, or other kernel modules.
.SH REPORTING BUGS
If you believe you have found a bug in the genkernel scripts, then please
file a bug on the Gentoo Linux Bugzilla: 
.I http://bugs.gentoo.org\fR,
assigning your bug to genkernel@gentoo.org. We cannot assist you
with kernel compilation failures unless they are caused by a genkernel
bug.
.PP
Kernel issues for Gentoo-supported kernels, including compilation
failures should go to
.I http://bugs.gentoo.org
and should be assigned to kernel@gentoo.org. Please check if an
existing bug documents the same issue before opening a new bug. Issues
for kernel sources not supported by Gentoo should go to their relevant
authors.
.SH AUTHORS
Tim Yamin
.B <plasmaroo@gentoo.org>
.sp
Eric Edgar
.B <rocket@gentoo.org>
.sp
NFS Support by Thomas Seiler
.B <thseiler@gmail.com>