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

Detailed explanation of common operations of Docker images and containers

Image Accelerator Sometimes it is difficult to pu...

Solve the mobile terminal jump problem (CSS transition, target pseudo-class)

Preface Many friends who have just come into cont...

Detailed explanation of Docker compose orchestration tool

Docker Compose Docker Compose is a tool for defin...

Nginx domain forwarding usage scenario code example

Scenario 1: Due to server restrictions, only one ...

Detailed explanation of MYSQL log and backup and restore issues

This article shares MYSQL logs and backup and res...

Detailed tutorial on downloading mysql on Windows 10

MySQL versions are divided into Enterprise Editio...

Various front-end printing methods of web: CSS controls web page printing style

CSS controls the printing style of web pages : Use...

Why can't the MP4 format video embedded in HTML be played?

The following code is in my test.html. The video c...

Vue implements the product tab of the product details page function

This article example shares the specific code of ...

Case study of dynamic data binding of this.$set in Vue

I feel that the explanation of this.$set on the I...

Comprehensive understanding of html.css overflow

Comprehensive understanding of html.css overflow ...

mysql workbench installation and configuration tutorial under centOS

This article shares the MySQL Workbench installat...

Detailed installation process of Jenkins on Linux

Table of contents 1. Install JDK 2. Install Jenki...

This article helps you understand PReact10.5.13 source code

Table of contents render.js part create-context.j...

XHTML no longer uses some obsolete elements in HTML

When we do CSS web page layout, we all know that i...