|
|
Line 33: |
Line 33: |
| More information can be found in the [[Funtoo Linux Installation]] Guide. | | More information can be found in the [[Funtoo Linux Installation]] Guide. |
|
| |
|
| == Funtoo Linux Genkernel ==
| |
|
| |
| Funtoo Linux contains a forked/enhanced version of genkernel with the following new capabilities:
| |
|
| |
| * genkernel can use a build directory that is separate from the kernel source directory. This is enabled using the new {{c|--build-dst}} option.
| |
| * {{c|--build-src}} is a new option that is equivalent to the {{c|--kerneldir}} option.
| |
| * {{c|--fullname}} can be used to specify the entire name of the kernel and initramfs images -- everything after {{c|kernel-}} and {{c|initramfs-}}.
| |
| * {{c|--firmware-src}} - a new option that works identically to {{c|--firmware-dir}}.
| |
| * {{c|--firmware-dst}} - a new capability - you can now define where genkernel installs firmware.
| |
| * Genkernel uses Funtoo Linux {{c|lvm2}} rather than building its own.
| |
| * Some compile fixes.
| |
|
| |
| == Using Debian-Sources with Genkernel ==
| |
|
| |
| {{fancyimportant|Debian-sources is now fully compatible with the ''binary'' USE flag and recommended for desktop users. The below example is valid for manual installation. At least 19G of disc space required to build. Take this into account, when using separate /var or using virtual machines with limited size}}
| |
|
| |
| This section describes how to build a binary kernel with ''{{c|debian-sources}}'' and ''{{c|genkernel}}'', and it also explains how to use Funtoo Linux's ''{{c|config-extract}}'' tool to list and create official Debian kernel configurations.
| |
|
| |
| === First step: emerging the required packages ===
| |
|
| |
| The first step is to emerge:
| |
|
| |
| # The Debian sources
| |
| # Genkernel itself
| |
|
| |
| This is achieved by running the following:
| |
|
| |
| <console>
| |
| ###i## emerge -av sys-kernel/debian-sources sys-kernel/genkernel
| |
| </console>
| |
|
| |
| Once the Debian kernel sources are deployed, you should find a directory named '''linux-debian-''version''''' (e.g. linux-debian-2.6.32.30) under '''{{c|/usr/src}}'''. Update your the '''{{c|linux}}''' symlink to point on this directory:
| |
| <console>
| |
| ###i## cd /usr/src
| |
| ###i## rm linux
| |
| ###i## ln -s linux-debian-2.6.32.30 linux
| |
| </console>
| |
|
| |
| Alternatively, emerge the debian-sources with the ''{{c|symlink}}'' USE flag.
| |
|
| |
| === Second step: Grabbing a configuration file ===
| |
|
| |
| If is now time to download the kernel configuration file. For this tutorial we will use a configuration file for AMD64 (several others architectures like MIPS or SPARC64 are available.) To view a complete list of available kernel configurations, type {{c|./config-extract -l}} '''in the Debian kernel source directory''':
| |
|
| |
| <pre>
| |
| ninja1 linux-debian-2.6.32.30 # ./config-extract -l
| |
|
| |
| ====== standard featureset ======
| |
|
| |
| alpha: alpha-generic, alpha-legacy, alpha-smp
| |
| amd64
| |
| armel: iop32x, ixp4xx, kirkwood, orion5x, versatile
| |
| hppa: parisc, parisc-smp, parisc64, parisc64-smp
| |
| i386: 486, 686, 686-bigmem, amd64
| |
| ia64: itanium, mckinley
| |
| m68k: amiga, atari, bvme6000, mac, mvme147, mvme16x
| |
| mips: 4kc-malta, 5kc-malta, r4k-ip22, r5k-ip32, sb1-bcm91250a, sb1a-bcm91480b
| |
| mipsel: 4kc-malta, 5kc-malta, r5k-cobalt, sb1-bcm91250a, sb1a-bcm91480b
| |
| powerpc: powerpc, powerpc-smp, powerpc64
| |
| s390: s390x, s390x-tape
| |
| sh4: sh7751r, sh7785lcr
| |
| sparc: sparc64, sparc64-smp
| |
| sparc64: sparc64, sparc64-smp
| |
|
| |
| ====== vserver featureset ======
| |
|
| |
| amd64
| |
| i386: 686, 686-bigmem
| |
| ia64: itanium, mckinley
| |
| powerpc: powerpc, powerpc64
| |
| s390
| |
| sparc
| |
| sparc64
| |
|
| |
| ====== xen featureset ======
| |
|
| |
| amd64
| |
| i386
| |
|
| |
| ====== openvz featureset ======
| |
|
| |
| amd64
| |
| i386
| |
| </pre>
| |
|
| |
| Type {{c|config-extract -h}} for extended usage information:
| |
|
| |
| <pre>
| |
| ninja1 linux-debian-2.6.32.30 # ./config-extract -h
| |
| This work is free software.
| |
|
| |
| Copyright 2011 Funtoo Technologies. You can redistribute and/or modify it under
| |
| the terms of the GNU General Public License version 3 as published by the Free
| |
| Software Foundation. Alternatively you may (at your option) use any other
| |
| license that has been publicly approved for use with this program by Funtoo
| |
| Technologies (or its successors, if any.)
| |
|
| |
| usage: config-extract [options] arch [featureset] [subarch]
| |
|
| |
| -h --help print this usage and exit
| |
| -l --list list all available kernel configurations
| |
| -o --outfile specify kernel config outfile --
| |
| defaults to .config in current directory
| |
| [featureset] defaults to "none" if not specified
| |
| [subarch] defaults to the only one available; otherwise required
| |
|
| |
| This program was written by Daniel Robbins for Funtoo Linux, for the purpose of
| |
| easily and conveniently extracting Debian kernel configurations. To see a nice
| |
| list of all available kernel configurations, use the --list option.
| |
|
| |
| Debian's kernel configs are specified internally in arch_featureset_flavor
| |
| format, such as: "amd64_openvz_amd64". The featureset typically describes an
| |
| optional kernel configuration such as "xen" or "openvz", while the flavor in
| |
| Debian terminology typically refers to the sub-architecture of the CPU.
| |
|
| |
| When using this command, you must specify an arch. A featureset of "none" is
| |
| assumed unless you specify one, and by default this program will pick the only
| |
| available subarch if there is only one to choose from. If not, you will need to
| |
| pick one (and the program will remind you to do this.)
| |
|
| |
| The kernel configuration will be written to ".config" in the current directory,
| |
| or the location you specified using the -o/--outfile option.
| |
| </pre>
| |
|
| |
| Let's use {{c|config-extract}} to create a kernel configuration for an amd64 system:
| |
|
| |
| <console>
| |
| # ##i##cd linux
| |
| # ##i##./config-extract amd64 standard amd64
| |
| Wrote amd64_none_amd64 kernel configuration to /usr/src/linux-debian-2.6.32.30/.config.
| |
| </console>
| |
|
| |
| {{c|config-extract}} also allows you to extract special Debian featuresets, such as settings for Xen and [[OpenVZ]] kernels:
| |
|
| |
| <console>
| |
| # ##i##./config-extract amd64 openvz
| |
| Wrote amd64_openvz_amd64 kernel configuration to /usr/src/linux-debian-2.6.32.30/.config.
| |
| </console>
| |
|
| |
| '''It is necessary to name the kernel configuration file something other than ".config" to avoid errors with genkernel.'''
| |
|
| |
|
| |
| After using {{c|config-extract}}, run {{c|make oldconfig}} and accept all default options by hitting Enter at all prompts.
| |
|
| |
| {{fancynote|if you are using the XFS file system as your root partition: Run {{c|make menuconfig}} and ensure that "File Systems --> XFS filesystem support" and "Library Routines --> CRC32c (Castagnoli, et al) Cyclic Redundancy-Check" are both set to * (and not [m]).}}
| |
| This is needed to ensure that your system can boot up correctly for kernel versions >= 3.10.11.
| |
|
| |
| === Third step: Building and installing the kernel ===
| |
|
| |
| This is simply achieved by:
| |
|
| |
| {{console|body=
| |
| # ##i##genkernel --kernel-config=config-2.6.32-5-amd64 all
| |
| }}
| |
|
| |
| * {{c|--kernel-config}}: use the given configfile. If you only give a filename here, it is searched for in your current working dir. You can also use a relative or an absolute path leading to your configfile here (for example: {{c|1=--kernel-config=/usr/src/linux/configfile}}).
| |
| * {{c|all}}: rebuild the kernel image and the initramfs ramdisk image (aside of kernel modules, the ramdisk image contains tools such as BusyBox and some generic startup scripts, depending on options you use on the command line several additional tools like lvm or raid volume management can be incorporated as well).
| |
|
| |
| {{important|Unless explicitly stated via {{c|--no-clean}} or {{c|--no-mrproper}}, Genkernel will do a {{c|make mrproper}} in the kernel source tree, thus cleaning a previous build '''and removing the previous kernel configuration file''' in it.
| |
| }}
| |
|
| |
| Once the kernel has been compiled and the RAM disk has been generated, the kernel image plus its companion files (initramfs image and System.map) are placed in the {{f|/boot}} directory. You can use your favorite tool to update your boot-loader configuration files.
| |
|
| |
| [[Category:Internals]]
| |
| [[Category:Funtoo features]] | | [[Category:Funtoo features]] |
| [[Category:Kernel]] | | [[Category:Kernel]] |