3 :man source: genkernel {genkernelversion}
4 :man manual: genkernel {genkernelversion}
9 genkernel - the Gentoo Linux automatic kernel compiler.
14 *genkernel* [options...] action
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.
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
32 All that is needed to run genkernel is just `genkernel` with an
33 action and any flags you might need:
35 ------------------------------------------
36 # genkernel --menuconfig --no-clean --no-install all
37 ------------------------------------------
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
46 An action tells genkernel what you want it to do - the following
47 actions are supported:
50 Build all steps - the kernel, modules, and the ramdisk.
52 Build only the kernel.
54 Build only the ramdisk/initramfs.
56 Build only the kernel and the modules.
58 Build only the ramdisk/initramfs.
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.
71 Genkernel configuration file to use
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.
81 *--logfile*=<outfile>::
82 This outputs debugging data to the file <outfile>. By default
83 this is '/var/log/genkernel.log'.
86 Turns on, or off, output in color using escape sequences.
91 *--*[*no-*]*menuconfig*::
92 Runs, or does not run "make menuconfig" after running "make oldconfig".
94 *--*[*no-*]*save-config*::
95 Saves, or does not save the kernel configuration to '/etc/kernels'
96 if the kernel is successfully compiled.
98 *--*[*no-*]*gconfig*::
99 Runs, or does not run "make gconfig" after "make oldconfig".
101 *--*[*no-*]*xconfig*::
102 Runs, or does not run "make xconfig" after "make oldconfig".
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*.
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.
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
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.
138 Implies *--no-clean*, and thus *--no-mrproper*, running a "make oldconfig".
140 *--*[*no-*]*splash*::
141 Installs, or not, framebuffer splash support into initramfs.
143 *--*[*no-*]*ramdisk-modules*::
144 Copies or does not copy configured modules to the ramdisk.
146 *--*[*no-*]*all-ramdisk-modules*::
147 Copies or does not copy all kernel modules to the initrd.
150 Run the specified arguments in the current environment after the
151 kernel and modules have been compiled.
153 *--*[*no-*]*static*::
154 Builds, or does not build a monolithic kernel without any modules on any
160 *--kerneldir*=<dir>::
161 This specifies the location of the kernel sources; the default
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.
170 *--module-prefix*=<dir>::
171 Prefix to kernel module destination, modules will be installed in
172 '<prefix>/lib/modules'.
175 LOW-LEVEL COMPILATION OPTIONS
176 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
177 *--kernel-cc*=<compiler>::
178 Compiler to use for the kernel compilation (e.g. distcc).
180 *--kernel-as*=<assembler>::
181 Assembler to use for the kernel compilation.
183 *--kernel-ld*=<linker>::
184 Linker to use for the kernel compilation.
186 *--kernel-cross-compile*=<cross var>::
187 CROSS_COMPILE kernel variable.
189 *--kernel-make*=<makeprg>::
190 GNU Make to use for the kernel compilation.
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)
197 *--kernel-binary*=<path>::
198 Override default kernel binary path (arch/foo/boot/bar)
200 *--utils-cc*=<compiler>::
201 Compiler to use for utilities.
203 *--utils-as*=<assembler>::
204 Assembler to use for utilities.
206 *--utils-ld*=<linker>::
207 Linker to use for utilities.
209 *--utils-make*=<makeprog>::
210 GNU Make to use for utilities.
212 *--utils-cross-compile*=<cross var>::
213 CROSS_COMPILE utils variable.
215 *--utils-arch*=<arch>::
216 Force to arch for utils only instead of autodetect.
218 *--*[*no-*]*mountboot*::
219 Mount, or not, BOOTDIR automatically if mountable.
222 Set the location of the boot-directory, default is '/boot'.
224 *--makeopts*=<makeopts>::
225 GNU Make options such as -j2, etc.
231 Enable framebuffer splash using <theme>.
233 *--splash-res*=<resolutions>::
234 Select gensplash resolutions to include.
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.
242 Force keymap selection at boot.
244 *--*[*no-*]*keymap*::
245 Enables or disables keymap selection at boot.
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.
252 Includes or excludes mdadm/mdmon support.
253 Without sys-fs/mdadm[static] installed, this will compile mdadm for you.
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.
260 *--*[*no-*]*dmraid*::
261 Includes or excludes DMRAID support.
264 Includes or excludes ZFS support.
266 *--*[*no-*]*multipath*::
267 Includes or excludes Multipath support
270 Includes or excludes iSCSI support
272 *--bootloader*=*grub*::
273 Add new kernel to GRUB configuration.
276 Use <file> for the linuxrc instead of the genkernel linuxrc.
278 *--busybox-config*=<file>::
279 Specifies a user created busybox config.
282 Make and install kernelz image from 'arch/powerpc/boot/zImage.initrd'.
284 *--*[*no-*]*disklabel*::
285 Includes or excludes disk label and uuid support in your initrd.
288 Includes or excludes Luks support from static binaries if they exist on
292 Includes or excludes support for GnuPG 1.x, the portable standalone branch
293 of GnuPG. A key can be made from
294 `gpg --symmetric -o /path/to/LUKS-key.gpg /path/to/LUKS-key` .
295 After that, re-point the *root_key* argument to the new .gpg file.
297 *--*[*no-*]*busybox*::
298 Includes or excludes busybox in the initrd or initramfs.
300 *--*[*no-*]*unionfs*::
301 Includes or excludes support for unionfs
303 *--*[*no-*]*netboot*::
304 Creates or does not create a self-contained env in the initramfs
306 *--real-root*=<foo>::
307 Specify a default for *real_root*= kernel option.
312 *--arch-override*=<arch>::
313 Force the architecture settings described by the <arch> profile
314 instead of autodetecting the running architecture.
317 Override the default cache location.
320 Sets genkernel's temporary working directory to <dir>.
322 *--*[*no-*]*postclear*::
323 Clears or skips clearing all tmp files and caches after genkernel has run.
329 Tag the kernel and initrd with a name, if not defined this
330 option defaults to genkernel
332 *--minkernpackage*=<tbz2>::
333 File to output a .tar.bz2'd kernel and initrd: no modules outside
334 of the initrd will be included...
336 *--modulespackage*=<tbz2>::
337 File to output a .tar.bz2'd modules after the callbacks have run
339 *--kerncache*=<tbz2>::
340 File to output a .tar.bz2'd kernel, contents of '/lib/modules/'
341 and the kernel config. NOTE: This is created before the callbacks
344 *--*[*no-*]*kernel-sources*::
345 This option is only valid if kerncache is defined If there is a
346 valid kerncache no checks will be made against a kernel source
349 *--initramfs-overlay*=<dir>::
350 Directory structure to include in the initramfs, only available
353 *--*[*no-*]*firmware*::
354 Enable or disables copying of firmware into initramfs.
356 *--firmware-dir*=<dir>::
357 Specify directory to copy firmware from (defaults to '/lib/firmware').
359 *--firmware-files*=<files>::
360 Specifies specific firmware files to copy. This overrides *--firmware-dir*.
361 For multiple files, separate the filenames with a comma.
363 *--*[*no-*]*integrated-initramfs*::
364 Builds or does not build the generated initramfs into the kernel instead
365 of keeping it as a separate file.
367 *--*[*no-*]*compress-initramfs*, *--*[*no-*]*compress-initrd*::
368 Compresses or does not compress the generated initramfs.
370 *--compress-initramfs-type*=<arg>::
371 Compression type for initramfs (best, xz, lzma, bzip2, gzip, lzop).
372 "Best" causes selection of the best available algorithm that is selected
373 in your kernel configuration.
378 The following options can be passed as kernel parameters from the bootloader,
379 which the ramdisk scripts would recognize.
382 Specifies the device node of the root filesystem to mount.
385 This specifies the device encrypted by Luks, which contains the
386 root filesystem to mount.
389 This specifies the swap device encrypted by Luks.
392 In case your root is encrypted with a key, you can use a device
393 like a usb pen to store the key. This value should be the key
394 path relative to the mount point.
396 *root_keydev*=<...>::
397 If necessary provide the name of the device that carries the
398 root_key. If unset while using root_key, it will automatically
399 look for the device in every boot.
401 *root_trim*=(yes|no)::
402 Enables TRIM support for a Luks-based root device. Only useful
403 with SSD setups. Have a look at 'http://en.wikipedia.org/wiki/TRIM'
404 for more information.
407 Same as root_key for swap.
409 *swap_keydev*=<...>::
410 Same as root_keydev for swap.
413 Set this to silent all the output related to the cryptographic
414 software, and in case your encrypted device isn't open with the
415 key, it opens a shell in the initrd quietly.
418 Activate Device-Mapper RAID and (optionally) pass arguments to it.
421 Override location of init script, default is "/sbin/init".
424 Passes arguments to init on bootup.
426 *scandelay*[=<...>]::
427 Pauses for 10 seconds before running devfsd if no argument is
428 specified; otherwise pauses for the number of specified seconds.
431 Normally used to tell the kernel that it should start a network
432 interface. If present, the initrd will try to mount a livecd
436 If present, the initrd will try to mount a livecd from that
437 location. Otherwise the location will be deduced from the DCHP
438 request (option root-path)
441 Activate LVM volumes on bootup
444 Specify RAID devices to set up before the activation of LVM volumes.
445 Implies option *dolvm*.
448 Scan for RAID arrays on bootup
451 Scan for bootable ZFS pools on bootup. Optionally force import if
455 Activate SCSI devices on bootup, necessary when SCSI support is
456 compiled as modules and you're using SCSI or SATA devices.
459 By default genkernel pause for 10 seconds if it finds a attached
460 usb-storage device to give them time to initiate.
461 This option skips that pause.
464 Set keymap to 'MAP', e.g. *keymap*=de.
465 For valid values of 'MAP' please see
466 '/usr/share/genkernel/defaults/keymaps/'.
469 Use keymap. Usage of *keymap*= implies this option, already.
472 Specify the file system type to mount the real root filesystem as.
473 This can be useful when support for ext2/ext3/ext4 are
474 in competition. Default is "auto".
478 Enables/disables caching of CD contents in RAM.
481 Omit or specify as "/dev/ram0".
482 For other values be sure to know what you're doing.
485 switch_root into "<CHROOT>/<SUBDIR>" instead of "<CHROOT>/".
486 <CHROOT> is "/newroot" (or "/union") usually.
489 Drop into a debug shell early in the process.
492 List of modules to skip loading.
493 Separate using commas or spaces.
496 Skipping scanning modules using "modprobe <MODULE> -n".
497 Use *doload=* for specifying a whitelist of exceptions.
500 List of modules to load despite *nodetect*.
504 Enables/disables loading of modules in general.
508 Override location of console, default is "/dev/console".
511 Specify part for mdadm to start. This is the relevant code in mdstart:
512 ------------------------------------------
513 fd = open("/dev/md<MD_NUMBER>", 0, 0);
514 ioctl(fd, RAID_AUTORUN, <MDPART>);
515 ------------------------------------------
517 *iscsi_initiatorname*=<...>::
518 *iscsi_target*=<...>::
520 *iscsi_address*=<...>::
522 *iscsi_username*=<...>::
523 *iscsi_password*=<...>::
524 *iscsi_username_in*=<...>::
525 *iscsi_password_in*=<...>::
526 *iscsi_debug*=<...>::
528 Specify iSCSI parameters.
532 Enables/disables UnionFS.
535 Enables support for AUFS2 (if available in the kernel).
537 *real_rootflags*=<...>::
538 Additional flags to mount the real root system with.
539 For example *real_rootflags*=noatime would make "-o ro,noatime".
541 *real_resume*=<...>::
547 *cdroot_type*=<...>::
555 Loop-mount an ISO file from the boot device to get the filesystem image.
556 Useful with chain-loading environments and USB keys.
561 The initrd scripts have limited support for network booting. This is
562 activated if the *ip*=<...> kernel parameter was given. Please refer to
563 the genkernel guide at 'http://www.gentoo.org/doc/en/genkernel.xml' for
566 The initrd scripts will extract any *.tar.gz files found in the '/add'
567 directory of the livecd into the root filesystem during boot. This way
568 it is easy to extend a netbooted LiveCD i.e. add custom tools, or other
574 If you believe you have found a bug in the genkernel scripts, then
575 please file a bug on the Gentoo Linux Bugzilla against product
576 "Gentoo Hosted Projects" component "genkernel", i.e. at
577 'https://bugs.gentoo.org/enter_bug.cgi?product=Gentoo%20Hosted%20Projects&component=genkernel'.
579 If you're somewhat unsure if you hit a bug or not, file a bug an we'll find out together.
580 For general questions the is the gentoo-genkernel mailing list. You can join the list
581 by sending empty mail to 'gentoo-genkernel+subscribe@lists.gentoo.org'.
583 We cannot assist you with
584 kernel compilation failures unless they are caused by a genkernel bug.
586 Kernel issues for Gentoo-supported kernels, including compilation failures
587 should go to 'https://bugs.gentoo.org/' and should be assigned to 'kernel@gentoo.org'.
588 Please check if an existing bug documents the same
589 issue before opening a new bug. Issues for kernel sources not supported
590 by Gentoo should go to their relevant authors.
595 - Tim Yamin <plasmaroo@gentoo.org>
596 - Eric Edgar <rocket@gentoo.org>
597 - Chris Gianelloni <wolf31o2@gentoo.org>
598 - Sebastian Pipping <sebastian@pipping.org>
599 - NFS Support by Thomas Seiler <thseiler@gmail.com>
600 - GnuPG 1.x integration by dacook <schism@subverted.org>
601 - MDADM integration by Matthias Dahl <ua_bugz_gentoo@mortal-soul.de>
602 - ZFS integration by Richard Yao <ryao@cs.stonybrook.edu>
607 /etc/genkernel.conf - genkernel configuration file