Kernel/Upgrade/nl

Dit artikel beschrijft de stappen om naar een nieuwe kernel te upgraden.

Installatie
Een kernel upgrade is mogelijk nodig wanneer nieuwe kernel broncode is geïnstalleerd na een systeem update of wanneer je zelf nieuwe kernel broncode installeert.

Of course, they can be installed directly using the next command (replace gentoo-sources with whatever version of the kernel that is in-use):

Installing new kernel sources doesn't provide the user with a new kernel. It is necessary to make and install a new kernel from the new sources and then reboot the system to actually run the new kernel.

Making a new kernel from the new sources is basically the same process as making a kernel when installing the system. The difference is that one can use the configuration of the old kernel to create a configuration for the new kernel. Using the old configuration saves the user from going through all the kernel options (like ) again.

The kernel configuration is saved in a file named in the directory that holds the kernel sources. A new kernel may have had options or features added or removed since the old kernel. The kernel configuration specifies whether a kernel's features and options will be enabled or not, perhaps built into the kernel, or perhaps built as modules which can be loaded into the running kernel on demand. Hence the configuration file of the new kernel may have new entries the configuration file of the old kernel doesn't have, and it might not have entries anymore which are present in the configuration file of the old kernel.

To deal with such changes of the configuration file, the configuration file of the old kernel needs to be converted to a configuration that can be used with the new kernel. This article shows how to make a new kernel from new kernel sources with converting the configuration file of the old kernel.

Backup the current kernel configuration
It is wise to make a backup of the kernel configuration so that the previous configurations are not lost. After all, many users devote considerable time to figure out the best configuration for the system, and losing that information is definitely not wanted.

It is easy to make a backup of the current kernel configuration:

Provided that the symlink to the kernel sources has been set correctly, this copies the configuration of the currently used kernel to the home directory of root, renaming the configuration to followed by the version of the current running Linux kernel.

Set symlink to new kernel sources
De symbolische link zou altijd naar de kernel broncode moeten verwijzen die momenteel gebruikt word. Dit kan in een van de volgende drie manieren gedaan worden:


 * 1) Installing the kernel sources with
 * 2) Setting the link with eselect
 * 3) Manually updating the symbolic link

Installing the kernel sources with the symlink USE flag
This will make the point to the newly installed kernel sources.

If necessary, it can still be modified later with one of the other two methods.

Setting the link with eselect
To set the symlink with :

This outputs the available kernel sources. The asterisk indicates the chosen sources.

To change the kernel sources, e.g. to the second entry, do:

Manually updating the symbolic link
To set the symbolic link manually:

Moving to the new folder
Now that the symbolic link has been modified, change the working directory to the new kernel folder.

Copy previous kernel configuration
The configuration of the old kernel needs to be copied to the new one. In addition to the backup copy that was saved to in an earlier step, the old configuration can be found in several places:


 * In het procfs bestandssysteem, als de kernel optie Kernel .config support werd geactiveerd in jouw huidige kernel:


 * From the old kernel. This will only work when the old kernel was compiled with CONFIG_IKCONFIG:


 * In de map, als je het configuratie bestand daar had geïnstalleerd:


 * In de kernel map van de huidige kernel die je draait:


 * In the directory, if   is set in  and  was previously used:

.config file
To use the configuration of the old kernel with the new kernel, it needs to be converted. The conversion can be done by running either or. Use either, not both.

make silentoldconfig
The following configuration is like the text based configuration with. For new configuration options, the user is asked for a decision. For example:

The string (NEW) at the end of the line marks this option as new. Left to the string in square brackets are the possible answers: Yes, no, module or ? to show the help. The recommend (i.e. default) answer is capitalized (here Y). The help explains the option or driver.

Unfortunately doesn't show a lot more information for each option, such as the context, so it is sometimes difficult to give the right answer. In this case the best way to go is to remember the option name and revise it afterwards through one of the graphical kernel configuration tools.

make olddefconfig
If all new configuration options should be set to their recommended (i.e. default) values use :

make help
Use to see other conversion methods available:

Bouwen
Voor deze stap, volg je de stappen die vermeld staan in het manueel configureren artikel.

Automated build and installation
It is possible to automatically build and install the newly emerged kernel using Portage hooks. While other approaches are also possible, the following is based on genkernel and gentoo-sources package. It requires the following prerequisites:


 * 1)  is able to build and install the kernel to which the  symlink points into   and the bootloader.
 * 2) The   use flag is set for the kernel ebuild.

If those are fulfilled, simply install a  Portage hook as shown below.

Externe kernel modules herinstalleren
Enige externe kernel modules, zoals bijvoorbeeld binaire kernel modules, dienen opnieuw gebouwd te worden voor elke nieuwe kernel. Als de kernel nog niet gebouwd was, dient deze eerst voorbereid te worden voor het bouwen van externe kernel modules.

Je kan de pakketten herbouwen met de @module-rebuild verzameling:

Solving build problems
When experiencing build problems while rebuilding the current kernel, it might help to sanitize the kernel sources. Make sure to backup the file first, as the operation will remove it. Make sure not to use a or  suffix as backup as  will clean those up as well.

Oude kernels verwijderen
Zie het kernel verwijderen artikel.

Externe links

 * Veranderingen in de kernel met enkele uitleg van sommige nieuwe functionaliteit