Linux下打补丁

把改好的u-boot-2010.09复制到文件夹patch,将u-boot-2010.09重命名为u-boot-2010.09-fl2440

进入u-boot-2010.09-fl2440,先make distclean

将源码包解压到patch文件夹下

在此路径下

diff -Nuar u-boot-2010.09 u-boot-2010.09-fl2440 > u-boot-2010.09.patch

这样就得到补丁文件

一般参数就用-Nuar

还有要将两个文件放到同一文件夹下


patch打补丁如下

[luminqi@centos6 u-boot-2010.09]$ cd board
[luminqi@centos6 board]$ mkdir -p lingyun/fl2440
[luminqi@centos6 board]$ cp samsung/smdk2410/* lingyun/fl2440/
[luminqi@centos6 board]$ cd lingyun/fl2440/
[luminqi@centos6 fl2440]$ ls
config.mk  flash.c  lowlevel_init.S  Makefile  smdk2410.c
[luminqi@centos6 fl2440]$ mv smdk2410.c fl2440.c
[luminqi@centos6 fl2440]$ cd ../../../
[luminqi@centos6 u-boot-2010.09]$ cp include/configs/smdk2410.h include/configs/fl2440.h
[luminqi@centos6 u-boot-2010.09]$ patch -p1 < /home/luminqi/my_svn/fl2440test/trunk/src/u-boot-2010.09.patch 
patching file arch/arm/cpu/arm920t/s3c24x0/speed.c
patching file arch/arm/cpu/arm920t/s3c24x0/timer.c
patching file arch/arm/cpu/arm920t/start.S
patching file arch/arm/cpu/arm920t/u-boot.lds
patching file arch/arm/include/asm/arch-s3c24x0/s3c24x0_cpu.h
patching file arch/arm/include/asm/arch-s3c24x0/s3c24x0.h
patching file board/lingyun/fl2440/fl2440.c
patching file board/lingyun/fl2440/lowlevel_init.S
patching file board/lingyun/fl2440/Makefile
patching file board/lingyun/fl2440/nand_read.c
patching file boards.cfg
patching file common/cmd_nand.c
patching file common/serial.c
patching file drivers/mtd/nand/s3c2410_nand.c
patching file drivers/net/dm9000x.c
patching file include/configs/fl2440.h
patching file include/serial.h
patching file Makefile

因为之前对u-boot-2010.09做了一点改动,

如果要用补丁文件为源码的u-boot-2010.09打补丁的话

也要做相应的改动

这里用参数p1,是因为当时路径在u-boot-2010.09目录之下,

若和u-boot-2010.09在同一目录,使用p0也可以


常用命令

diff -nuar 源文件 改动文件 > patch文件

patch -p0(-p1) < patch文件



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值