linux 11.29-1

本文介绍如何使用diff工具创建Linux内核补丁文件。重点讲解了递归(-r)、新建文件(-N)和统一格式(-u)等选项的作用,并推荐使用-unified和-show-c-function参数来提高补丁文件的可读性和实用性。

$ diff -puN .config arch/arm/configs/android_zoom3_defconfig>tmp.patch

-r 是一个递归选项,设置了这个选项, diff 会将两个不同版本源代码目录中的所有对应文件全部都进行一次比较,包括子目录文件。

-N 选项确保补丁文件将正确地处理已经创建或删除文件的情况。

-u 选项以统一格式创建补丁文件,这种格式比缺省格式更紧凑些。

-u  -U NUM  --unified[=NUM]  输出 NUM (默认 3) 行合并的上下文。
            --label LABEL  使用 LABEL 而非文件名。
            -p  --show-c-function  显示每条更改所在的 C 函数。

-r  --recursive 递归对比所有的子目录。

-N  --new-file  将不存在的文件当成空文件。

 

"diff -up"
------------

Use "diff -up" or "diff -uprN" to create patches.

All changes to the Linux kernel occur in the form of patches, as
generated by diff(1).  When creating your patch, make sure to create it
in "unified diff" format, as supplied by the '-u' argument to diff(1).
Also, please use the '-p' argument which shows which C function each
change is in - that makes the resultant diff a lot easier to read.
Patches should be based in the root kernel source directory,
not in any lower subdirectory.

 

Documentation/SubmittingDrivers

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值