1e02fb7d67e1f9a04d79316f8874ffdb9fd6860c
[genkernel.git] / doc / genkernel.8.txt
1 GENKERNEL(8)
2 ============
3 :man source:   genkernel {genkernelversion}
4 :man manual:   genkernel {genkernelversion}
5
6
7 NAME
8 ----
9 genkernel - the Gentoo Linux automatic kernel compiler.
10
11
12 SYNOPSIS
13 --------
14 *genkernel* [options...] action
15
16
17 INTRODUCTION
18 ------------
19 Genkernel is designed to allow users who are not previously used to
20 compiling a kernel to use a similar setup to that one that is used on
21 the Gentoo LiveCDs which auto-detects your hardware.
22
23 Some users may also be interested in using genkernel for hardware which
24 requires initialization and a working kernel before it can be booted
25 because genkernel also automatically compiles your kernel modules,
26 allowing hardware which needs to be loaded with module parameters to be
27 used.
28
29
30 USAGE
31 -----
32 All that is needed to run genkernel is just `genkernel` with an
33 action and any flags you might need:
34
35 ------------------------------------------
36 # genkernel --menuconfig --no-clean --no-install all
37 ------------------------------------------
38
39 This would produce a kernel, asking you what how to configure it to
40 your desire, leaving alone any existing compiled object files, but not
41 installing anything.
42
43
44 ACTIONS
45 -------
46 An action tells genkernel what you want it to do  -  the following
47 actions are supported:
48
49 *all*::
50     Build all steps - the kernel, modules, and the ramdisk.
51 *bzImage*::
52     Build only the kernel.
53 *initramfs*::
54     Build only the ramdisk/initramfs.
55 *kernel*::
56     Build only the kernel and the modules.
57 *ramdisk*::
58     Build only the ramdisk/initramfs.
59
60
61 OPTIONS
62 -------
63 Genkernel supports the following options which alter its behaviour.
64 Certain options have *--no-* variants which do the opposite thing.
65 You can specify your options in any order.
66
67
68 CONFIGURATION OPTIONS
69 ~~~~~~~~~~~~~~~~~~~~~
70 *--config*=<file>::
71     Genkernel configuration file to use
72
73
74 DEBUGGING OPTIONS
75 ~~~~~~~~~~~~~~~~~
76 *--loglevel*=<0-5>::
77     This controls the out verbosity level of genkernel output - if
78     this is set to 0, minimal debugging is done; if this is set to 5
79     as much output as possible is given.
80
81 *--logfile*=<outfile>::
82     This outputs debugging data to the file <outfile>. By default
83     this is '/var/log/genkernel.log'.
84
85 *--*[*no-*]*color*::
86     Turns on, or off, output in color using escape sequences.
87
88
89 KERNEL CONFIGURATION
90 ~~~~~~~~~~~~~~~~~~~~
91 *--*[*no-*]*menuconfig*::
92     Runs, or does not run "make menuconfig" after running "make oldconfig".
93
94 *--*[*no-*]*save-config*::
95     Saves, or does not save the kernel configuration to '/etc/kernels'
96     if the kernel is successfully compiled.
97
98 *--*[*no-*]*gconfig*::
99     Runs, or does not run "make gconfig" after "make oldconfig".
100
101 *--*[*no-*]*xconfig*::
102     Runs, or does not run "make xconfig" after "make oldconfig".
103
104
105 KERNEL COMPILATION
106 ~~~~~~~~~~~~~~~~~~
107 *--*[*no-*]*clean*::
108     Runs, or does not run, "make clean" before compilation  -  this
109     erases any compiled object files in the kernel source tree but
110     does not have an impact on the kernel configuration.  Specifying
111     *--no-clean* implies *--no-mrproper*.
112
113 *--*[*no-*]*mrproper*::
114     Runs, or does not run, "make mrproper" before compilation - this
115     erases both any compiled object files in the kernel source tree
116     as well as the kernel configuration.
117
118 *--*[*no-*]*install*::
119     Installs,  or does not install the kernel to '/boot' after building.
120     The default is  *--install*.   If MOUNTBOOT is set in
121     '/etc/genkernel.conf'  then '/boot' will be automatically mounted if
122     it is not already mounted before the ramdisk and kernel images
123     are copied over.
124
125 *--*[*no-*]*symlink*::
126     Manages,  or does not manage, symlinks in '/boot' like the manual
127     kernel "make install" process does. A kernel (or,  depending on
128     options,  kernelz)  symlink will link to the most recently built
129     kernel image and a kernel.old (or kernelz.old) symlink will link
130     to the second most recently built image, if one exists.  Similar
131     symlinks (both * and *.old) are managed for initramfs and System.map.
132     The corresponding work products (i.e., the actual kernel
133     and initramfs images, and System.map) are also managed accordingly.
134     NOTE: Specifying   *--symlink*  does nothing unless
135     *--install* is also specified.
136
137 *--oldconfig*::
138     Implies *--no-clean*, and thus *--no-mrproper*, running a "make oldconfig".
139
140 *--*[*no-*]*splash*::
141     Installs, or not, framebuffer splash support into initramfs.
142
143 *--*[*no-*]*ramdisk-modules*::
144     Copies or does not copy configured modules to the ramdisk.
145
146 *--*[*no-*]*all-ramdisk-modules*::
147     Copies or does not copy all kernel modules to the initrd.
148
149 *--callback*=<...>::
150     Run the specified arguments in the current environment after the
151     kernel and modules have been compiled.
152
153 *--*[*no-*]*static*::
154         Builds, or does not build a monolithic kernel without any modules on any
155         initial ramdisks.
156
157
158 KERNEL LOCATIONS
159 ~~~~~~~~~~~~~~~~
160 *--kerneldir*=<dir>::
161     This specifies the location of the kernel sources;  the default
162     is '/usr/src/linux'.
163
164 *--kernel-config*=<file>::
165     This specifies a kernel configuration file to use for compilation;
166     by default genkernel uses the config from the previous
167     build of the same kernel version or a default kernel config if
168     there isn't a previous config.
169
170 *--module-prefix*=<dir>::
171     Prefix to kernel module destination, modules will be installed in
172     '<prefix>/lib/modules'.
173
174
175 LOW-LEVEL COMPILATION OPTIONS
176 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
177 *--kernel-cc*=<compiler>::
178     Compiler to use for the kernel compilation (e.g. distcc).
179
180 *--kernel-as*=<assembler>::
181     Assembler to use for the kernel compilation.
182
183 *--kernel-ld*=<linker>::
184     Linker to use for the kernel compilation.
185
186 *--kernel-cross-compile*=<cross var>::
187     CROSS_COMPILE kernel variable.
188
189 *--kernel-make*=<makeprg>::
190     GNU Make to use for the kernel compilation.
191
192 *--kernel-target*=<t>::
193     Override default make target (bzImage), note that values
194     like *--kernel-target=* are also valid (useful for Xen
195     based kernel sources)
196
197 *--kernel-binary*=<path>::
198     Override default kernel binary path (arch/foo/boot/bar)
199
200 *--utils-cc*=<compiler>::
201     Compiler to use for utilities.
202
203 *--utils-as*=<assembler>::
204     Assembler to use for utilities.
205
206 *--utils-ld*=<linker>::
207     Linker to use for utilities.
208
209 *--utils-make*=<makeprog>::
210     GNU Make to use for utilities.
211
212 *--utils-cross-compile*=<cross var>::
213     CROSS_COMPILE utils variable.
214
215 *--utils-arch*=<arch>::
216     Force to arch for utils only instead of autodetect.
217
218 *--*[*no-*]*mountboot*::
219     Mount, or not, BOOTDIR automatically if mountable.
220
221 *--bootdir*=<dir>::
222     Set the location of the boot-directory, default is '/boot'.
223
224 *--makeopts*=<makeopts>::
225     GNU Make options such as -j2, etc.
226
227
228 INITIALIZATION
229 ~~~~~~~~~~~~~~
230 *--splash*=<theme>::
231     Enable framebuffer splash using <theme>.
232
233 *--splash-res*=<resolutions>::
234     Select gensplash resolutions to include.
235
236 *--*[*no-*]*splash*=<theme>::
237     If the extra argument is specified,  splash is forced using
238     <theme>  rather than the default theme specified in your splash
239     configuration. If *--no-splash* is specified, then splash is disabled.
240
241 *--do-keymap-auto*::
242     Force keymap selection at boot.
243
244 *--*[*no-*]*keymap*::
245     Enables or disables keymap selection at boot.
246
247 *--*[*no-*]*lvm*::
248         Adds or skips in LVM support from static binaries if they exist on the
249         system,  or compile static LVM binaries if static ones do not exist.
250
251 *--*[*no-*]*mdadm*::
252     Includes or excludes mdadm/mdmon support.
253     Without sys-fs/mdadm[static] installed, this will compile mdadm for you.
254
255 *--mdadm-config*=<file>::
256     Use <file> as configfile for MDADM.
257     By default the ramdisk will be built *without* an mdadm.conf and
258     will auto-detect arrays during boot-up.
259
260 *--*[*no-*]*dmraid*::
261     Includes or excludes DMRAID support.
262
263 *--*[*no-*]*multipath*::
264     Includes or excludes Multipath support
265
266 *--*[*no-*]*iscsi*::
267     Includes or excludes iSCSI support
268
269 *--bootloader*=*grub*::
270     Add new kernel to GRUB configuration.
271
272 *--linuxrc*=<file>::
273     Use <file> for the linuxrc instead of the genkernel linuxrc.
274
275 *--busybox-config*=<file>::
276     Specifies a user created busybox config.
277
278 *--genzimage*::
279         Make and install kernelz image from 'arch/powerpc/boot/zImage.initrd'.
280
281 *--*[*no-*]*disklabel*::
282     Includes or excludes disk label and uuid support in your initrd.
283
284 *--*[*no-*]*luks*::
285         Includes or excludes Luks support from static binaries if they exist on
286         the system.
287
288 *--*[*no-*]*gpg*::
289         Includes or excludes support for GnuPG 1.x, the portable standalone branch
290         of GnuPG. A key can be made from
291     `gpg --symmetric -o /path/to/LUKS-key.gpg /path/to/LUKS-key` .
292     After that, re-point the *root_key* argument to the new .gpg file.
293
294 *--*[*no-*]*busybox*::
295     Includes or excludes busybox in the initrd or initramfs.
296
297 *--*[*no-*]*unionfs*::
298     Includes or excludes support for unionfs
299
300 *--*[*no-*]*netboot*::
301     Creates or does not create a self-contained env in the initramfs
302
303 *--real-root*=<foo>::
304     Specify a default for *real_root*= kernel option.
305
306
307 INTERNALS
308 ~~~~~~~~~
309 *--arch-override*=<arch>::
310     Force the architecture settings described by the <arch>  profile
311     instead of autodetecting the running architecture.
312
313 *--cachedir*=<dir>::
314     Override the default cache location.
315
316 *--tempdir*=<dir>::
317     Sets genkernel's temporary working directory to <dir>.
318
319 *--*[*no-*]*postclear*::
320         Clears or skips clearing all tmp files and caches after genkernel has run.
321
322
323 OUTPUT SETTINGS
324 ~~~~~~~~~~~~~~~
325 *--kernname*=<...>::
326     Tag the kernel and initrd with a name, if not defined this
327     option defaults to genkernel
328
329 *--minkernpackage*=<tbz2>::
330     File to output a .tar.bz2'd kernel and initrd: no modules outside
331     of the initrd will be included...
332
333 *--modulespackage*=<tbz2>::
334     File to output a .tar.bz2'd modules after the callbacks have run
335
336 *--kerncache*=<tbz2>::
337     File to output a .tar.bz2'd kernel, contents of '/lib/modules/'
338     and the kernel config.  NOTE: This is created before the callbacks
339     are run.
340
341 *--*[*no-*]*kernel-sources*::
342     This option is only valid if kerncache is defined If there is a
343     valid kerncache no checks will be made against a kernel source
344     tree.
345
346 *--initramfs-overlay*=<dir>::
347     Directory structure to include in the initramfs, only available
348     on >=2.6 kernels
349
350 *--*[*no-*]*firmware*::
351     Enable or disables copying of firmware into initramfs.
352
353 *--firmware-dir*=<dir>::
354     Specify directory to copy firmware from (defaults to '/lib/firmware').
355
356 *--firmware-files*=<files>::
357     Specifies specific firmware files to copy. This overrides *--firmware-dir*.
358     For multiple files, separate the filenames with a comma.
359
360 *--*[*no-*]*integrated-initramfs*::
361         Builds or does not build the generated initramfs into the kernel instead
362         of keeping it as a separate file.
363
364 *--*[*no-*]*compress-initramfs*::
365         Compresses or does not compress the generated initramfs.
366
367
368 RAMDISK OPTIONS
369 ---------------
370 The following options can be passed as kernel parameters from the bootloader,
371 which the ramdisk scripts would recognize.
372
373 *real_root*=<...>::
374     Specifies the device node of the root filesystem to mount.
375
376 *crypt_root*=<...>::
377     This specifies the device encrypted by Luks, which contains the
378     root filesystem to mount.
379
380 *crypt_swap*=<...>::
381     This specifies the swap device encrypted by Luks.
382
383 *root_key*=<...>::
384     In case your root is encrypted with a key, you can use a device
385     like a  usb pen to store the key.  This value should be the key
386     path relative to the mount point.
387
388 *root_keydev*=<...>::
389     If necessary provide the name of the device that carries the
390     root_key.   If unset while using root_key, it will automatically
391     look for the device in every boot.
392
393 *root_trim*=(yes|no)::
394     Enables TRIM support for a Luks-based root device.  Only useful
395     with SSD setups.  Have a look at 'http://en.wikipedia.org/wiki/TRIM'
396     for more information.
397
398 *swap_key*=<...>::
399     Same as root_key for swap.
400
401 *swap_keydev*=<...>::
402     Same as root_keydev for swap.
403
404 *crypt_silent*::
405     Set this to silent all the output related to the cryptographic
406     software,  and in case your encrypted device isn't open with the
407     key, it opens a shell in the initrd quietly.
408
409 *dodmraid*[=<...>]::
410     Activate Device-Mapper RAID and (optionally) pass arguments to it.
411
412 *real_init*=<...>::
413     Override location of init script, default is "/sbin/init".
414
415 *init_opts*=<...>::
416     Passes arguments to init on bootup.
417
418 *scandelay*[=<...>]::
419     Pauses for 10 seconds before running devfsd if no argument is
420     specified; otherwise pauses for the number of specified seconds.
421
422 *ip*=<...>::
423     Normally used to tell the kernel that it should start a network
424     interface. If present, the initrd will try to mount a  livecd
425     over NFS.
426
427 *nfsroot*=<...>::
428     If present,  the initrd will try to mount a livecd from that
429     location. Otherwise the location will be deduced from the DCHP
430     request (option root-path)
431
432 *dolvm*::
433     Activate LVM volumes on bootup
434
435 *lvmraid*=<...>::
436     Specify RAID devices to set up before the activation of LVM volumes.
437     Implies option *dolvm*.
438
439 *domdadm*::
440     Scan for RAID arrays on bootup
441
442 *doscsi*::
443     Activate SCSI devices on bootup, necessary when SCSI support is
444     compiled as modules and you're using SCSI or SATA devices.
445
446 *noslowusb*::
447     By default genkernel pause for 10 seconds if it finds a attached
448     usb-storage device to give them time to initiate.
449     This option skips that pause.
450
451 *keymap*='MAP'::
452     Set keymap to 'MAP', e.g. *keymap*=de.
453     For valid values of 'MAP' please see
454     '/usr/share/genkernel/defaults/keymaps.tar.gz'.
455
456 *dokeymap*::
457     Use keymap.  Usage of *keymap*= implies this option, already.
458
459 *rootfstype*=<...>::
460     Specify the file system type to mount the real root filesystem as.
461     This can be useful when support for ext2/ext3/ext4 are
462     in competition.  Default is "auto".
463
464 *docache*::
465 *nocache*::
466     Enables/disables caching of CD contents in RAM.
467
468 *root*=<...>::
469     Omit or specify as "/dev/ram0".
470     For other values be sure to know what you're doing.
471
472 *subdir*=<...>::
473     switch_root into "<CHROOT>/<SUBDIR>" instead of "<CHROOT>/".
474     <CHROOT> is "/newroot" (or "/union") usually.
475
476 *debug*::
477     Drop into a debug shell early in the process.
478
479 *noload*=<...>::
480     List of modules to skip loading.
481     Separate using commas or spaces.
482
483 *nodetect*::
484     Skipping scanning modules using "modprobe <MODULE> -n".
485     Use *doload=* for specifying a whitelist of exceptions.
486
487 *doload*=<...>::
488     List of modules to load despite *nodetect*.
489
490 *domodules*::
491 *nomodules*::
492     Enables/disables loading of modules in general.
493
494 *CONSOLE*=<...>::
495 *console*=<...>::
496     Override location of console, default is "/dev/console".
497
498 *part*=<...>::
499     Specify part for mdadm to start.  This is the relevant code in mdstart:
500 ------------------------------------------
501     fd = open("/dev/md<MD_NUMBER>", 0, 0);
502     ioctl(fd, RAID_AUTORUN, <MDPART>);
503 ------------------------------------------
504
505 *iscsi_initiatorname*=<...>::
506 *iscsi_target*=<...>::
507 *iscsi_tgpt*=<...>::
508 *iscsi_address*=<...>::
509 *iscsi_port*=<...>::
510 *iscsi_username*=<...>::
511 *iscsi_password*=<...>::
512 *iscsi_username_in*=<...>::
513 *iscsi_password_in*=<...>::
514 *iscsi_debug*=<...>::
515 *iscsi_noibft*::
516     Specify iSCSI parameters.
517
518 *unionfs*::
519 *nounionfs*::
520     Enables/disables UnionFS.
521
522 *aufs*::
523     Enables support for AUFS2 (if available in the kernel).
524
525 *real_rootflags*=<...>::
526     Additional flags to mount the real root system with.
527     For example *real_rootflags*=noatime would make "-o ro,noatime".
528
529 *real_resume*=<...>::
530 *resume*=<...>::
531 *noresume*::
532     TO BE DOCUMENTED
533
534 *cdroot*[=<...>]::
535 *cdroot_type*=<...>::
536     TO BE DOCUMENTED
537
538 *loop*=<...>::
539 *looptype*=<...>::
540     TO BE DOCUMENTED
541
542 *isoboot*=<...>::
543     TO BE DOCUMENTED
544
545
546 NETBOOTING
547 ----------
548 The initrd scripts have limited support for network booting.   This is
549 activated if the *ip*=<...> kernel parameter was given. Please refer to
550 the genkernel guide at 'http://www.gentoo.org/doc/en/genkernel.xml' for
551 more information.
552
553 The initrd scripts will extract any *.tar.gz files found in the '/add'
554 directory of the livecd into the root filesystem during boot. This way
555 it is easy to extend a netbooted LiveCD i.e. add custom tools, or other
556 kernel modules.
557
558
559 REPORTING BUGS
560 --------------
561 If you believe you have found a bug in the genkernel scripts,  then
562 please file a bug on the Gentoo Linux Bugzilla against product
563 "Gentoo Hosted Projects" component "genkernel", i.e. at
564 'https://bugs.gentoo.org/enter_bug.cgi?product=Gentoo%20Hosted%20Projects&component=genkernel'.
565
566 If you're somewhat unsure if you hit a bug or not, file a bug an we'll find out together.
567 For general questions the is the gentoo-genkernel mailing list.  You can join the list
568 by sending empty mail to 'gentoo-genkernel+subscribe@lists.gentoo.org'.
569
570 We cannot assist you with
571 kernel compilation failures unless they are caused by a genkernel bug.
572
573 Kernel issues for Gentoo-supported kernels, including compilation failures
574 should go to 'https://bugs.gentoo.org/' and should be assigned to 'kernel@gentoo.org'.
575 Please check if an existing bug documents the same
576 issue before opening a new bug. Issues for kernel sources not supported
577 by Gentoo should go to their relevant authors.
578
579
580 AUTHORS
581 -------
582 - Tim Yamin <plasmaroo@gentoo.org>
583 - Eric Edgar <rocket@gentoo.org>
584 - Chris Gianelloni <wolf31o2@gentoo.org>
585 - Sebastian Pipping <sebastian@pipping.org>
586 - NFS Support by Thomas Seiler <thseiler@gmail.com>
587 - GnuPG 1.x integration by dacook <schism@subverted.org>
588 - MDADM integration by Matthias Dahl <ua_bugz_gentoo@mortal-soul.de>
589
590
591 SEE ALSO
592 --------
593 /etc/genkernel.conf - genkernel configuration file