Detailed explanation of the implementation process of building a kernel tree in Ubuntu 12.04

Detailed explanation of the implementation process of building a kernel tree in Ubuntu 12.04

First check the kernel version you are using

lin@lin-virtual-machine:~$ uname -r
3.2.0-23-generic

If the source code is automatically installed when the system is installed. There is a corresponding version directory in the /usr/src directory.

lin@lin-virtual-machine:~$ cd /usr/src
lin@lin-virtual-machine:/usr/src$ ls
linux-headers-3.2.0-23 linux-headers-3.2.0-23-generic

Check out the downloadable source packages

lin@lin-virtual-machine:/usr/src$ apt-cache search linux-source
linux-source - Linux kernel source with Ubuntu patches
linux-source-3.2.0 - Linux kernel source for version 3.2.0 with Ubuntu patches

I choose "linux-source-3.2.0 - Linux kernel source for version 3.2.0 with Ubuntu patches" to install directly

lin@lin-virtual-machine:/usr/src$ sudo apt-get install linux-source-3.2.0

After the download is complete, the file name is: linux-source-3.2.0.tar.bz2 in /usr/src. It is a compressed package. You can get the source code of the entire kernel by decompressing it.

Use pwd to view the current path

ls to see what files are in the folder

lin@lin-virtual-machine:/usr/src$ pwd
/usr/src
lin@lin-virtual-machine:/usr/src$ ls
linux-headers-3.2.0-23 linux-source-3.2.0
linux-headers-3.2.0-23-generic linux-source-3.2.0.tar.bz2

Unzip

lin@lin-virtual-machine:/usr/src#sudo tar jxvf linux-source-3.2.0.tar.bz2

Enter the directory (cd linux-source-3.2.0)

lin@lin-virtual-machine:/usr/src$ cd linux-source-3.2.0/
lin@lin-virtual-machine:/usr/src/linux-source-3.2.0$ pwd
/usr/src/linux-source-3.2.0

Start configuring the kernel and choose the fastest original configuration (default) method

lin@lin-virtual-machine:/usr/src/linux-source-3.2.0$ sudo make oldconfig

Make needs to wait for more than an hour. . .

lin@lin-virtual-machine:/usr/src/linux-source-3.2.0$ sudo make

A few hours later

...System is 4826 kB
CRC d5a51584
Kernel: arch/x86/boot/bzImage is ready (#1)
 Building modules, stage 2.
 MODPOST 3304 modules
ERROR: "__modver_version_show" [drivers/staging/rts5139/rts5139.ko] undefined!
WARNING: modpost: Found 4 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

Solution: From http://ubuntuforums.org/showthread.php?t=1931029

lin@lin-virtual-machine:/usr/src/linux-source-3.2.0$ sudo gedit .config

It is probably a problem with the RTS5139 driver. Anyway, this driver is not used, so do not add it to the compilation. Edit .config and change

CONFIG_RTS5139=m

Modify it into the following form:

CONFIG_RTS5139=n

Continue to make

Compile the kernel in compressed form

make bzImage

Compile the module:

make modules

Install the module:

make modules_install

After the execution is completed, a new directory will be generated under /lib/modules

lin@lin-virtual-machine:/lib/modules$ ls
3.2.0-23-generic 3.2.79

Reboot after success.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Ubuntu 16.04 kernel upgrade steps
  • How to delete extra kernels in Ubuntu
  • Ubuntu Android source code and kernel download and compilation
  • Adding Hardware Abstraction Layer (HAL) module to access Linux kernel driver for Android in Ubuntu
  • Implementing a built-in C executable program in Ubuntu to test the Linux kernel driver for Android
  • How to write Linux kernel driver for Android system in Ubuntu
  • Download, compile and install Android kernel source code on Ubuntu

<<:  VUE realizes registration and login effects

>>:  Detailed explanation of the usage of sync modifier in Vue3 parent-child component parameter transfer

Recommend

Vue axios interceptor commonly used repeated request cancellation

introduction The previous article introduced the ...

Use of JavaScript sleep function

Table of contents 1.sleep function 2. setTimeout ...

Some points on using standard HTML codes in web page creation

The most common mistake made by many website desi...

How to build Apr module for tomcat performance optimization

Preface Tomcat is a widely used Java web containe...

Detailed explanation of the pitfalls of Apache domain name configuration

I have never used apache. After I started working...

Detailed explanation of MYSQL large-scale write problem optimization

Abstract: When people talk about MySQL performanc...

Vue practice of preventing multiple clicks

Generally, click events will be divided into diff...

A simple way to implement all functions of shopping cart in Vue

The main functions are as follows: Add product in...

mysql command line script execution example

This article uses an example to illustrate the ex...

MySQL example of getting today and yesterday's 0:00 timestamp

As shown below: Yesterday: UNIX_TIMESTAMP(CAST(SY...

How to create WeChat games with CocosCreator

Table of contents 1. Download WeChat developer to...

Analysis of several reasons why Iframe should be used less

The following graph shows how time-consuming it is...

Detailed explanation of Zabbix installation and deployment practices

Preface Zabbix is ​​one of the most mainstream op...

MySQL users and permissions and examples of how to crack the root password

MySQL Users and Privileges In MySQL, there is a d...