移植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

你可能感兴趣的:(移植linux-2.6.27到9G9260开发板)