Software Development under Linux

Source: Internet
Author: User

1, how to upgrade, compile the kernel?

If you don't want to change the kernel version, go directly to step fourth below.

1 in any subdirectory (but usually under/usr/src/) Untar unlock the new kernel source program:

Tar xvfz linux-x.x.xx.tar.gz (e.g. linux-2.0.35.tar.gz)

or a patch (patch): GZIP-CD patch-2.0.35.gz | Patch-p0

Skip the patch and jump straight to step fourth.

2) Rm/usr/src/linux This is usually a symbolic connection.

3 Create a symbol to connect to your new kernel directory under/usr/src/.

Ln-s/usr/src/linux.2.x.xx/usr/src/linux

The older version of the kernel may also have to do the work:

Cd/usr/include

RM-RF ASM Linux SCSI

Ln-s/usr/src/linux/include/asm-i386 ASM

Ln-s/usr/src/linux/include/linux Linux

Ln-s/USR/SRC/LINUX/INCLUDE/SCSI SCSI

4 The current directory into/usr/src/linux

Cd/usr/src/linux

5 becomes Superuser su

6) Configure the kernel

If you are under X window and want to have a graphical interface, use: Make Xconfig

(Note: The TK/TCL package needs to be installed and the resolution of X server is above 800x600)

If you are not under X window or do not want to use the graphical interface, use:

Make config or make menuconfig (recommended), after answering the question one by one, wait a moment, wait for a prompt to appear or the graphical interface disappears, configure the system.

7 to generate a new kernel, with:

Make DEP; Make clean

Make zimage (or further compress the kernel with make bzimage)

(Note that there are case sensitive)

There are also make Zlilo/make install and so on to choose from.

8 If you use a module, you also need to build and install the module

Make modules

Make Modules-install

Depmod-a

9 Check/etc/lilo.conf, the use of the directory, that file as image. Example: Image =/boot/vmlinuz (Slackware version is/vmlinuz)

Copy the/usr/src/linux/system.map to the/boot directory,

Copy the/usr/src/linux/arch/i386/boot/zimage to the/boot directory and rename it to Vmlinuz

Copy the new kernel to the appropriate directory with a new file name, such as

Cp/usr/src/linux/arch/i386/boot/zimage/boot/zimage2

Then edit the/etc/lilo.conf file and copy the section that is related to the original kernel, such as

Image =/boot/vmlinuz

root =/dev/hda1

label = Linux

After copying the image into/boot/zimage2 to change the label to Newlinux.

This allows the new kernel to coexist with the old kernel, and when the new kernel does not start, there are backups. Note Where to place the copy and, if default is not set, who is the first item and who is the default startup item.

Related Article

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.