7.10. Linux-2.6.24.7

Le paquet Linux contient le noyau Linux.

7.10.1. Installation de the kernel

[Warning]

Warning

Un noyau temporaire compilé de façon croisée sera ici construit. Lors de sa configuration, sélectionnez un jeu d'options minimal requis pour démarrer la machine cible et construire le système final. Ainsi, aucun support pour le son, les imprimantes, etc ne sera nécessaire.

Essayez d'éviter aussi si possible l'utilisation de modules et n'utilisez pas l'image du noyau finale pour la production de systèmes.

A number of vulnerabilities have come to light after the stable kernel team stopped supporting 2.6.24. The following patch addresses them:

patch -Np1 -i ../linux-2.6.24.7-security_fixes-1.patch

La construction du noyau implique quelques étapes — la configuration, la compilation et l'installation. Lisez le fichier README dans l'arborescence des sources du noyau pour des méthodes alternatives de à celle utilisée par le livre pour configurer le noyau.

Préparez la compilation en lançant la commande suivante :

make mrproper

Ceci garantit que l'arborescence du noyau est absolument propre. L'équipe du noyau recommande que cette commande soit exécutée avant chaque compilation du noyau. Ne pensez pas que l'arborescence des sources est propre après la décompression.

Configurez le noyau avec l'interface en menu :

make ARCH=i386 CROSS_COMPILE=${CLFS_TARGET}- menuconfig

Compile the kernel image and modules:

make ARCH=i386 CROSS_COMPILE=${CLFS_TARGET}-

Si vous ne pouvez pas vous passer des modules du noyau, vous pouvez avoir besoin d'un fichier /etc/modprobe.conf. Vous trouverez des informations concernant les modules et la configuration du noyau dans la documentation du noyau dans le répertoire Documentation de l'arborescence des sources du noyau. La page de man modprobe.conf peut aussi être intéressante.

Be very careful when reading other documentation relating to kernel modules because it usually applies to 2.4.x kernels only. As far as we know, kernel configuration issues specific to Hotplug and Udev are not documented. The problem is that Udev will create a device node only if Hotplug or a user-written script inserts the corresponding module into the kernel, and not all modules are detectable by Hotplug. Note that statements like the one below in the /etc/modprobe.conf file do not work with Udev:

alias char-major-XXX some-module

Install the modules, if the kernel configuration uses them:

make ARCH=i386 CROSS_COMPILE=${CLFS_TARGET}- \
    INSTALL_MOD_PATH=${CLFS} modules_install

After kernel compilation is complete, additional steps are required to complete the installation. Some files need to be copied to the ${CLFS}/boot directory.

Issue the following command to install the kernel:

cp -v arch/i386/boot/bzImage ${CLFS}/boot/clfskernel-2.6.24.7

System.map is a symbol file for the kernel. It maps the function entry points of every function in the kernel API, as well as the addresses of the kernel data structures for the running kernel. Issue the following command to install the map file:

cp -v System.map ${CLFS}/boot/System.map-2.6.24.7

The kernel configuration file .config produced by the make menuconfig step above contains all the configuration selections for the kernel that was just compiled. It is a good idea to keep this file for future reference:

cp -v .config ${CLFS}/boot/config-2.6.24.7

Les détails sur ce paquet sont situés dans Section 12.3.2, “Contents of Linux.”