Compiling a Linux kernel
|
|
|
|
| Articles Reviews Linux | |
| Written by Bogdan V | |
| Tuesday, 10 February 2009 | |
|
RedHat is not Linux, but a distribution based on Linux kernel. Linux is a program that provides basic services for the remaining programs from Linux distribution. Because, unlike commercial operating systems like Windows 95 or MacOS, the source code of Linux kernel is freely available, it is very easy to add new features and improvements to it. Rebuilding the Linux kernel sources became therefore an operation quite common, and efforts are being made increasingly large for this operation will become as easy for the unexperienced. Why build a Linux kernel? You could say: "Why should compile your kernel? It works very well as he is!" There are three reasons for doing so. First, because of a hardware device that is so new that the CD on which Linux distribution is not there a kernel module for it. Secondly, it might have encountered a bug of any kind, which was repaired in a subsequent revision of the operating system. Third, it is possible that software to require a newer version of the operating system. Getting the kernel source The latest released versions of the kernel source you can find ftp.kernel.org. This FTP site has a variety of mirror sites around the world, so sure you can find a server from which to download quickly. After you locate the file that contains the latest version of the operating system, download it in the / usr / src. Then use the command tar zxf to unzip. If you do not even need the latest version, then a more comfortable option would be to install a package on the CD distribution that you have that contain kernel sources. As an alternative to the version above, if you already have the kernel sources and not only want to do an upgrade (eg from version 2.2.1 to version 2.2.2), then download the patch file that contains the directory that / usr / src and give the command: gzip-dc patch 2.2.2.gz | patch-P0 This command will update the sources kernelului.Aceasta variant has the advantage of being much faster (no longer have downloaded the entire source code). Configuring the system for compiling Go now in the / usr / src / Linux, and give the following command: make menuconfig The result will be a generation (compiling) the occurrence of several programs and a window. Window menu that allows you to modify many of the kernel options. After you make the appropriate changes, save the new configuration, then do the following things: make dep make clean First orders from above tree builds interdependence between the kernel sources as possible as the connections between them have been affected by the choices you've made in the previous step. Command make clean remove any files remaining from the previous compilation in Linux, files which are now worthless. Now we're finally ready to begin! Give the following command: make zImage After the order, if you have a weaker processor than Pentium 200MHz, you can go to drink coffee. The process takes about 20 minutes on a Pentium 90, because the source code of the kernel is quite thick (maybe you noticed that when you have downloaded). When everything is ready, will give the command make modules This second trial will not take as much as the first. Installing the new kernel The last step is installing the new kernel. In a system based on Intel architecture, the kernel is installed at the site correctly with the command: cp / usr/Linux/src/arch/i386/boot/zImage / boot / newkernel then make modules_install This command will install the kernel modules in / lib / modules. Now you must edit the configuration file of LILO, / etc / lilo.conf, and add a section like the one below: image = / boot / newkernel label = new read-only At the next reboot, choose from the Linux LILO 'new', and it will load the new kernel. If everything goes as you originally wanted, you can move the lines added in the beginning lilo.conf file to make the new kernel the default option. Abstract Compiling the kernel is a relatively simple operation - if you have done something by now! At first may seem overwhelming, if you stand, or you just want something for your kernel, here are some links that might help: http://www.linuxhq.com/ - kernel 'goodies' ftp://ftp.kernel.org/pub/Linux/kernel/ - the official site for the Linux kernel sources http://www.alsa-project.org/ - alternative set of sound drivers for Linux Powered by jReviews |
|
| < Prev | Next > |
|---|







