移植linux-2.6.27到9G9260开发板

移植linux-2.6.27到9G9260开发板

1,下载解压源码:
 root@yuanxh-desktop:/home/yuanxh/sam9260# wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.27.tar.bz2
 root@yuanxh-desktop:/home/yuanxh/sam9260# wget http://maxim.org.za/AT91RM9200/2.6/2.6.27-at91.patch.gz
 root@yuanxh-desktop:/home/yuanxh/sam9260# wget ftp://www.linux4sam.org/pub/linux/2.6.27-at91/2.6.27-at91-exp.patch.gz

2,打补丁:
 root@yuanxh-desktop:/home/yuanxh/sam9260# tar xjvf linux-2.6.27.tar.bz2
 root@yuanxh-desktop:/home/yuanxh/sam9260# gzip -d 2.6.27-at91.patch.gz
 root@yuanxh-desktop:/home/yuanxh/sam9260# gzip -d 2.6.27-at91-exp.patch.gz
 root@yuanxh-desktop:/home/yuanxh/sam9260# mv linux-2.6.27 linux-2.6.27-9g9260
 root@yuanxh-desktop:/home/yuanxh/sam9260# mv 2.6.27-at91.patch 2.6.27-at91-exp.patch linux-2.6.27-9g9260/
 root@yuanxh-desktop:/home/yuanxh/sam9260# cd linux-2.6.27-9g9260/
 root@yuanxh-desktop:/home/yuanxh/sam9260/linux-2.6.27-9g9260# patch -p1 < ./2.6.27-at91.patch
 root@yuanxh-desktop:/home/yuanxh/sam9260/linux-2.6.27-9g9260# patch -p1 < ./2.6.27-at91-exp.patch 

3,修改Makefile
 root@yuanxh-desktop:/home/yuanxh/sam9260/linux-2.6.27-9g9260# vi Makefile
  把第4行的EXTRAVERSION = 修改为 EXTRAVERSION =-9g9260
  把193行的ARCH           ?= $(SUBARCH) 修改为 ARCH           ?= arm
 把194行的CROSS_COMPILE  ?= 修改为  CROSS_COMPILE  ?= arm-linux-
 
4,修改Kconfig
 root@yuanxh-desktop:/home/yuanxh/sam9260/linux-2.6.27-9g9260# vi arch/arm/mach-at91/Kconfig
 在第189行添加上:
 
 config MACH_9G9260EK
 bool "9G9260-EK Evaluation Kit"
 depends on MACH_AT91SAM9260EK
 help
   Select this if you are using yuanxihua's 9G9260EK Evaluation Kit
   <http://blog.163.com/yuan_xihua/>

5,默认配置:
 root@yuanxh-desktop:/home/yuanxh/sam9260/linux-2.6.27-9g9260# make help
 root@yuanxh-desktop:/home/yuanxh/sam9260/linux-2.6.27-9g9260# make at91sam9260ek_defconfig
 root@yuanxh-desktop:/home/yuanxh/sam9260/linux-2.6.27-9g9260# make menuconfig
 关闭掉这个选项
 Kernel Features  ---> 
 [*] Use the ARM EABI to compile the kernel
 修改启动命令行参数
 Boot options  --->   
  (mem=64M console=ttyS0,115200 initrd=0x21100000,3145728 root=/dev/ram0 rw)
 修改为:
 noinitrd root=/dev/nfs rw nfsroot=192.168.1.108:/nfsboot/rootfs ip=192.168.1.118:192.168.1.108::255.255.255.0 console=ttyS0,115200 init=/linuxrc mem=64M
 
 选择如下配置:
 System Type  --->
 Atmel AT91 System-on-Chip  --->
 [*]   9G9260-EK Evaluation Kit   
 保存配置:
 root@yuanxh-desktop:/home/yuanxh/sam9260/linux-2.6.27-9g9260# cp .config 9g9260ek_defconfig
 root@yuanxh-desktop:/home/yuanxh/sam9260/linux-2.6.27-9g9260# mv 9g9260ek_defconfig arch/arm/configs/

6,编译发布:
 root@yuanxh-desktop:/home/yuanxh/sam9260/linux-2.6.27-9g9260# make 9g9260ek_defconfig
 root@yuanxh-desktop:/home/yuanxh/sam9260/linux-2.6.27-9g9260# make uImage
 root@yuanxh-desktop:/home/yuanxh/sam9260/linux-2.6.27-9g9260# cp arch/arm/boot/uImage uImage-2.6.27-9g9260.bin
 root@yuanxh-desktop:/home/yuanxh/sam9260/linux-2.6.27-9g9260# sz uImage-2.6.27-9g9260.bin
7,清除配置 
 root@yuanxh-desktop:/home/yuanxh/sam9260/linux-2.6.27-9g9260# make distclean
 root@yuanxh-desktop:/home/yuanxh/sam9260/linux-2.6.27-9g9260# make mrproper

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值