Compiling 2.6.15.5 kernel in VMware Linux 2.4.20-8

Source: Internet
Author: User

Software preparation:

Gcc-3.2.2-5.i386.rpm: for compilation

Ncurses-5.6.tar.gz: used with make menuconfig command to configure the kernel

Bison-2.4.tar.gz: syntax parser

Flex-2.5.35.tar.bz2: lexical parser

M4-1.4.9.tar.gz:

 

Modutils-2.4.26.tar.bz2:

Module-init-tools-3.2.2.tar.bz2: 2.6 Kit

 

Linux-2.6.15.5.tar.bz2: kernel source package

 

Step 1:

Copy all the above software to the Virtual Machine (not/mnt)

Step 2:

Put the internal source code package linux-2.6.15.5.tar.bz2 into the/usr/src directory and decompress it with tar-jxvf linux-2.6.15.5.tar.bz2

And then map the linxu symbolic connection to the linux-2.6.15.5: ln-s linux-2.6.15.5 Linux

Step 3: rpm-IVH gcc-3.2.2-5.i386.rpm install gcc

Step 3: Install ncurses-5.6.tar.gz

Tar zxvf ncurses-5.6.tar.gz

Enter the decompressed directory./configure

Make

Make install Installation

Step 4: Install bison-2.4.tar.gz

./Configure -- prefix =/usr
Make

Make check: this software package comes with a test suite that can perform some tests to determine whether the compilation is correct.

Make install

Step 5: Install flex-2.5.35.tar.bz2

./Configure -- prefix =/usr &&
Make &&
Make install

Some programs do not know flex but try to find Lex programs (in fact, Flex is another and better way to implement Lex functions ). To meet the needs of a few programs, we will create a lex script that calls flex and uses it to mimic Lex's output file naming conventions.

Run the following command to create a new file/usr/bin/LEX:

Cat>/usr/bin/lex <"EOF"
#! /Bin/sh
# Begin/usr/bin/Lex

Exec/usr/bin/flex-L "$ @"

# End/usr/bin/Lex
EOF
Chmod 755/usr/bin/Lex

 

Step 6: Upgrade M4

First, uninstall the original M4 and then install the new M4

./Configure -- prefix =/usr

Make

Make check: this software package comes with a test suite that can perform some tests to determine whether the compilation is correct.

Make install

 

Step 7: Install modutils-2.4.26.tar.bz2 (if you have installed modutils, uninstall it: rpm-e -- nodeps modutils)

./Configure &&
Make &&
Make install

(Reference: http://docs.huihoo.com/lfs/lfs-4.0/chapter06/modutils.html)

Step 8: Install module-init-tools-3.2.2.tar.bz2

Tar-jxvf module-init-tools-3.2.2.tar.bz2

./Configure -- prefix =/sbin

Make

Make install

/Generate-modprobe.conf/etc/modprobe. conf

 

Step 9: configure the kernel

Make menuconfig

 

Step 10: Compile the kernel

Make bzimage (generate the gzip-compressed kernel. The generated file is located in the/usr/src/Linux/ARCH/i386/boot directory)

Make modules modules_install (compile the kernel module and install it in the/lib/modules/2.6.15.5 directory)

 

 

 

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.