Author:Jackwen
email: jackwen123@21cn.com
Target Board: GEC2410 ( 64M RAM 64M Nandflash)
编译环境: ubuntu 7.10
交叉编译工具:CROSS-3.3.2 (cross-3.3.2.tar.bz2)
内核包: linux-2.6.8.1 (gec2410-linux-2.6.8.1.tar.bz2)
1.交叉编译工具安装的路径: /usr/local/arm2410/
内核包放在某个地方,自己决定吧!
解压 file.tar.bz2的命令: tar jxvf file.tar.bz2
2.把交叉编译器路径添加到系统的路径中:
#vi /root/.bashrc
在alias l='ls -CF'后的空白处填上:
PATH=$PATH:/usr/local/arm2410/3.3.2/bin
export PATH
启动新系统路径:
#source /root/.bashrc
显示新系统路径:
# echo $PATH
查看交叉编译器版本号
# arm-linux-gcc -v
3.修改 linux-2.6.8的根目录下的 makfile 文件:
注释掉以下内容:
#ARCH ?= $(SUBARCH)
#CROSS_COMPILE ?=
增加如下内容:
ARCH : = arm
CROSS_COMPILE =/usr/local/arm2410/3.3.2/bin/arm-linux-
4.运行 #make menuconfig
出错:scripts/kconfig/mconf.c:91: error: static declaration of ‘current_menu’ follows non-static declaration
scripts/kconfig/lkc.h:63: error: previous declaration of ‘current_menu’ was here
make[1]: *** [scripts/kconfig/mconf.o] Error 1
make: *** [menuconfig] Error 2
解决办法:
修改 scripts/kconfig/mconf.c文件 ,通过注释相关代码行问题解决:
static struct termios ios_org;
static int rows = 0, cols = 0;
static struct menu *current_menu; //********修改之前
//struct menu *current_menu; //********
static int child_count;
注释粗体行并取消其下行代码注释,结果如下
static struct termios ios_org;
static int rows = 0, cols = 0;
//static struct menu *current_menu; //********修改之后
struct menu *current_menu; //********
static int child_count;
再运行:#make menuconfig
出错:
>> Unable to find the Ncurses libraries.
>>
>> You must install ncurses-devel in order
>> to use 'make menuconfig'
make[2]: *** [scripts/lxdialog/ncurses] 错误 1
make[1]: *** [menuconfig] 错误 2
make: *** [menuconfig] 错误 2
解决办法: 安装ncurses-dev (**注意软件包的名字**)
#apt-get install ncurses-dev
再运行: #make menuconfig
加载默认设置 gec2410.cfg
最后:# make
完成移植
注意:更新 bootloader (GEC2410_BOIS_bin)
< end >
Enjoy it!