Notes on Ubuntu 12.04 kernel upgrade

Source: Internet
Author: User

I need to study the lguest virtual machine recently, but the ubuntu12.04 kernel does not seem to be integrated, so I need to re-upgrade the kernel.

Step 1: download the latest stable kernel source code on the http://www.kernel.org/, I downloaded the latest stable version for 3.7.10


Step 2: Decompress the source code package and place the decompressed kernel code in the/user/src directory.

Step 3: Open the terminal to enter/usr/src/linux-3.7.10

ZNN @ Ubuntu :~ $CD/usr/src/linux-3.7.10

The above preparations

Step 4: Run Subsequent commands as an administrator, or add sudo to the command.

ZNN @ Ubuntu:/usr/src/linux-3.7.10 $ sudo Su
[Sudo] password for ZNN:

Enter the command make mrproper,

Root @ Ubuntu:/usr/src/linux-3.7.10 # Make mrproper

The function of this command is to clear the residual. config and. O files in the current directory. These files are usually left after compilation.

Step 5:Configuration

Configure the compilation options because the features and structure of the operating system kernel are very complex, and there are many configuration options and complicated configurations. For simplicity, use make menuconfig or make xconfig. My system has installed ncurses, therefore, make
Menuconfig. If you have not installed menuconfig, you can download it at http://invisible-island.net/ncurses/

 

Or download to the http://ftp.gnu.org/pub/gnu/ncurses/, or in the Software Center to find the software installation is also good, the following input keywords out a lot, you look at the need to install it:

I downloaded 5.8, decompress it, and install it.

Then focus on:Make menuconfig

 Root @ Ubuntu:/usr/src/linux-3.7.10 # Make menuconfig

The configuration interface is as follows. There are too many options and it is troublesome to find them.

The specific configuration depends on your needs. I need to configure the installation of the lguest virtual machine, and then save and exit. My configuration options are as follows:

"General setup ":

"Prompt for development and/or incomplete code/drivers" = y

(Config_experimental = y)


"Processor type and features ":

"Paravirtualized guest support" = y

"Lguest guest support" = y

"High memory support" = off/4 GB

"Alignment value to which kernel shoshould be aligned" = 0x100000

(Config_paravirt = Y, config_lguest_guest = Y, config_highmem64g = N and

Config_physical_align = 0x100000)


"Device drivers ":

"Staging drivers" = N

"Block devices"

"Virtio block Driver (experimental)" = m/y

"Network device support"

"Universal tun/TAP Device Driver Support" = m/y

"Virtio Network Driver (experimental)" = m/y

(Config_virtio_blk = m, config_virtio_net = m and config_tun = m)


"Virtualization"

"Linux hypervisor example code" = m/y

(Config_lguest = m)

Step 5:Determine dependency: Create dependency information between modules

Make Dep

Step 6:Clear intermediate compilation files: Delete unnecessary files left when the configuration is deleted.
Make clean

Step 7:Generate new kernelMake zimage can be used for an hour in the kernel. It takes a long time. Please wait patiently,

Make bzimage

Step 8:Compile the kernel module
Make modules

Step 9:Install the kernel module


Make modules_install

Step 10:Create a ramdisk Image

mkinitramfs -o /boot/initrd-linux3.7.10.img

Step 11: install the new kernel

Make install

Have you done it? O (∩ _ ∩) O ~, Last step

Step 12: restart the VM

Reboot

The preceding commands are run as administrators. log on to the restarted system and view the kernel version:

Root @ Ubuntu :~ # Uname-R
3.7.10

 

 

You need to modify the grub configuration file for dual or multi-system systems.

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.