编译内核
2016-07-18 23:24
190 查看
内核下载地址
https://www.kernel.org/
删除源代码目录中残留的.o文件和其它从属文件
配置内核
也可以拷贝一个准备好的配置文件到.config,然后make menuconfig选择”Load an Alternate Configuration File”选项,选择.config文件,OK
编译内核
清除内核编译的目标文件
编译内核
区别:uIamge是由mkimage制作而来;uIamge是zIamge压缩而成,bootm需要先对uIamge解压,解压地址为内核入口地址;uboot目前只能支持uImage启动,不支持zImage启动
注:uImage要指定load地址,否则报错
可选编译参数
j代表同时编译的进程,可以加快编译速度。n由用户计算机的配置与性能决定,当前的典型值为10
编译可加载模块
生成目录在/lib/modules
如果出现以下错误:
原因:没有找到mkimage这个工具,而mkimage是在编译uboot后产生的
解决办法:
Ubuntu下可以使用命令安装
https://www.kernel.org/
删除源代码目录中残留的.o文件和其它从属文件
# make mrproper
配置内核
# make menuconfig
也可以拷贝一个准备好的配置文件到.config,然后make menuconfig选择”Load an Alternate Configuration File”选项,选择.config文件,OK
默认配置
# ls arch/arm/configs/ assabet_defconfig h7201_defconfig neponset_defconfig at91rm9200dk_defconfig h7202_defconfig netwinder_defconfig at91rm9200ek_defconfig hackkit_defconfig netx_defconfig at91sam9260ek_defconfig integrator_defconfig ns9xxx_defconfig at91sam9261ek_defconfig iop13xx_defconfig omap_h2_1610_defconfig at91sam9263ek_defconfig iop32x_defconfig onearm_defconfig at91sam9rlek_defconfig iop33x_defconfig picotux200_defconfig ateb9200_defconfig ixp2000_defconfig pleb_defconfig badge4_defconfig ixp23xx_defconfig pnx4008_defconfig carmeva_defconfig ixp4xx_defconfig pxa255-idp_defconfig cerfcube_defconfig jornada720_defconfig realview_defconfig clps7500_defconfig kafa_defconfig realview-smp_defconfig collie_defconfig kb9202_defconfig rpc_defconfig corgi_defconfig ks8695_defconfig s3c2410_defconfig csb337_defconfig lart_defconfig shannon_defconfig csb637_defconfig lpd270_defconfig shark_defconfig ebsa110_defconfig lpd7a400_defconfig simpad_defconfig edb7211_defconfig lpd7a404_defconfig spitz_defconfig ep93xx_defconfig lubbock_defconfig trizeps4_defconfig footbridge_defconfig lusl7200_defconfig versatile_defconfig fortunet_defconfig mainstone_defconfig h3600_defconfig mx1ads_defconfig # make xxx_defconfig
编译内核
# make dep
清除内核编译的目标文件
# make clean
编译内核
# make zImage # make uImage LOADADDR=xxx
区别:uIamge是由mkimage制作而来;uIamge是zIamge压缩而成,bootm需要先对uIamge解压,解压地址为内核入口地址;uboot目前只能支持uImage启动,不支持zImage启动
注:uImage要指定load地址,否则报错
Specify LOADADDR on the commandline to build an uImage
可选编译参数
# make -jn
j代表同时编译的进程,可以加快编译速度。n由用户计算机的配置与性能决定,当前的典型值为10
编译可加载模块
# make modules # make modelus_install
生成目录在/lib/modules
如果出现以下错误:
"mkimage" command not found
原因:没有找到mkimage这个工具,而mkimage是在编译uboot后产生的
解决办法:
export PATH:=$PATH:/u-boot/tools
Ubuntu下可以使用命令安装
# apt-get install uboot-mkimage
相关文章推荐
- Linux 自检和 SystemTap
- LKRG:用于运行时完整性检查的可加载内核模块
- 一张图看尽 Linux 内核运行原理
- Greg Kroah-Hartman 解释内核社区是如何使 Linux 安全的
- Linux内核链表实现过程
- PHP内核探索之解释器的执行过程
- 深入理解PHP内核(二)之SAPI探究
- C++中Semaphore内核对象用法实例
- 一张图看尽Linux内核运行原理
- 深入理解PHP内核(一)
- PHP内核探索之变量
- 深入php内核之php in array
- 浅谈Linux内核创建新进程的全过程
- 修改内核 内存分配 root、文件系统和内核镜像的位置
- 移植linux-2.6.30.4到S3C2440
- 看《Linux0.11内核完全注释2.01》的方法
- 升级LINUX内核(支持8G内存)的命令
- FreeBSD系统优化部分内核参数调整中文注释
- Linux2.6X内核中文件相关结构体总结
- 内核的主要配置文件的详细说明