Article title: Linux core re-encoding and upgrade. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
1. what functions does Linux core provide?
Linux core is a file (/boot/vmlinuz for most case)
The core supports various computer hardware configurations so that all programs can communicate with computer hardware through the core.
The efficient core must work with the computer (hardware perimeter)
The core provides peripheral hardware drivers: network card, sound card, scsicard, etc.
Communication protocols: TCP/IP, PPP, and Router
Core file system support: ext2, umsdos, iso9660...
Core provides memory management, multi-CPU parallel processing ....
2. what is the difference between Make Kernel and upgrade for Linux?
Core re-compilation uses the original code to create a new core (not necessarily a new version)
The core upgrade uses the original code of the new version to generate the core code of the new version.
Core upgrades must undergo core re-encoding procedures
3. When does the Linux core need to be re-edited?
For core slimming, remove features that are not supported by the original core but are not available
When new features (including modules) are not supported by the original core
When the old core error is corrected (for example, the core cannot be started)
Core upgrade
4. when to upgrade the Linux core
Bug Fix)
When the new interface device or system function cannot be supported by the old core
When the core version lags behind
5. where to obtain the new Linux core?
Official (Official) Kernel ftp Siteftp: // ftp.kernel.org
Linux HeadQuartershttp: // www.linuxhq.com
Collect kernel website ftp://ftp.mgt.ncu.edu.tw/Linux/kernelftp://ftp.nsysu.edu.tw/Linux/metalab.unc.edu/kernel.org/pub/linux/kernelftp://ftp.ccu.edu.tw/pub3/linux/kernel.org-pub/linux/kernel in China
6. Significance of Linux core version number
Linux core version number format: major. minor. patchlevelmajor: major version number, which rarely changes to minor: minor version number. this is the lineage of the Linux core version patchlevel: the patch number of the current core (secondary) version.
"Uname-a" can read the latest version and the time when the core is re-edited. Linux nmc.nchu.edu.tw 2.2.15 #1 Wed May 31 10:56:54 CST 2000 i586 unknown represents 2.2.15 as the core version, the core re-encoding time is 10:56:54
The minor version of the ticket number indicates the test version, and the dual version indicates the formal (stable) version.
7. What are the Linux core upgrade methods?
Directly from the new version's core archive, recompile the core advantages: directly upgrade to the core version disadvantages: you must spend more time downloading the original file of the entire core (the size of the original file compressed by 2.2.15 is about 16 MB) for a major version upgrade, such as 2.2.6 --> 2.2.15
Patch the core Original file (Patch) uses this method to upgrade. the number of times you need to Patch is different from the number of times the new version and the old version are patched. For example, if you upgrade from 2.2.12 to 2.2.15, you must download patch-2.2.13, patch-2.2.14, and patch-2.2.15, fix them one by one, and then compile the core. The repair method is as follows (: #### first you must copy the patch file to/usr/src # cd/usr/src # gzip-cd patch-2.2.13.gz | patch-p0 # gzip-cd patch-2.2.14.gz | patch- p0 # gzip-cd patch-2.2.15.gz | patch-p0 then you can start re-encoding the core. Advantage: Patch files are generally much smaller than all core files (each Patch size ranges from several hundred KB to about 1 MB), and the download speed is faster. Disadvantage: upgrade is not suitable if the version gap is too large.
8. recompile the core
Old pre-job backup core # cp/boot/vmlinuz/boot/vmlinuz.2.2.12
Get New Core Archive (ex.linux-2.2.15.tar.gz.pdf, or program file (patch((ex.patch-2.2.13.gz, patch-2.2.14.gz, & patch-2.2.15.gz)
Backup/usr/src/linux is generally just a symbolic link, you can directly remove it
Unzipping files under/usr/src # tar zxvf linux-2.2.15.tar.gz # mv linux linux-2.2.15 # ln-s linux-2.2.15 linux
Change Directory To/usr/src/linux
Recompile the core steps (for example, upgrading 2.2.12 to 2.2.15) I. make mrproper runs "make mrproper" in the linux Directory. this step aims to clear the unstable target file (. o) to ensure the success of core re-compilation. This step is important and necessary to recompile the core after patching the core. II. make config (make menuconfig, make xconfig) is an important step for reencoding the core. you must answer hundreds of questions based on the system status. incorrect options may cause unavailability of the core. There are three ways to set the image: "make config", "make menuconfig", and "make xconfig"; "make config" in text mode, choose menu mode to set the core options. "make xconfig" is the menu setting mode in the graphic mode (X-Window. After you complete the lengthy setup program, if you do not specify the content storage file name, your settings will be stored in. in/usr/src/linux/arch/i386/defconfig, this is the source of your default option for the next re-encoding of the core. III. make dep this step helps you set the attached file and ensure the dependency of include file. IV. make clean clears the core and driver of the old system. if you recompile the core for the first time, you can skip this step. V. make zImage: compile a new core. if your core size exceeds 640KB, you must use "make bzImage ". If you want to create a boot chip along with the new core, you can use "make zdisk" or "make bzdisk" (if new kernle is larger than 640KB ). The time required for this step is about 20 ~ 40 minutes (or longer), depending on the number of CPU and RAM resources in your system. After compilation, the new core is/usr/src/linux/arch/i386/boot/zImage or/usr/src/linux/arch/i386/boot/zbImage. VI. change the core of system use # cp/usr/src/linux/arch/i386/bzImage/boot/vmlinuz-2.2.15 # cd/boot # ln-s/boot/vmlinuz-2.2.15/boot/vmlinuz # # Make sure your original core is backed up. (As described in the pre-job) if you want to start a new system by using lilo, you must create a boot chip when compiling the core, or directly use "dd" to load the core to the disk. VII. Compile the system module # make modules # make modules_install you must perform this step, otherwise your core will not be able to use your old module. The new module will be installed in the/lib/modules/2.2.15 directory. VIII. update System. map # cp/usr/src/linux/System. map/boot/System. map-2.2.15 # rm/boot/System. map # ln-s System. map-2.2.15 System. the core of each map version has its own System function Image file System. map to define all the functions of the core of this edition. IX. edit lilo. conf. retain the old core boot option. no one can ensure that the system can be enabled for the new core. it is an insurance practice to retain the old core boot option. After you modify lilo. conf, it will look like the following:
Boot =/dev/hda
Map =/boot/map
Install =/boot. B
Prompt
Timeout = 50
Default = linux
Image =/boot/vmlinuz
Label = linux
Read-only
Root =/dev/hda1
Image =/boot/vmlinuz-2.2.12-20
Label = linux. old
Read-only
Root =/dev/hda1
After you run lilo-v, you can re-start the new core. (By Reboot System)
X. uname-
Check the new core version. (After Reboot)
[Root @ nmc ~] # Uname-r
2.2.15 --> Kernel is now 2.2.15
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.