Introduction to Linux kernel Virtual Machine Installation

Source: Internet
Author: User

The official version of the Linux kernel has been released, and the Linux kernel version can improve the ease of use performance. Next we will talk about the Linux kernel version. Because of work needs, you need to upgrade the Linux kernel version, the system is Fedora5, the kernel version is 2.6.15, And the upgrade needs to be 2.6.20. This process takes about a week to learn about the Linux kernel version, it has also experienced many difficulties since the upgrade was successful, all of which were obtained from google. The entire process is as follows.

I. Install the Linux kernel Virtual Machine

The Linux virtual machine version is Fedora5, and the kernel version is 2.6.15. It is downloaded from the network and the size is 3.02 GB. It seems that you cannot find it. You can search for it by google. It takes some time to download the installation process. There is nothing to pay attention to. You can complete the installation according to the normal installation process, which is the interface during the installation process:

[ATTACH] 29538 [/ATTACH]
Installing ing
[ATTACH] 29549 [/ATTACH]

II. Download the Linux kernel source code

For: http://archives.fedoraproject.org/pub/archive/fedora/linux/core/updates/5/SRPMS/
There are a lot of options to find 2.6.20, kernel-2.6.20-1.2320.fc5.src.rpm 21-Jun-2007 45 m rpm Package
The size is 45 MB, which seems to be a little big.

3. Important Installation

[CODE] [shabi004 @ localhost ~] $ Su root
Password:
[Root @ localhost shabi004] # cd Desktop/
[Root @ localhost Desktop] # ls
Kernel-2.6.20-1.2320.fc5.src.rpm
[Root @ localhost Desktop] # rpm-ivh kernel-2.6.20-1.2320.fc5.src.rpm [/CODE]

Prompt: [CODE] warning: group brewbuilder does not exist-using root [/CODE]
Ignore this and continue.
[CODE] [root @ localhost Desktop] # cd ..
[Root @ localhost shabi004] # cd ..
[Root @ localhost home] # cd ..
[Root @ localhost/] # cd usr/src/redhat/
[Root @ localhost redhat] # ls
BUILD RPMS SOURCES SPECS SRPMS
[Root @ localhost redhat] # cd SPECS
[Root @ localhost SPECS] # ls
Kernel-2.6.spec
[Root @ localhost SPECS] # rpmbuild-bp -- target i686 kernel-2.6.spec
[/CODE]
This process will last for about 10 minutes. Depending on the computer configuration, you will find some warnings. Ignore them and continue.

[CODE] [root @ localhost SPECS] # cd ..
[Root @ localhost redhat] # cd BUILD/
[Root @ localhost BUILD] # ls
Kernel-2.6.20
[Root @ localhost BUILD] # cd kernel-2.6.20/
[Root @ localhost kernel-2.6.20] # ls
Config. mk linux-2.6.20.i686 vanilla xen
[Root @ localhost kernel-2.6.20] # cd linux-2.6.20.i686/
[Root @ localhost: linux-2.6.20.i686] # ls
Arch CREDITS fs Kbuild Makefile REPORTING-BUGS usr
Block crypto include kernel mm scripts
Configs Documentation init lib net security
COPYING drivers ipc maintainers readme sound
[Root @ localhost linux-2.6.20.i686] # [/CODE]

Next, the most important thing is to configure the Linux kernel version. The command is
[CODE] make menuconfig [/CODE]
A gui selection box will pop up. You can select the Linux kernel version support module, such as CPU, Nic, file system type, driver, and so on. The specific settings are set according to the hardware environment, I will post some useful information in the form of attachments.
:
[ATTACH] 29552 [/ATTACH]
Appears:
[CODE] Load an Alternate Configuration File
Save an Alternate Configuration File [/CODE]

Save in this place, save the configured Linux kernel version module, and so on. The. config page will appear. Press ENTER and press OK.
Exit to exit the Linux kernel version configuration page

[CODE] [root @ localhost linux-2.6.20.i686] # make menuconfig
HOSTCC scripts/kconfig/lxdialog/checklist. o
HOSTCC scripts/kconfig/lxdialog/inputbox. o
HOSTCC scripts/kconfig/lxdialog/menubox. o
HOSTCC scripts/kconfig/lxdialog/textbox. o
HOSTCC scripts/kconfig/lxdialog/util. o
HOSTCC scripts/kconfig/lxdialog/yesno. o
HOSTCC scripts/kconfig/mconf. o
HOSTLD scripts/kconfig/mconf
Scripts/kconfig/mconf arch/i386/Kconfig
End of Linux kernel configuration.
Execute 'make' to build the kernel or try 'make help'. [/CODE]
To start the next step, run the following command:

[CODE]
Make dep
Make
Make bzImage
Make modules
Make modules_install
Make install [/CODE]
Where:
The first command, make dep, actually reads the configuration file generated during the configuration process to create the dependency tree corresponding to the configuration, so as to determine which need to be compiled and which do not need to be; make zImage and make bzImage fully compile the kernel. the Linux kernel versions generated by both are compressed using gzip, the difference is that make bzImage can generate a larger kernel. We recommend that you use the make bzImage command.

The following three commands are necessary only when you answer Enable loadable module support (CONFIG_MODULES) in the configuration process, make modules and make modules_install generate the corresponding modules and copy the modules to the required directories.

It takes a long time to use the make command, and you need to wait patiently. Some warning information is generated in the middle, so ignore it.
Run
[CODE] [root @ localhost linux-2.6.20.i686] # make install
Sh/usr/src/redhat/BUILD/kernel-2.6.20/linux-2.6.20.i686/arch/i386/boot/install. sh 2.6.20-prep arch/i386/boot/bzImage System. map "/boot" [/CODE]

It seems that the kernel has been upgraded. Since Fedora5 is guided by Grub, you need to confirm
Run the following command:
[CODE] [root @ localhost shabi004] # cd ..
[Root @ localhost home] # cd ..
[Root @ localhost/] # cd boot
[Root @ localhost boot] # ls
Config-2.6.15-1.2054_FC5 System. map-2.6.15-1.2054_FC5
Grub System. map-2.6.20-prep
Initrd-2.6.15-1.2054_FC5.img (vmlinuz)
Initrd-2.6.20-prep.img vmlinuz-2.6.15-1.2054_FC5
Lost + found vmlinuz-2.6.20-prep
System. map
[Root @ localhost boot] # cd grub
[Root @ localhost grub] # ls
Device. map grub. conf minix_stage1_5 stage2
E2fs_stage00005 iso9660_stage00005 reiserfs_stage00005 ufs2_stage00005
Fat_stage00005 jfs_stage00005 splash.xpm.gz vstafs_stage00005
Ffs_stage1_5 menu. lst stage1 xfs_stage1_5
[Root @ localhost grub] # vi grup. conf [/CODE]

Display:
[CODE] # grub. conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a/boot partition. This means that
# All kernel and initrd paths are relative to/boot/, eg.
# Root (hd0, 0)
# Kernel/vmlinuz-version ro root =/dev/VolGroup00/LogVol00
# Initrd-version.img/initrd
# Boot =/dev/sda
Default = 1
Timeout = 5
Splashimage = (hd0, 0)/grub/splash.xpm.gz
Hiddenmenu
Title Fedora Core (2.6.20-prep)
Root (hd0, 0)
Kernel/vmlinuz-2.6.20-prep ro root =/dev/VolGroup00/LogVol00 rhgb quiet
Initrd/initrd-2.6.20-prep.img
Title Fedora Core (2.6.15-1.2054_FC5)
Root (hd0, 0)
Kernel/vmlinuz-2.6.15-1.2054_FC5 ro root =/dev/VolGroup00/LogVol00 rhgb quiet
Initrd/initrd-2.6.15-1.2054_FC5.img
"Grub. conf" 21L, 770C [/CODE]

The explanation is not clear because of your limited level. Please go to google to get the complete answer. Here I only want to know:
Title Fedora Core (2.6.20-prep): Linux kernel version
Root (hd0, 0): hd * indicates the first hard disk. For example, this disk is the first hard disk, and * indicates the first partition, in this example, it is the first hard disk and the first partition.

Restart the system now. Press any key to enter the grub boot interface.
[ATTACH] 29575 [/ATTACH] select the corresponding 2.6.20 to enter the system
[CODE] [shabi004 @ localhost Desktop] $ uname-
Linux localhost 2.6.20-prep #1 Thu Aug 6 17:39:48 CST 2009 i686 i686 i386 GNU/Linux [/CODE]

By now, the Linux kernel version has been upgraded.

  1. Brief Introduction to Linux Kernel
  2. Linux Kernel unified device system operations
  3. Learn to delete old Linux Kernel
  4. Brief Introduction to Linux kernel system applications
  5. APIC programming in Linux Kernel

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.