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

Basic usage of UNION and UNION ALL in MySQL

In the database, both UNION and UNION ALL keyword...

TCP performance tuning implementation principle and process analysis

Three-way handshake phase Number of retries for c...

JavaScript implementation of drop-down list

This article example shares the specific code of ...

Vue.js handles Icon icons through components

Icon icon processing solution The goal of this re...

Analysis of Docker's method for creating local images

The so-called container actually creates a readab...

Example code for implementing a simple search engine with MySQL

Table of contents Preface Introduction ngram full...

Docker completely deletes private library images

First, let’s take a look at the general practices...

How to install mysql in docker

I recently deployed Django and didn't want to...

MySQL InnoDB transaction lock source code analysis

Table of contents 1. Lock and Latch 2. Repeatable...

Native js to achieve star twinkling effect

This article example shares the specific code of ...

Share 20 excellent web form design cases

Sophie Hardach Clyde Quay Wharf 37 East Soapbox Rx...