Easily compile the kernel easily

xiaoxiao2021-03-06  15

Easily compile the kernel easily

by

Xu Yongjun

Published on September 10, 2002 22:31.

Once I have a complex thing to recompile the kernel, many people will have such fear. However, after reading this article, I hope you will feel relaxed, the original kernel is so simple.

First, the reason for upgrading the kernel

There are many reasons for the upgrade, such as new hardware drivers, remove kernel BUG, ​​usually the new core will be faster, more stable and reliable than older versions.

Second, download the source code and extract

Freeelamp.com Home The latest download connection of LAMP versions of Lamp.com is available. You can directly click to download.

After download, we compressed files to / usr / src:

Gzip -dc Linux-2.4.19.tar.gz | TAR XVVF -

MV Linux-2.4.19 / usr / src

CD / USR / SRC

If there is a Linux directory exist, remove it first, then create a Linux soft connection:

RM-RF Linux

ln -s Linux-2.4.19 Linux

What is the matter of downloading a patch:

Gzip -d path-2.4.19.gz

MV PATCH-2.4.19 / USR / SRC

Determine hardware:

Before upgrading the kernel, you need to know the hardware on your machine to install the appropriate module. To view the hardware commands:

LSPCI lists all PCI devices.

Dmesg can also give a lot of useful information.

Third, compile the source code

CD / USR / SRC / Linux

Make Mrproper

Next, you can choose one of the following commands to configure the kernel:

'make config' - Suitable for slow remote terminal connectivity

'make menuconfig' - a remote terminal or this machine suitable for high speed

'make Xconfig' - on the X11 window

'make oldconfig' - use the previous .config file (useful when upgrading)

Then, according to the menu, select the appropriate configuration, delete the configuration that you don't need, the kernel, the faster the system is running. After the configuration is complete, the deployment exits. enter:

Make Dep; Make Bzimage; Make Modules

Make modules_install

Copy the boot file,

CP / USR / SRC / Linux / Arch / I386 / Boot / Bzimage /Boot/kernel-2.4.19

/ boot The following file name can be taken at will, but kernel-2.4.19 is relatively simple, easy to memorize.

Fourth, configure LILO

CD / ETC

Modify lilo.conf, add:

Image = / boot / kernel-2.4.19

Label = linux-2.4.19

Read-only

Root = / dev / hda1

Running LILO

Restart the machine, if you can run it properly, congratulations, success.

If there is a problem, modify the default to the old kernel version, and re-run the LILO.

Then, recompile the kernel:

CD / USR / SRC

Make clean

Reconfigure, check the possible problems.

Install patch

Simply installing patch is very simple, just step:

CD / USR / SRC

PATCH -P0

转载请注明原文地址:https://www.9cbs.com/read-48671.html

New Post(0)