Linux kernel upgrade 2 rpm

Source: Internet
Author: User

     Linux kernel upgrade one, Linux kernel overview Linux is an integrated kernel (monolithic kernel) system. The device driver has full access to the hardware. Device drivers within Linux can be conveniently set up in a modular (modularize) format and can be mounted or unloaded directly while the system is running. 1. The Linux kernel Linux operating system is a low-level support software used to deal with hardware and provide a limited set of services for user programs. A computer system is a kind of hardware and software symbiosis, they depend on each other, inseparable. A computer's hardware that contains peripherals, processors, memory, hard disks, and other electronic devices that compose a computer's engine. But there is no software to operate and control it, itself is not working. The software that completes this control is called the operating system, which is called the "kernel" in the terminology of Linux, and can also be called "core". The main modules (or components) of the Linux kernel are divided into the following sections:. Process Management (Management). Timers (timer). Interrupt Management (interrupt management). Memory management (Management). Module management (modules management). Virtual file System interface (VFS layer). FileSystem (file system). Device drivers (Devices driver). interprocess communication (inter-process communication). Network management (Management). Implementation of operating system functions such as System init. 2. Linux kernel version number the Linux kernel uses three different version numbering methods.  The first method is used before the 1.0 version (including 1.0). The first version is 0.01, followed by 0.02, 0.03, 0.10, 0.11, 0.12, 0.95, 0.96, 0.97, 0.98, 0.99, and after 1.0.  The second method is used after 1.0 to 2.6, the number consists of three parts "A.B.C", A represents the major version number, B represents the minor major version number, and C represents the minor last version number.  Only when the kernel has changed greatly (historically only two times, 1994 of 1.0, 1996 2.0), a has changed. The number B can be used to determine whether Linux is stable, even b for the stable version, and the odd B for the development version.  C represents some bug fixes, security updates, new features, and number of drives.  In version 2.4.0, for example, 2 represents the major version number, 4 represents the minor version number, and 0 represents a minor change in the last version number. In the version number, the second digit of the ordinal isEven versions indicate that this is a stable version that can be used, such as 2.2.5;  The second odd version of the ordinal is usually a few new things to join, it is not necessarily a stable test version, such as 2.3.1. This stable version is derived from the previous beta upgrade version number, and a stable version is not developed until it is fully mature.  The third way, starting with the 2.6.0 version of 2004, is to use a "time-based" approach.  Prior to version 3.0, it was a "a.b.c.d" format.  In seven years, the first two digits a.b namely "2.6" remain unchanged, c with the release of the new version of the increase, d for some bug fixes, security updates, add new features and the number of drivers.  After version 3.0 is the "A.B.C" format, B increases with the release of the new version, and C represents some bug fixes, security updates, new features, and number of drives.  The third method does not use even numbers for stable version, odd for the development version of the naming method. For example: 3.7.0 is not a development version, but a stable version! The Linux kernel upgrade time map is as follows: the detailed table for the Linux kernel version is as follows (http://en.wikipedia.org/wiki/Linux_kernel#Version_numbering): Longterm support: Provide long-term support for kernel version stable: Stable version, not beta relationship is: Stable version does not always provide long-term support, and provide long-term support must be stable version 3. As the Linux distribution Linux kernel evolved, we had to mention the role of various Linux distributions because they were driving the application of Linux and more people began to focus on Linux. Some organizations or manufacturers, the Linux system's kernel and peripheral utilities (Utilities) software and documentation, and provide some system installation interface and system configuration, settings and management tools, constitute a release version (distribution), Linux distributions are actually a large package of Linux cores plus peripheral utilities. Relative to the Linux operating system kernel version, the release version number varies with the publisher, and the version number of the Linux system kernel is relatively independent. So it is not exact to say that SuSE, RedHat, Ubuntu, Slackware, etc. are directly Linux, they are distribution versions of Linux, or, more specifically, "Linux-centric operating system packages". According to the GPL, these distributions originate from one core and each have their own contributions, but none of them have their own copyrights. LinuxDistributions (distribution) are the same Linux kernel developed and published using Linus-led, so there is no compatibility issue at the kernel level. Each version is a different feeling, but only in the outermost layer of the release version is reflected, and not the Linux itself, especially the kernel is not uniform or incompatible. When Linux began to appear in the early 90 's, it was only in the form of source code that users needed to compile under other operating systems to use. A number of official versions appeared later. Some of the most popular official versions are: SUSE, RedHat, Fedora, Debian, Ubuntu, CentOS, Gentoo, and more. Users can choose the right Linux distribution based on their experience and preferences. Second, the kernel upgrade strategy 1. View Linux kernel version: # uname-r 2.6.18-194.el5 2. Download the new kernel version: Go to the official website to download the latest kernel version and corresponding patches: https://www.kernel.org/I chose 3.2.14#wget-c http://www.kernel.org/pub/linux/kernel/. V3.0/LINUX-3.2.14.TAR.BZ2 3. Unzip to copy the required files to/USR/SRC and unzip. (Note: If the space under the/USR/SRC is not enough, the source file in the other directory is the same) # CP linux-3.2.14.tar.gz/usr/src/# cd/usr/src/extract the files to/usr/src/kernels# TAR-XVF Linux-3.2.14.tar.gz-c/usr/src/kernels 4. Clean up files to erase some of the incorrect files left by previous upgrades. # cd/usr/src/kernels/linux-3.2.14# Yum install ncurses-devel #升级ncurses # make mrporper# cp/boot/config-' uname-r ' /usr/src/kernels/linux3.2.14/.config #使用原来的配置文件5. Configure the kernel by Menu mode # cd/usr/src/kernels/linux-3.2.14# make menuconfig Linux configuration menu as shown in: Be sure to tick (enter Y to select, m compile as module) A, general setup→[*] Enable deprecated Sysfs Features To userspace tools B, Processor type and features→highmemory support. C. Locate the following check option and select: Networking support→networking options→network Packet filtering Framework (NetFilter) (1) Corenetfilter Co Nfiguration. Tick "NetFilter Connection tracking support"-m state related module is dependent on it, do not choose not: The NetBIOS Name Service protocal support (new) is compiled into a module, or an error occurs after the iptables is started after the upgrade. Tick "NetFilter xtables support (required for Ip_tables)" (2) Ip:netfilter Configuration. Compile "IPV4 connection tracking support (require for NAT)" into a module: Ching IP Tables Support (required for Filtering/masq/nat): Compile "Masquerade target support" under "Full NAT" and "REDIRECT target-support" into Module 6. Compile and install kernel # make clean//clear the target file under kernel compilation # make Bzimage//Generate kernel file # make modules//Encode module # make Modules_install// Install module # make install//install 7. Edit boot menu Options Grub file will change default=1 to default=0# vim/etc/grub.conf # grub.conf generated by Anaconda # # Note so you don't hav E to rerun grub after making changes to the this file # Notice:you does not have A/boot partition. This means: all kernel and initrd paths is relative to/, eg. # root (hd0,0) # kernel/boot/vmlinuz-version ro root=/dev/sda1 # initrd/boot/initrd-version.i MG #boot =/dev/sda default=0 timeout=5 splashimage= (hd0,0)/boot/grub/splash.xpm.gz hiddenmenu title Red Hat Enterprise Linux Server (3.2.14) root (hd0,0) kernel/boot/vmlinuz-3.2.14 ro root=label=/initrd/boot/initrd -3.2.14.img title Red Hat Enterprise Linux Server (2.6.18-274.el5) root (hd0,0) kernel/boot/vmlinuz-2.6.1 8-274.el5 ro root=label=/initrd/boot/initrd-2.6.18-274.el5.img "Save and exit" 8. Reboot # Shutdown-r "Now" 9.                  View kernel compilation Results # Uname-r 3.2.14-rt24 Three, errors encountered in kernel compilation and resolution error one, error message at compile time in file included From/usr/include/sys/time.h:31, From/usr/include/linux/input.h:12, from samples/hidraw/hid-example.c:14:/usr/include/sys/select.h : 78:error:conflicting types for ' fd_set '/usr/include/linux/types.h:12:error:previous declaration of ' Fd_set ' is here in file included From/usr/include/linux/input.h:14, From samples/hidraw/hid-example.c:14:/usr/include/sys/types.h:46:error:conflicting types for ' loff_t '/usr/include  /linux/types.h:30:error:previous declaration of ' loff_t ' was here/usr/include/sys/types.h:62:error:conflicting types For ' dev_t '/usr/include/linux/types.h:13:error:previous declaration of ' dev_t ' is here in file included From/usr/inc lude/sys/types.h:133, from/usr/include/linux/input.h:14, from Samples/hidraw/hid-exampl E.C:14:/usr/include/time.h:105:error:conflicting types for ' timer_t '/usr/include/linux/types.h:22:error:previous Declaration of ' timer_t ' is here in file included From/usr/include/linux/input.h:14, from Samples/hidra W/HID-EXAMPLE.C:14:/usr/include/sys/types.h:198:error:conflicting types for ' int64_t '/usr/include/linux/types.h : 98:error:previous Declaration of ' int64_t ' was here/usr/include/sys/types.h:204:error:conflicting types for ' u_int64_t '/usr/include/linux/types.h:97                  : error:previous declaration of ' u_int64_t ' is here in file included From/usr/include/linux/input.h:14, From samples/hidraw/hid-example.c:14:/usr/include/sys/types.h:235:error:conflicting types for ' blkcnt_t '/usr/ include/linux/types.h:114:error:previous declaration of ' blkcnt_t ' is here samples/hidraw/hid-example.c:15:26:error : Linux/hidraw.h:no such file or directory Samples/hidraw/hid-example.c:in function ' main ': Samples/hidraw/hid-example. C:48:error:storage size of ' rpt_desc ' isn ' t known samples/hidraw/hid-example.c:49:error:storage size of ' info ' isn ' t k Nown samples/hidraw/hid-example.c:65:error: ' Hidiocgrdescsize ' undeclared (first use of this function) samples/hidraw/ Hid-example.c:65:error: (Each undeclared identifier was reported only once samples/hidraw/hid-example.c:65:error:for EAC h function it appears in.) Samples/hidraW/hid-example.c:73:error: ' Hidiocgrdesc ' undeclared (first use of this function) samples/hidraw/hid-example.c:84: Warning:implicit declaration of function ' Hidiocgrawname ' samples/hidraw/hid-example.c:91:warning:implicit Declaration of function ' Hidiocgrawphys ' samples/hidraw/hid-example.c:98:error: ' Hidiocgrawinfo ' Undeclared (first use In this function) samples/hidraw/hid-example.c:49:warning:unused variable ' info ' samples/hidraw/hid-example.c:48: warning:unused variable ' rpt_desc ' samples/hidraw/hid-example.c:in function ' bus_str ': samples/hidraw/hid-example.c : 171:error: ' Bus_virtual ' undeclared (first use with this function) make[2]: * * * [samples/hidraw/hid-example] Error 1 make[ 1]: * * * [Samples/hidraw] Error 2 Make: * * * [Vmlinux] Error 2 solution: # CP include/linux/hidraw.h/usr/include/linux/# CP inclu de/linux/hid.h/usr/include/linux/# vim samples/hidraw/hid-example.c (compiled under Linux sometimes encounters this problem, which seems to be a legacy of Linux history: put all # Include refers to the front, the inclusion of include in the following, it can be compiled and passed, the problem is that there is a circular reference. ) willThe following 3 lines of 13-15 rows are moved after 33 rows.       The #include #include #include #include #include #include              #include "Save and Exit" # Vim/usr/include/linux/input.h line 647 #define BUS_PCI 0x01 #define BUS_ISAPNP           0x02 #define BUS_USB 0x03 #define Bus_hil 0x04 #define Bus_bluetooth               0X05/* The following behavior is added */#define BUS_VIRTUAL 0x06 #define BUS_ISA 0x10 #define BUS_I8042 0x11 #define BUS_XTKBD 0x12 #define BUS_RS232 0x13 #define Bus_gameport 0x14 #def                  INE bus_parport 0x15 #define BUS_AMIGA 0x16 #define BUS_ADB 0x17 #define BUS_I2C 0x18 #define BUS_HOST 0x19 #define BUS_GSC 0x1A/* The following two actions added */#define Bus_at ARI 0x1B #define BUS_SPI 0x1C "Save and exit" and recompile; error two: Error message: Kernel panic-not syncing:vfs:unableTo mount Root FS on Unkown-block (0,0) Error parsing: initrd-*.*.img file has a problem; the real root file system could not be mounted successfully.                       WORKAROUND: Please confirm that the make install command was executed and I wasted a week because I didn't execute the command. Error three: Error: Create root device mkrootdev:label/not found Mountingrootfilesystem Mount:error2 mounting ext3 mount:error 2mountin                      Gnone Switch root mount failed:22 umount/initrd/dev failed:2 Kernel panic-not synicncing:attempted to kill Init. (the error is not a bit long, seemingly wrong many oh, in fact, may be caused by a cause) error analysis: 1, the root file system can not find the mount point, modify the grub.conf file for root=/dev/* 2, hard drive can not be found, please see your machine's hard disk is the SATA disk, If so, congratulations on your help in this article. Error Resolution: 1., modify the grub.conf file to try, the specific modification point root=/dev/* * refers to the original system/partition of the mount point. After the modification, reboot into the new kernel system, it is estimated that nine to Ten will encounter the following error prompt: Mounting root filesystem mount:error6 mounting ext3 mount:error 2 Mountingnone Switchro OT Mount failed:22 umount/initrd/dev failed:2 kernel panic-not synicncing:attempted tokil linit. If I say it's unfortunate, please look down. 2, hard drive failed to find, SCSI driver has a problem. I encountered this problem in the kernel compilation upgrade, the kernel option is selected and selected, the method tried many kinds, the error is still. Finally let meAccidentally select the correct option to successfully upgrade the kernel. The specific options are: Device Drivers--------SCSI Device support------SCSI low-level Drivers----Serial ATA (SATA) Then select the appropriate sub-options, I selected the Intel Piix/ich SATA Support (new) after the machine started successfully. Error FOUR: Error hint: enforcing mode requested but no policy loaded. Halting now. Kernel panic-not syncing:attenpted to kill init! Error Analysis: The original kernel has selinux enabled, the new kernel does not select the SELinux option and does not start successfully.   Workaround: Modify the grub.conf file, after root=label=/add enforcing=0 error Five: After the restart: Switchroot:mount failed:22 Umount/initrd/dev Failed:2 kernel panic-not symcing:attempted to kill init! Error, Workaround: Re-make menuconfig so that config_sysfs_deprecated_v2=y can also open the file. config to modify and verify; re-execute: # make Bzimage # makes modules # made M Odules_install # make install # shutdown-r ' Now ' four, Linux kernel boot process the computer starts with power, then hardware detects and boots the operating system initialization program, Then the operating system's initialization program is responsible for reading into the system kernel and building the operating environment of the system. This process is relatively complex and relevant to the CPU architecture, where we explain this process in more detail through Linux and with the i386 architecture. 1, hardware detection. When the machine is power-up, it first executes the code in the BIOS (basic input and output system), the BIOS first performs the power-on self-test (post), and when the self-test passes, it completes the hardware boot. The post program determines the presence of the hardware and can operate correctly by diagnosing the memory and other hardware's devices. The BIOS is cured in the chipprogram, it usually takes only a few seconds to perform this process. When the self-test is complete, the BIOS searches for a valid boot drive in the boot order set in the system COMs (here we take the hard drive as an example) and reads into the system boot sector and gives the system control to the boot program. 2. Loading and executing the bootloader system boot program is mainly to load the system kernel into memory, the boot disk must contain the boot record on the first logical track. This 512-byte sector is also referred to as the boot sector, and the BIOS reads the boot sector into memory from the boot disk after the system completes the power-on self-test. The boot record contains parameters for some of the physical properties of the disk. After the boot sector is read into memory, the BIOS can read the physical parameters of the boot disk from here. Once the boot record has been loaded, the BIOS will hand over the execution control of the system and jump to the boot program's head execution. The boot record begins with an unconditional transfer instruction, which immediately jumps to the address 0x03e execution bootstrapper, which in the boot sector reads out several more complex programs from disk and loads the system kernel. The boot program for Linux is arch/i386/boot/bootsect by the assembly code file. s generates, it takes advantage of a call to the BIOS function to be arch/i386/boot/under Setup. s file and kernel image loaded into memory. I386 the architecture of the CPU sub-protection mode and real mode two, in real mode can only use low-end 640K memory. The CPU is in real mode when the bootloader is loaded, and now the kernel image file is generally more than the limit of 640K, even after the compressed kernel image, this kernel image file is usually bzimage, we usually use this file when compiling the kernel. Since bzimage exceeds the 640K limit, Linux has designed a Bootsect_helper subroutine (defined in Arch/i386/boot/setup. s), the boot program loops through the bootsect_helper to load the kernel image into memory, and when the kernel is loaded, the system jumps to setup. Start position of S starts, Setup. S is still running in real mode, the main function is to set the system parameters (such as: memory, disk, etc.), and to enter the protection mode to prepare, and finally into the protection mode and jump to the kernel image file Head start to execute the kernel. Here's a guide to Linux. Lilo and Grub,lilo and grub can boot multiple systems, which are typically used if the machine is to be loaded with multiple systems, which are also stored in the boot sector or stored in the Master Boot Record (MBR), Both Lilo and Grub are Xu Yun to the user's own configuration, which establishes a system kernel footprint during system installationThe location table of the disk data block. When the user chooses to start the Linux system, it also jumps to setup. running on S. 3, kernel initialization when Setup. After s execution, the CPU performs the protected mode and starts executing the kernel. If the kernel is compressed, first execute the head in the arch/i386/boot/compressed directory. s build the stack and unzip the kernel image file, then go to head under Arch/i386/kernel. S.. If there is no compression, go directly to head under Arch/i386/kernel. s begins execution. Arch/i386/kernel/head. The S program is responsible for initializing the data area (BBS), Interrupt description Table (IDT), Segment Description table (GDT), page table, and register. Finally, enter the Start_kernel () module. At this point the system runs under kernel mode (level 0) and is transferred to Start_kernel () in INIT/MAIN.C.    Start_kernel () continues with other aspects of initialization, primarily initializing the system's core data structures, mainly including: Setup_arch (): Performing architecture-related settings.    Trap_init (): Sets various entry addresses.    INIT_IRQ (): Initializes the IRQ interrupt handling mechanism.    Sched_init (): Sets and starts the first process, Init_task ().    Softirq_init (): Initializes the soft interrupt subsystem.    Console_init (): Initializes the console, monitor.    Init_modules (): initializes the kernel_module.    Fork_init (): Defines the maximum number of processes for the system. Finally enter the Rest_init () function and call Kernel_thread () to create the Init kernel thread for system configuration. The init kernel thread occupies the first item of the Process description table, which is used by it to create other complete systems to initiate his process. The init kernel thread first pins the kernel and then calls Do_basic_setup () to initialize the external device and load the driver.    The main initialization work includes: PCI bus initialization.    Network initialization.    File system initialization. Load the file system. After the Do_basic_setup () call is complete, init () releases the memory occupied by the initialization function and opens the/dev/console device redirection console, using the system invoke EXECVE to perform the user-state program/sbin/init. At this point, the kernel initialization of Linux is done. 4. BelowWork is done by the user-/sbin/init program. The Init routine reads the/etc/inittab file to determine its specific work. One of the more important in Inittab is that id:5:initdefault determines the default execution level when the operating system starts (this is about the operating level of the system, which is different from the CPU level) Si:sysinit:/etc/rc.d/rc.sysinit Execute/ The Etc/rc.d/rc.sysinit script. The main task of Rc.sysinit is to activate the swap partition, check the disk, and load the hardware module. 1:2345:respawn:/sbin/mingetty tty1 Display Login interface At this point, the entire system of the boot process is complete.

Linux kernel upgrade 2 rpm

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.