概述
一、参考官网
http://wiki.openwrt.org/doc/devel/patches
二、用patch管理内核的修改
1、清空回到干净状态
make target/linux/{clean,prepare} V=s QUILT=1
2、进入内核根目录
cd build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_rt305x/linux-3.10.49/
ls patches/
generic platform series
quilt series
generic 对应 target/linux/generic/patches-3.10/
platform 对应 target/linux/ramips/patches-3.10/
3、创建内核补丁(这里修改MAGIC number)
quilt new platform/0500-mtd_maigc-number.patch
4、编辑待修改文件
quilt edit drivers/mtd/mtdpart.c
791 //#define UBOOT_MAGIC 0x27051956
792 #define UBOOT_MAGIC 0x47352696
quilt edit drivers/mtd/mtdsplit_uimage.c
23 //#define IH_MAGIC 0x27051956 /* Image Magic Number */
24 #define IH_MAGIC 0x47352696 /* Image Magic Number */
5、保存补丁
quilt refresh
6、回写到target/linux/ramips/patches-3.10/目录
cd -
make target/linux/update
三、用patch管理tools
1、清空回到原始状态
make tools/mkimage/{clean,prepare} V=s QUILT=1
2、查看现有补丁
cd build_dir/host/u-boot-2014.04/
quilt series
3、创建新补丁(magic number补丁)
quilt new 070-image_h-ih_magic.patch
4、编辑待修改文件
quilt edit include/image.h
228 //#define IH_MAGIC 0x27051956 /* Image Magic Number */
229 #define IH_MAGIC 0x47352696 /* Image Magic Number */
5、保存补丁
quilt refresh
6、回写到tools/mkimage/patches目录
cd -
make tools/mkimage/update V=s
ls tools/mkimage/patches/
即可看到 070-image_h-ih_magic.patch
四、用patch管理package
最后
以上就是优美星星为你收集整理的Openwrt 之Patch应用的全部内容,希望文章能够帮你解决Openwrt 之Patch应用所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复