+3 votes
180 views
Debian - Compiling and installing a new Kernel

in Linux / Unix by (551k points)
reopened | 180 views

1 Answer

+4 votes
Best answer

The compilation and installation of a new Kernel can take some time, depending on the speed and available resources of our computer, it is important to mention that some programs and libraries must be updated for the creation of the binaries. A complete list of them is found in / usr / src / kernel-source-version / Documentation / Changes .
  • . We set all the dependencies correctly, from the terminal we use the command: make dep . This to start with the verification and fixation of these dependencies, once this process is finished we will proceed to compile our new Kernel .
  • . To create a compressed image of our Kernel we write the following command: make z Image . If everything goes well the image will be created, compressed and saved in the following path: ./arch/i386/boot . If there were no errors we can go directly to step 4. However, if we receive an error indicating that the image is very large, go to step 3. The error would look like this:

image

  • Since the image of the Kernel is very large, we need to use a different understanding method. To create an image with an alternative method we run the following command: make bz Image
The file will be created in the same path as z Image but under the name of bz Image .
  • If during the configuration of the Kernel we chose to make a portion of the module instead of being part of it, we must compile these modules with the following: make modules
  • If we are compiling a Kernel of the same version that we already have installed, we must make sure that we have copied the old modules to the new route. . One way to do this is renaming the directory in the following way: mv /lib/modules/2.xx /lib/modules/2.xx-old .
  • After the modules were compiled we will proceed to the installation of them with the command: make modules_install.
This will copy the modules to the appropriate path in the file system. Now it will be our responsibility to upload them to the Kernel .

In the event that something really goes wrong in this process of updating our Kernel , we should not worry if we still have access to our system. We should have the installation CD to boot from the alert window of the same. From there we fsck our drive, assemble it and restore the image of the Kernel we had previously made.
  • Finally now that we have a Kernel compiled, compressed and ready to install, we are ready to fix it running in our system in the next reboot. To start we make a copy of the new Kernel located in / usr / src / Linux / arch / i386 / boot / zImage or in case our compression method has failed / usr / src / Linux / arch / i386 / boot / bzImage a /boot/vmlinux-2.xx (the x depending on the version we have compiled) this using a new name for this file. Important, we must make sure not to overwrite existing images.

With this we would finish with the installation of our Kernel , remembering that copying the same with a new name will give us the opportunity to change Kernel each time we boot our computer.


by (3.5m points)
edited

Related questions

+3 votes
1 answer
asked Oct 23, 2019 in Linux / Unix by backtothefuture (551k points) | 227 views
+3 votes
1 answer
asked May 26, 2019 in Linux / Unix by backtothefuture (551k points) | 207 views
+3 votes
1 answer
asked May 24, 2019 in Linux / Unix by backtothefuture (551k points) | 277 views
+3 votes
1 answer
+5 votes
1 answer
asked May 12, 2019 in Linux / Unix by backtothefuture (551k points) | 181 views
Sponsored articles cost $40 per post. You can contact us via Feedback
10,634 questions
10,766 answers
510 comments
3 users