本文原文地址:http://blog.csdn.net/crazyleen
openwrt已经支持IMX6的u-boot,u-boot位于package/boot/uboot-imx6,只需要针对自己的u-boot添加补丁,openwrt使用quilt管理补丁,以下是制作补丁的全过程。
参考文档http://wiki.openwrt.org/doc/devel/patches
首先配置quilt生产openwrt的补丁格式
cat > ~/.quiltrc <<EOF QUILT_DIFF_ARGS="--no-timestamps --no-index -pab --color=auto" QUILT_REFRESH_ARGS="--no-timestamps --no-index -pab" QUILT_PATCH_OPTS="--unified" QUILT_DIFF_OPTS="-p" EDITOR="nano" EOF
准备补丁修改
makepackage/example/{clean,prepare}V=s QUILT=1
进入编译目录
cdbuild_dir/target-*/example-*
打上现有补丁
quiltpush -a
新建一个空的补丁文件
quiltnew 010-main_code_fix.patch
编辑文件
quiltedit src/main.c
查看差异
quiltdiff
更新补丁文件
quiltrefresh
返回openwrt主目录,更新openwrt补丁文件
makepackage/example/updateV=s
编译测试
makepackage/example/{clean,compile}package/index V=s
补充:添加新文件要先quiltadd your_file, 然后再新建并编辑文件,或则复制文件进来。
1.修改package/boot/uboot-imx6/Makefile
#在UBOOTS添加snapgate,
defineuboot/snapgate
TITLE:=U-Bootfor the snapget Solo 1G board
endef
2.制作补丁过程
makepackage/boot/uboot-imx6/prepare V=s QUILT=1
cdbuild_dir/target-arm_cortex-a9+vfpv3_uClibc-0.9.33.2_eabi/u-boot-snapgate/u-boot-2013.10
quiltpush -a
quilt new 120-snapgate-support.patch
quilt edit boards.cfg
quilt add include/configs/snapgate.h
quilt add board/snapgate/Makefile
quilt add board/snapgate/snapgate1g.cfg
quilt add board/snapgate/snapgate.c
quilt add board/snapgate/readme.md
quilt add board/snapgate/snapgate512m.cfg
#现在复制添加的文件进去
quiltrefresh
cd../../../../
makepackage/boot/uboot-imx6/update V=s
最终生成新的补丁文件package/boot/uboot-imx6/patches/120-snapgate-support.patch
makemenuconfig配置
BootLoaders --->
<*>uboot-imx6-snapgate................. U-Boot for the snapget Solo 1Gboard