编译Linux 2.6.30内核
时间:2010-05-14 来源:yeahilly
编译Linux 2.6.30内核
1)在http://www.at91.com/linux4sam/bin/view/Linux4SAM/LinuxKernel
或者http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.tar.bz2下载linux内核linux-2.6.30.tar.bz2
2)解压内核,并进入目录
tar xvjf linux-2.6.30.tar.bz2
cd linux-2.6.30
3)在http://maxim.org.za/AT91RM9200/2.6/2.6.30-at91.patch.gz下载AT91维护补丁2.6.30-at91.patch.gz到linux-2.6.30路径下
4)应用补丁
zcat 2.6.30-at91.patch.gz | patch -p1 (在linux-2.6.30路径下执行)
5)在ftp://www.linux4sam.org/pub/linux/2.6.30.at91/2.6.30-at91-exp.3.tar.gz下载应用补丁包2.6.30-at91-exp.3.tar.gz到linux-2.6.30路径下
6)解压应用补丁包
tar xvzf 2.6.30-at91-exp.3.tar.gz (在linux-2.6.30路径下执行)
7)应用补丁
for p in 2.6.30-at91-exp.3/*;do patch -p1<$p;done (在终端命令窗口下执行上述命令,批量应用补丁)
8)在http://www.at91.com/linux4sam/pub/Linux4SAM/LinuxKernel/at91sam9261ek_defconfig下载Linux 2.6.30的关于AT91SAM9261EK的配置文件at91sam926yek_defconfig
9)拷贝at91sam926yek_defconfig至linux-2.6.30路径下,执行:
cd linux-2.6.xx
cp at91sam926yek_defconfig .config
10)更改linux-2.6.30路径下的/arch/arm/mach_at91/Makefile.boot文件如下:
把else后的语句另起一行,在最后补全与ifeq相等数量的endif
11)linux-2.6.30路径下的Makefile文件中的第194~195行更改为:
ARCH=arm
CROSS_COMPILE=/usr/local/arm/4.3.2/bin/arm-linux-
注:CROSS_COMPILE为编译工具,也可以用ELDK,即CROSS_COMPILE=/usr/local/arm/eldk/usr/bin /arm-linux-,但是内核配置时,需要把kernal feature中的ABI相关选项去掉
12)执行make oldconfig
10)配置linux内核
make menuconfig
或者make xconfig
3. 下载buildroot
This version is based on buildroot's trunk version 23434 with some modifications.
- You can check out from the standard buildroot svn repository:
svn co -r 23434 svn://uclibc.org/trunk/buildroot
Then apply the buildroot-v23434.patch. Find it in this page: BuildRootGet.
$ cd buildroot
$ patch -p1 < ../buildroot-v23434.patch
$ chmod u+x scripts/wget.sh
- The already patched source can also be downloaded from linux4sam ftp server:
buildroot-v23434.tar.bz2.
4.Build buildroot
$ make menuconfig //创建初始化 ".config" 文件
$ make at91sam9260pf_defconfig //建立nand flash引导的开发环境
$ make 2>&1 | tee at91sam9.log
The first command will create the initial ".config" file.
The third command will build everything, and log the error messages if there are.
Finally, the root file system image files can be found in buildroot/binaries/AT91/:
本文参考以下文章: http://www.at91.com/linux4sam/bin/view/Linux4SAM/BuildRootBuild