参考资料
https://wiki.openwrt.org/doc/devel/patches
https://lede-project.org/docs/guide-developer/use-patches-with-buildsystem
先安装quilt
# apt-get install quilt
配置
cat > ~/.quiltrc <<EOF QUILT_DIFF_ARGS="--no-timestamps --no-index -p ab --color=auto" QUILT_REFRESH_ARGS="--no-timestamps --no-index -p ab" QUILT_SERIES_ARGS="--color=auto" QUILT_PATCH_OPTS="--unified" QUILT_DIFF_OPTS="-p" EDITOR="nano" EOF
如果要编译内核 make -C target/linux compile
在 target/linux/ramips/patches-4.4/ 目录下已经有好多补丁
好了,准备开始
1)清除旧的编译
make target/linux/clean
2) 准备全新的源代码
make target/linux/prepare QUILT=1 或者 make target/linux/prepare V=s QUILT=1
3)应用所有已经存在的补丁
切换到kernel目录 cd build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7688/linux-3.18.44 应用补丁 quilt push -a
4)查看最大的patch编号
quilt series 或者 quilt top
5)添加我们自己的补丁
quilt new generic/999-EC20R2_qmi_driver.patch
6)修改源文件
quilt edit drivers/usb/serial/option.c quilt edit drivers/usb/serial/usb_wwan.c quilt edit drivers/net/usb/qmi_wwan.c
7)确认diff是否完整
quilt diff
8)将diff写入到文件
quilt refresh
9.回到build根目录
make target/linux/update package/index V=s
会将我们的补丁,放到合适的目录
也可以手动做这个操作
将
build_dir/target-mipsel_24kc_musl/linux-ramips_mt7688/linux-4.4.49/patches/generic/999-EC20R2_qmi_driver.patch
放到
target/linux/generic/patches-4.4/999-EC20R2_qmi_driver.patch
本站的文章和资源来自互联网或者站长的原创,按照 CC BY -NC -SA 3.0 CN协议发布和共享,转载或引用本站文章应遵循相同协议。如果有侵犯版权的资 源请尽快联系站长,我们会在24h内删除有争议的资源。欢迎大家多多交流,期待共同学习进步。