How to upgrade and compile the kernel

Source: Internet
Author: User
If you do not want to change the kernel version, go to step 4 below.
1) untar in any sub-directory (but usually under/usr/src/) to unlock the new kernel source program:
Tar xvfz linux-x.x.xx.tar.gz (e.g. linux-2.0.35.tar.gz)
Or patch: gzip-cd patch-2.0.35.gz | patch-p0
After completing the patch, go directly to step 4.
2) rm/usr/src/linux is usually a symbolic connection.
3) create a symbol under/usr/src/to connect to your new kernel directory.
Ln-s/usr/src/linux.2.x. xx/usr/src/linux
The kernel of the old version may have to do the following:
Cd/usr/include
Rm-rf asm linux scsi
Ln-s/usr/src/linux/including/asm-i386 asm
Ln-s/usr/src/linux/include/linux
Ln-s/usr/src/linux/include/scsi
4) change the current directory to/usr/src/linux
Cd/usr/src/linux
5) become a Super User su
6) configure the kernel
If you want to have a graphical interface under X window, use: make xconfig.
(Note: Install the Tk/Tcl package and the resolution of X Server is above)
If you are not in X Window or do not want to use the graphic interface, use:
Make config or make menuconfig (recommended). Wait a moment after answering the questions one by one. When the prompt or GUI disappears, the system is configured.
7) generate a new kernel. Use:
Make Dep; make clean
Make zimage (or use make bzimage to further compress the kernel)
(Case Sensitive)
You can also choose make zlilo/make install.
8) if you use a module, you also need to generate and install the module.
Make modules
Make modules-install
Depmod-
9) Check/etc/Lilo. conf and use the directory and file as the image. For example: Image =/boot/vmlinuz (slackware is/vmlinuz)
Copy/usr/src/Linux/system. map to the/boot directory,
Copy/usr/src/Linux/ARCH/i386/boot/zimage to the/boot directory and change it to vmlinuz.
Use a new file name to copy the new kernel to the corresponding directory, as shown in figure
CP/usr/src/Linux/ARCH/i386/boot/zimage/boot/zimage2
Edit the/etc/Lilo. conf file and copy the section related to the original kernel, as shown in figure
Image =/boot/vmlinuz
Root =/dev/hda1
Label = linux
Copy the image to/boot/zImage2 and change the label to newlinux.
In this way, the new kernel and the old kernel can coexist. When the new kernel cannot be started, there will be backups there. Pay attention to the location after replication. If default is not set, the first item is the default startup Item.
10) install the new kernel and restart it.
Lilo
Shutdown-r now
(Tip: When you start LILO at startup and the "LILO:" prompt appears, press the TAB key to display all the items that can be started (defined by label)

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.