Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build kernel source tree in Linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

It is believed that many inexperienced people don't know what to do about how to build kernel source tree in Linux. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

To write a driver for Linux, you must build a kernel source tree.

The purpose of the kernel source tree is to construct modules that can be loaded and unloaded in the Linux kernel, so if you want to build modules for the target board, you must ensure that the kernel version used to build the kernel source tree is the same as the kernel version in your target board. The target board used by the author is i.MX6Q E9, the official source code package linux_E9_3.0.35_for_Linux_v3.0.tar.bz2.

01. Decompress the source package

Tar jxvf linux_E9_3.0.35_for_Linux_v3.0.tar.bz2

02. Enter the kernel source directory

Cd ~ / linux_E9_3.0.35_for_Linux

03. Modify Makefile, specify architecture, and cross-compiler under kernel source root directory

ARCH = armCROSS_COMPILE = / opt/arm-linux-gcc/bin/arm-none-linux-gnueabi-

04. Configure the kernel

Make menuconfig

Just load the official configuration directly into the source code.

05. Compile

Make

06. Compiler module

Make modules

07. Installation module

Make modules_install

After you finish, you can see the folder named by the version number in the / lib/modules directory.

[xxx@XXX ~] $cd / lib/modules [xxx@XXX modules] $ls3.0.35 3.16.2-1-ARCH 3.16.3-1-ARCH extramodules-3.16-ARCH [xxx@XXX modules] $

At this point, the construction of kernel source tree is completed.

After reading the above, have you mastered how to build the kernel source tree in Linux? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report