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)