Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Linux Custom Kernel How to build

Status
Not open for further replies.

jjohn

Banned
Full Member level 3
Joined
Jun 17, 2006
Messages
156
Helped
17
Reputation
34
Reaction score
8
Trophy points
1,298
Activity points
0
customize linux version

https://www.redhat.com/docs/manuals/...tom-kernel.html

1.uname -r 查看你的linux核心版本号

2.mkbootdisk --device /dev/fd0 2.4.x
(where 2.4.x is the full version of your kernel such as 2.4.18-7.95).
创建一张紧急回复磁盘

3.rpm -q kernel-source
确认linux核心源码是否已经安装.

4.cd /usr/src/linux-2.4
改变目录到/usr/src/linux-2.4 从现在开始所有的命令都是在这个目录中执行.

5.make mrproper

This will remove any configuration files along with the remains of
any previous builds that may be scattered around the source tree
清除上次编译的余迹.
If you already have an existing configuration file that works
(/usr/src/linux-2.4/.config) and you want to use, back it up to
a different directory before running this command and copy it
back afterward.
如果有存在的配置文件/usr/src/linux-2.4/.config你想保存.那么请先备份到其他
目录.待运行完这个命令以后再copy回来.

6.make menuconfig

建立.config文件


(built-in), [ ] (exclude), <M> (module), or < > (module capable).

Note
To use kmod (see Chapter 30 for details) and kernel modules you must
answer Yes to kmod support and module version (CONFIG_MODVERSIONS)
support during the configuration

7.make dep
建立各种依存关系

8.make clean
to prepare the source tree for the build.
准备源码编译.

9.编辑/usr/src/linux-2.4/Makefile

By default, /usr/src/linux-2.4/Makefile includes the word custom at the
end of the line beginning with EXTRAVERSION. Appending the string will
allow you to have the old working kernel and the new kernel, version 2.4.18-7.95custom,
on your system at the same time.

To give the kernel an "unique" name, you can also append the date to the end of the string
在EXTRAVERSION开头的行的最后有custom的字样..你可以在后面添加你自定义的字样.和原来的核心做区分

10.make bzImage
编译核心

11.make modules
编译模块

12.make modules_install
安装编译的模块
install the kernel modules (even if you did not build any). Make sure that you type the underscore (_).
This will install the kernel modules into the directory path /lib/modules/KERNELVERSION/kernel/drivers
(where KERNELVERSION is the version specified in the Makefile). In the example it would
be /lib/modules/2.4.18-7.95custom/kernel/drivers/.

13.make install
copy核心到它的正确目录中

copy your new kernel and its associated files to the proper directories.
In addition to installing the kernel files in the /boot directory, this
command also executes the /sbin/new-kernel-pkg script that builds a new
initrd image and adds new entries to the boot loader configuration file.

If you have a SCSI adapter and you compiled the SCSI driver as a module or
if you built your kernel with ext3 support as a module (the default in Red Hat Linux),
the initrd image is required
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top