Product SiteDocumentation Site

7.6. Kernelentwicklung vorbereiten

Fedora Core 6 does not include the kernel-source package provided by older versions since only the kernel-devel package is required now to build external modules. Configured sources are available, as described in this kernel flavors section.

Anleitungen beziehen sich auf den aktuellen Kernel

To simplify the following directions, we have assumed that you want to configure the kernel sources to match your currently-running kernel. In the steps below, the expression <version> refers to the kernel version shown by the command: uname -r.
Users who require access to Fedora Core original kernel sources can find them in the kernel .src.rpm package. To create an exploded source tree from this file, perform the following steps:

Do Not Build Packages as Super-user (root)

Building packages as the superuser is inherently dangerous and is not required, even for the kernel. These instructions allow you to install the kernel source as a normal user. Many general information sites refer to /usr/src/linux in their kernel instructions. If you use these instructions, simply substitute ~/rpmbuild/BUILD/kernel-<version>/linux-<version>.<arch>."]]
  1. Vorbereiten einer Umgebung zum Erzeugung von RPM-Paketen in Ihrem home-Verzeichnis. Führen Sie folgende Befehel aus:
    su -c 'yum install rpmdevtools yum-utils' 
    rpmdev-setuptree
    
  2. Enter the root password when prompted.
  3. Download the kernel-<version>.src.rpm file. Enable any appropriate source repositories, such as Core, Updates, or Testing, with the -e switch:
    yumdownloader -e core-source -e updates-source --source kernel
    
  4. Enter the root password when prompted.
  5. Install kernel-<version>.src.rpm using the command:
    rpm -Uvh kernel-<version>.src.rpm
    
  6. This command writes the RPM contents into ${HOME}/rpmbuild/SOURCES and ${HOME}/rpmbuild/SPECS, where ${HOME} is your home directory.

    Benötigter Platz

    Der komplette Kernelbuildprozess kann einige Gigabyte zusätzlichen Platz im Dateisystem, das Ihre Home-Verzeichnis enthält, benötigen.
  7. Vorbereiten der Kernelquellen durch folgende Befehle:
    cd ~/rpmbuild/SPECS 
    rpmbuild -bp --target $(uname -m) kernel-2.6.spec
    
  8. The kernel source tree is located in the ~/rpmbuild/BUILD/kernel-<version>/linux-<version>.<arch> directory.
    The configurations for the specific kernels shipped in Fedora Core 6 are in the ~/rpmbuild/BUILD/kernel-<version>/linux-<version>.<arch>/configs directory. For example, the i686 configuration file is named ~/rpmbuild/BUILD/kernel-<version>/linux-<version>.<arch>/configs/kernel-<version>-i686.config. Issue the following command to place the desired configuration file in the proper place for building:
    cp configs/<desired-config-file> .config
    
  9. Every kernel gets a name based on its version number. This is the value the uname -r command displays. The kernel name is defined by the first four lines of the kernel Makefile. The Makefile has been changed to generate a kernel with a different name from that of the running kernel. To be accepted by the running kernel, a module must be compiled for a kernel with the correct name. To do this, you must edit the kernel Makefile.
    For example, if the uname -r returns the string 2.6.17-1.2345_FC6, change the EXTRAVERSION definition from this:
    EXTRAVERSION = -prep
    
    hierzu:
    EXTRAVERSION = -1.2345_FC6
    
    Das heißt, ersetze alles ausgehend vom letzten Bindestrich.
  10. Starten Sie folgenden Befehl:
    make oldconfig
    
    Sie können anschließend wie gewohnt fortfahren.

Building Kernel Binary RPMs

Normally, kernels for Fedora are built using the rpmbuild utility and a specfile. Your results may vary if you use the kernel's built-in make rpm target.