{"id":182,"date":"2023-06-11T14:08:36","date_gmt":"2023-06-11T06:08:36","guid":{"rendered":"https:\/\/22222.v6.army:\/?p=182"},"modified":"2023-06-20T00:32:41","modified_gmt":"2023-06-19T16:32:41","slug":"openwrt-patch-%e5%90%84%e7%a7%8d%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/ch.cc.ua\/?p=182","title":{"rendered":"openwrt patch \u5404\u79cd\u4f7f\u7528\u65b9\u6cd5"},"content":{"rendered":"\n<audio src=\"https:\/\/ch.cc.ua\/wp-content\/uploads\/2023\/06\/Nanne-Hall-om-mig.mp3\" controls loop autoplay><\/audio>  \n\n\n\n<p class=\"has-vivid-green-cyan-color has-text-color\"><strong>\u4e00\u3001patch\u4f7f\u7528\u65b9\u6cd5<\/strong><\/p>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\">git apply xxxx.patch <\/p>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\">git apply 0001-add-mt7621_zte_e8820s-support.patch<\/p>\n\n\n\n<p class=\"has-vivid-green-cyan-color has-text-color\"><strong>\u4e8c\u3001\u5982\u4f55\u6253patch<\/strong><\/p>\n\n\n\n<p class=\"has-vivid-cyan-blue-color has-text-color\"><strong>1\u3001\u5728\u6e90\u76ee\u5f55\u76f4\u63a5\u4f7f\u7528Linux\u81ea\u5e26\u7684diff\u547d\u4ee4,     git diff &gt;&nbsp;<\/strong><\/p>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\">git diff&nbsp; &gt; xxxx.patch<\/p>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\">git diff&nbsp; &gt; 001.patch<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-vivid-cyan-blue-color has-text-color\"><strong>2\u3001<code>git format-patch<\/code> \u547d\u4ee4\u7684\u57fa\u672c\u8bed\u6cd5\u662f\uff1a<\/strong><\/p>\n\n\n\n<pre id=\"block-ec796b9b-9bad-4387-adf7-223a545f8405\" class=\"wp-block-preformatted has-pale-pink-color has-text-color\">Copy Code<code>$ git format-patch [&lt;options&gt;] &lt;commit&gt;...<\/code><\/pre>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\">\u5176\u4e2d <code>&lt;commit&gt;<\/code> \u53ef\u4ee5\u662f\u4e00\u4e2a\u6216\u591a\u4e2a Git \u63d0\u4ea4\u8bb0\u5f55\u7684 SHA1 \u6807\u8bc6\u7b26\u6216\u8005\u5f15\u7528\uff08\u4f8b\u5982\u5206\u652f\u540d\u6216\u6807\u7b7e\u540d\uff09\u3002\u8be5\u547d\u4ee4\u4f1a\u6839\u636e\u6307\u5b9a\u7684\u63d0\u4ea4\u8bb0\u5f55\u751f\u6210\u4e00\u4e2a\u6216\u591a\u4e2a\u4ee5 <code>.patch<\/code> \u6216 <code>.txt<\/code> \u7ed3\u5c3e\u7684\u8865\u4e01\u6587\u4ef6\uff0c\u5e76\u8f93\u51fa\u5230\u6807\u51c6\u8f93\u51fa\u6216\u6307\u5b9a\u7684\u8f93\u51fa\u6587\u4ef6\u4e2d\u3002<\/p>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\">\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 <code>&gt;<\/code> \u7b26\u53f7\u5c06\u8f93\u51fa\u91cd\u5b9a\u5411\u5230\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff0c\u4f8b\u5982\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-pale-pink-color has-text-color\">Copy Code<code>$ git format-patch HEAD~3 &gt; my-patches.patch<\/code><\/pre>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\">\u8fd9\u4e2a\u547d\u4ee4\u5c06\u6700\u8fd1\u7684\u4e09\u4e2a\u63d0\u4ea4\u8bb0\u5f55\u8f6c\u6362\u6210\u4e86\u4e00\u4e2a\u5305\u542b\u4e09\u4e2a\u8865\u4e01\u6587\u4ef6\u7684\u6587\u4ef6\u96c6\uff0c\u6240\u6709\u7684\u8865\u4e01\u90fd\u5b58\u50a8\u5728 <code>my-patches.patch<\/code> \u6587\u4ef6\u4e2d\u3002\u6b64\u5916\uff0c\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u9009\u9879\u548c\u53c2\u6570\u6765\u81ea\u5b9a\u4e49\u8865\u4e01\u6587\u4ef6\u7684\u751f\u6210\u65b9\u5f0f\uff0c\u5305\u62ec\u6587\u4ef6\u540d\u683c\u5f0f\u3001\u8f93\u51fa\u76ee\u5f55\u3001\u90ae\u4ef6\u683c\u5f0f\u7b49\u7b49<\/p>\n\n\n\n<p class=\"has-vivid-cyan-blue-color has-text-color\"><strong>3\u3001\u6e90\u6587\u4ef6\u5bf9\u6bd4\u4fee\u6539\uff0c\u5728\u7f16\u8f91\u4fee\u6539\u6e90\u6587\u4ef6\u4e4b\u524d\uff0c\u53ea\u9700\u8981\u4fdd\u5b58\u4e00\u4efd\u6211\u4eec\u8981\u4fee\u6539\u7684\u6e90\u6587\u4ef6\u7528\u4e8e\u5bf9\u6bd4\u5373\u53ef<\/strong>\u3002<\/p>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\">\u4ee5kernel\u52a0\u8f7d4G\u6a21\u5757\u6765\u4e3e\u4f8b\uff0c\u4e00\u822c\u6211\u4eec\u4f1a\u5728option.c\u4e2d\u6dfb\u52a04G\u6a21\u5757\u7684VID,PID<\/p>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\">\u7b2c\u4e00\uff0c\u4fdd\u5b58\u539f\u6709\u7684option.c\u6587\u4ef6<\/p>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\">\u7b2c\u4e8c\uff0c\u4fee\u6539option.c\uff0c\u6dfb\u52a0\u6211\u4eec\u76844G\u6a21\u5757\u7684VID\uff0cPID<\/p>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\">\u7b2c\u4e09\uff0c\u91cd\u547d\u540d\u6587\u4ef6\u4e3aoption_new.c\uff0c\u6b64\u5904\u4e3b\u8981\u662f\u4e3a\u4e86\u65b9\u4fbfdiff\uff0c\u7f16\u8bd1\u65f6\u8fd8\u662f\u9700\u8981\u4f7f\u7528option.c\u6587\u4ef6\u540d\u7684<\/p>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\">\u4fee\u6539\u597d\u4e86\u6587\u4ef6\uff0c\u4e0b\u9762 \u5f00\u59cb\u5236\u4f5cpatch\uff0c\u6267\u884c\u4e00\u6761\u6307\u4ee4\u5373\u53ef\uff1a<\/p>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\">diff -ruN option.c option_new.c &gt; 999-kernel-option-add-new-dev.patch<\/p>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\">diff -ruN a b &gt; 001-libnftnl-add-fullcone-expression-support.patch<\/p>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\">diff -ruN a b &gt; 002-nftables-add-fullcone-expression-support.patch<\/p>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\">diff -ruN mt7621_zte_e8820s.dts mt7621_zte_e8820s-1.dts &gt; 001-mt7621_zte_e8820s.patch<\/p>\n\n\n\n<p class=\"has-vivid-cyan-blue-color has-text-color\"><strong>4\u3001\u6307\u5b9a\u6587\u4ef6\u6253\u8865\u4e01<\/strong><\/p>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\">\u5728 `target\/linux\/ramips\/dts` \u76ee\u5f55\u4e0b\u6210\u529f\u65b0\u5efa\u4e86 `mt7621_zte_e8820s.dts` \u6587\u4ef6\uff0c\u5e76\u4e14\u5e0c\u671b\u5c06\u5176\u4f5c\u4e3a\u4e00\u4e2a\u5355\u72ec\u7684\u8865\u4e01\u6765\u63d0\u4ea4\uff0c\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a<\/p>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\"><s>a. \u786e\u4fdd\u5f53\u524d\u76ee\u5f55\u662f Git \u4ed3\u5e93\u7684\u6839\u76ee\u5f55\u3002<\/s><\/p>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\">b. \u8fd0\u884c `git add target\/linux\/ramips\/dts\/mt7621_zte_e8820s.dts` \u547d\u4ee4\u5c06\u8be5\u6587\u4ef6\u6dfb\u52a0\u5230\u6682\u5b58\u533a\u4e2d\u3002<\/p>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\">c. \u8fd0\u884c `git diff &#8211;staged` \u547d\u4ee4\u751f\u6210\u65b0\u7684\u8865\u4e01\u6587\u4ef6\u3002\u8be5\u547d\u4ee4\u4f1a\u5c06\u6682\u5b58\u533a\u548c\u4e0a\u4e00\u6b21\u63d0\u4ea4\u4e4b\u95f4\u7684\u5dee\u5f02\u8f93\u51fa\u5230\u63a7\u5236\u53f0\u3002<\/p>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\">d. \u5c06\u8865\u4e01\u4fdd\u5b58\u5230\u4e00\u4e2a\u65b0\u6587\u4ef6\uff0c\u6bd4\u5982 `0001-add-mt7621_zte_e8820s-support.patch`\uff1a`git diff &#8211;staged &gt; 0001-add-mt7621_zte_e8820s-support.patch`<\/p>\n\n\n\n<p class=\"has-pale-pink-color has-text-color\"><s>e. \u786e\u8ba4\u8865\u4e01\u6587\u4ef6\u7684\u5185\u5bb9\u548c\u547d\u540d\u683c\u5f0f\u7b26\u5408\u8981\u6c42\u540e\uff0c\u5c31\u53ef\u4ee5\u5c06\u5176\u53d1\u9001\u7ed9\u5176\u4ed6\u5f00\u53d1\u8005\u8fdb\u884c review \u548c\u5408\u5e76\u3002<\/s><\/p>\n<div class=\"clearfix\"><\/div>","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001patch\u4f7f\u7528\u65b9\u6cd5 git apply xxxx.patch git apply 0001-add-mt7 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":184,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-182","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-3"],"_links":{"self":[{"href":"https:\/\/ch.cc.ua\/index.php?rest_route=\/wp\/v2\/posts\/182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ch.cc.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ch.cc.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ch.cc.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ch.cc.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=182"}],"version-history":[{"count":4,"href":"https:\/\/ch.cc.ua\/index.php?rest_route=\/wp\/v2\/posts\/182\/revisions"}],"predecessor-version":[{"id":204,"href":"https:\/\/ch.cc.ua\/index.php?rest_route=\/wp\/v2\/posts\/182\/revisions\/204"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ch.cc.ua\/index.php?rest_route=\/wp\/v2\/media\/184"}],"wp:attachment":[{"href":"https:\/\/ch.cc.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ch.cc.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ch.cc.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}