Linux kernel upgrade
An important feature of Linux is the openness of its source code. Any software engineer in the world can join the code you think of excellent code. A significant advantage that caused by this is the fast and the latest software for Linux repair vulnerabilities. Technology utilization. The LINUX kernel is the most direct representative of these features. Why upgrade the literal meaning of the core as its name, Linux core assumes the core tasks of the Linux operating system, is the arbitrator of other programs and hardware, etc., it is necessary to manage the memory of all processes to ensure they Equire can get the slot of the processor. In addition, it also provides functions such as interfaces between procedures and hardware. Typically, the updated core will support more hardware, with better process management capabilities, faster running, more stable, and generally repair many vulnerabilities found in the old release, etc., often select the upgrade update system kernel It is the necessary operation of Linux users. In general, the version serial number of the kernel uses three numbers, such as 2.2.14, the higher the version number, the stronger the function. The version number is divided into two series: one is the product line, with an even number, for example, 1.2.x, 2.0.x, 2.2.x, etc., running stable, has been tested more carefully; the other is the development test series Using an odd number to test the latest features, it is not recommended to use in beginners and production. The rear section of this article will introduce the steps, concepts, precautions, and the more documentation that can be referred to by the upgrade process of kernel 2.0.34 to 2.2.14, respectively, and the oblique characters appearing in the article are direct input commands. The kernel configuration and compiling Linux currently supported CPU types include X86, ARM, DEC Alpha, Sun SPARC, M68000, MIPS, POWERPC, etc., which should have, which already include the CPU model used by most users. During the installation and configuration, Linux automatically recognizes these models. The first command to run is: #CD / usr / src / linux; make mrproper. Ensure that there is no incorrect .o file and the mutual dependence of the file in the source code directory. The next kernel configuration process is more cumbersome, but the configuration is properly related to the running of Linux, it is necessary to understand some of the main and often used options. Configuring the kernel can use one of the following commands as needed: #make config (the most traditional configuration interface Based on text) #make menuconfig (Configuration Interface Based on Text Sheet) #make Xconfig (Based on Graphic Window Mode) #Make OldConfig (If you only want to modify some small places on the basis of the original kernel configuration, you will save a lot of trouble) When you are configured, most of the options can use their default values, only small parts need to be selected according to user needs. . For example, if you need a file system that supports the DOS partition, you must select FAT or DOS system support in the file system section; if the system is equipped with a NIC, a PCMCIA card, etc., you need to select the type of card in the network configuration. When selecting the appropriate configuration, there are three options, which represent the meaning of the following: "Y" - compile the function into the kernel "N" - Do not compile the function into the kernel "M" - compile the function into need When moving into the module in the kernel. The partial function code that is far from the core other partial relationship and is not frequently used, facilitates the reduction of the length of the kernel, reducing the memory consumption of kernel, simplifies the impact of the kernel when the function changes.
Many functions can be handled like this, such as support of the network card mentioned above, support for Fat and other file systems. After configuring the kernel, then you need to check the dependence and integrity of the kernel source code file, and compile, at which point the GCC version used in the system is available in GCC-2.7.2: #make deposits In the correct location) #make clean (Make sure all relevant files are in the latest version state) #make zimage (kernel compiling compressed form) The kernel may become large when the kernel supports more peripherals and functions. You can compile the large kernel: #make bzimage Compile time with factors such as the hardware condition of the machine and the kernel configuration, with the author's 64MB memory classifier 300 as an example, compile core, a generally takes more than 20 minutes. The location of the core obtained is in / usr / src / linux / arch / i386 / boot directory, of course, it is assumed that the user's CPU is X86. If you select the loadable module, after compiling the kernel, you should compile the selected module: #make module (Module) #Make Module-Install (transfer the compiled module to the system standard location) Module in the system The standard directory is located in / lib / modules / xyz, and the back XYZ is the version number. For security reasons, it is best to back up / lib / modules before running #make modules-install. The module is usually a file with an extension .o, using command #lsmod to list the module of the current kernel. Software Download and Unpack Select relatively fast and authoritative sites to download the latest kernel source code packages, such as conditions allowed to download: ftp://sunsite.unc.edu/pub/linux/kernel domestic Linux Users can download: http://studio.openunix.org http://www.clinuxworld.com Note that if the upgraded version has a large span, and now you have to download the latest modules when you are expected to configure external modules. Tools Modules-xyztar.gz. The core code of the Linux system is stored in the directory / usr / src / linux. In fact, this directory is a link to the current version of the current version used, for example if the current version is 2.0.34, the actual directory of the core It should be: /usr/src/linux-2.0.34. The directory in the newly downloaded kernel is Linux, so that directly under the / usr / src will cause the original kernel directory to be overwritten. So a steady practice is to first remove the link Linux, then unpack, rename, re-link. Before unpacking, confirm that there is no directory called Linux in / usr / src directory, or no longer want to keep this directory. In addition, with the enhancement of Linux kernel function and support for more peripherals, the file package is getting more and more, the current latest stable version 2.2.14 core compression package is about 14MB, but actually decompressed and compiled Equation, the idle space of the partition where the / usr / src directory is required is greater than 60MB bytes.