IMX6之Openwrt移植增加u-boot支持

openwrt已经支持IMX6u-bootu-boot位于package/boot/uboot-imx6,只需要针对自己的u-boot添加补丁,openwrt使用quilt管理补丁,以下是制作补丁的全过程。


使用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, 然后再新建并编辑文件,或则复制文件进来。


制作IMX6u-boot补丁的整个过程如下:

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


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值