{"id":1306,"date":"2020-02-22T11:09:25","date_gmt":"2020-02-22T03:09:25","guid":{"rendered":"https:\/\/www.jarvisw.com\/?p=1306"},"modified":"2020-02-22T19:59:26","modified_gmt":"2020-02-22T11:59:26","slug":"%e5%8d%95%e7%8b%ac%e7%bc%96%e8%af%91openwrt%e5%86%85%e6%a0%b8%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.jarvisw.com\/?p=1306","title":{"rendered":"\u5355\u72ec\u7f16\u8bd1openwrt\u5185\u6838\u7684\u7b80\u5355\u65b9\u6cd5"},"content":{"rendered":"\n<p>\u3000\u3000\u4f7f\u7528openwrt\u5df2\u7ecf\u6709\u4e00\u4e9b\u65f6\u95f4\u4e86\uff0copenwrt\u5b98\u65b9\u7684\u9879\u76ee\u63d0\u4f9b\u4e86\u5f88\u5b8c\u6574\u7684\u5de5\u5177\u94fe\uff0c\u53ea\u9700\u8981clone\u5b98\u65b9\u7684git\u5e76\u4e14make\u5373\u53ef\u81ea\u52a8\u5b8c\u6210openwrt\u955c\u50cf\u7684\u6784\u5efa\u3002\u4f46\u662f\uff0c\u8fd9\u79cd\u65b9\u6cd5\u6bd4\u8f83\u81c3\u80bf\uff0c\u6bcf\u6b21\u90fd\u4f1a\u91cd\u65b0\u6784\u5efa\u6574\u4e2a\u5185\u6838\u4ee5\u53ca\u6240\u6709\u8f6f\u4ef6\u5305\uff0c\u4f1a\u82b1\u975e\u5e38\u591a\u7684\u65f6\u95f4\u3002\u5e76\u4e14\uff0c\u6700\u8fd1\u4e3a\u4e86\u7814\u7a76\u9700\u8981\uff0c\u60f3\u8981\u7f16\u8bd1\u65e7\u7248\u672c\u7684\u5185\u6838\u653e\u5728qemu\u5f53\u4e2d\u8fd0\u884c\uff0c\u5982\u679c\u5bf9\u4e8e\u65b0\u7684\u53d1\u884c\u7248\uff0c\u6bd4\u598218.06\uff0c19.07\u7684\u7248\u672c\uff0c\u53ef\u4ee5\u4f7f\u7528make target\/linux\/compile\u5c31\u53ef\u4ee5\u5355\u72ec\u7f16\u8bd1\u5185\u6838\u3002\u4f46\u662f\u65e7\u7f16\u8bd1\u94fe\u7531\u4e8efeeds\u90fd\u5df2\u7ecf\u5e9f\u5f03\uff0c\u6240\u4ee5\u5982\u679c\u60f3\u8981\u7f16\u8bd15\uff0c6\u5e74\u524d\u7684\u53d1\u884c\u7248\u5185\u6838\uff0c\u6bd4\u5982kamikaze,backfire\u8fd9\u79cdn\u5e74\u524d\u7684\u53d1\u884c\u7248\uff0c\u76ee\u524d\u8981\u6b63\u5e38\u5b8c\u6574\u6784\u5efa\u56e0\u4e3a\u7f3a\u5c11\u5f88\u591a\u7b2c\u4e09\u65b9\u7684svn\u6e90\uff0c\u5df2\u7ecf\u4e0d\u592a\u53ef\u80fd\u4e86\u3002\u6240\u4ee5\u672c\u6587\u7ed9\u51fa\u4e86\u4e00\u79cd\u81ea\u5df1\u7f16\u8bd1\u7684\u65b9\u6cd5\uff0c\u6b65\u9aa4\u4e5f\u5e76\u4e0d\u590d\u6742\uff0c\u5728\u6b64\u8bb0\u5f55\u4e00\u4e0b\uff1a<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4ea4\u53c9\u7f16\u8bd1\u94fe\u7684\u9009\u62e9<\/h2>\n\n\n\n<p>         \u7b14\u8005\u8fd9\u91cc\u4f7f\u7528\u76ee\u524d\u6bd4\u8f83\u6d41\u884c\u7684musl-cross\u7f16\u8bd1\u94fe\uff1a<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/GregorR\/musl-cross\">https:\/\/github.com\/GregorR\/musl-cross<\/a><\/p>\n\n\n\n<p>\u6309\u7167\u5b98\u65b9\u64cd\u4f5c\u8bf4\u660e\u751f\u6210\u5bf9\u5e94\u67b6\u6784\u7684\u7f16\u8bd1\u5668\u5373\u53ef\uff0c\u8fd9\u91cc\u5c31\u4e0d\u5e9f\u8bdd\u4e86\u3002\u9ed8\u8ba4\u4f1a\u5b89\u88c5\u5728\/opt\/cross\/xxxx-linux-musl\u4e4b\u7c7b\u4e0b\u9762\uff0c\u672c\u6587\u5c31\u4ee5mips\u4e3a\u4f8b\u6765\u64cd\u4f5c\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u83b7\u5f97\u5185\u6838\u6e90\u7801<\/h2>\n\n\n\n<p>         \u5185\u6838\u6e90\u7801\u76f4\u63a5\u4ecekernel.org\u83b7\u5f97\u5373\u53ef\uff0copenwrt\u5185\u6838\u548cmainline\u7684\u5185\u6838\u533a\u522b\u5c31\u5728\u4e8eopenwrt\u5bf9\u5185\u6838\u6253\u4e86\u975e\u5e38\u591a\u7684patch\uff0c\u53ea\u8981\u4ece\u5b98\u65b9\u5185\u6838+patch\u5373\u53ef\u5f97\u5230openwrt\u7684\u5185\u6838\uff0c\u4ee5kamikaze\u7248\u672c\u7684\u5185\u68382.6.32.10\u4e3a\u4f8b\uff0c\u9996\u5148\u83b7\u5f97\u4e3b\u7ebf\u5185\u6838\uff1a<\/p>\n\n\n\n<p><a href=\"https:\/\/mirrors.edge.kernel.org\/pub\/linux\/kernel\/v2.6\/linux-2.6.32.10.tar.xz\">https:\/\/mirrors.edge.kernel.org\/pub\/linux\/kernel\/v2.6\/linux-2.6.32.10.tar.xz<\/a><\/p>\n\n\n\n<p>\u89e3\u538b\u4e4b\u540e\uff0c\u4eceopenwrt\u7684git\u4e2d\u83b7\u5f97patch\u548c\u589e\u52a0\u7684\u4ee3\u7801\uff1a<\/p>\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">git clone https:\/\/git.openwrt.org\/openwrt\/svn-archive\/openwrt.git\ncd openwrt\ngit checkout &lt;tag or commit&gt;<\/pre>\n\n\n<p>\u7136\u540e\u5c06target\/linux\/genetic-2.6\u91cc\u9762\u627e\u5230files\u76ee\u5f55\uff0c\u91cc\u9762\u7684\u5185\u5bb9\u76f4\u63a5\u8986\u76d6\u5230\u5185\u6838\u7684\u6839\u76ee\u5f55\uff0c\u7136\u540e\u590d\u5236target\/linux\/genetic-2.6\/patches-2.6.32\u91cc\u9762\u7684patch\u5230\u67d0\u4e2a\u76ee\u5f55\uff0c\u7136\u540e\u5728\u5185\u6838\u4e2d\u5e94\u7528openwrt\u4e2d\u63d0\u53d6\u7684patch\u5373\u53ef\uff0c\u8fd9\u4e2a\u5c31\u6bd4\u8f83\u9ebb\u70e6\u53ea\u80fd\u624b\u5de5\u64cd\u4f5c\u4e86\uff0c\u6211\u8fd9\u91cc\u5199\u4e86\u4e00\u4e2abash\u811a\u672c\u6765\u5b8c\u6210\uff0c\u4fdd\u5b58\u6210apply_patch.sh\uff1a<\/p>\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">#!\/bin\/sh\n\nfor file in `ls $1`\ndo\n    patch -p1 &lt; $1\"\/\"$file\ndone\n<\/pre>\n\n\n<p>\u5207\u6362\u5230\u5185\u6838\u6839\u76ee\u5f55\uff0c\u7136\u540e\u8fd0\u884c\u4e0a\u8ff0\u811a\u672c<\/p>\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">.\/apply_patch.sh .\/patches-2.6.32\/<\/pre>\n\n\n<p>\u8fd9\u6837\u5c31\u6253\u4e0aopenwrt\u7684patch\u4e86\uff0c\u73b0\u5728\u7684\u5185\u6838\u5c31\u5df2\u7ecf\u662fopenwrt\u7684\u5185\u6838\u4e86\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6784\u5efa\u5185\u6838<\/h2>\n\n\n\n<p>\u7136\u540e\u6839\u636e\u6211\u4eec\u9700\u8981\u7684\u67b6\u6784\uff0c\u4ee5mips\u4e3a\u4f8b\uff0c\u8fd0\u884c\uff1a<\/p>\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">make ARCH=mips CROSS_COMPILE=\/opt\/cross\/mipseb-linux-musl\/bin\/mipseb-linux-musl- menuconfig\nmake ARCH=mips CROSS_COMPILE=\/opt\/cross\/mipseb-linux-musl\/bin\/mipseb-linux-musl- make -j8<\/pre>\n\n\n<p>\u6700\u7ec8\u4f1a\u5728\u5185\u6838\u76ee\u5f55\u4e0b\u751f\u6210vmlinux\uff0c\u5373\u6211\u4eec\u9700\u8981\u7684\u5185\u6838\u4e86\u3002<\/p>\n\n\n\n<p>\u5f53\u7136\uff0c\u7f16\u8bd1\u8fc7\u7a0b\u53ef\u80fd\u4f1a\u6709\u4e00\u4e9b\u9519\u8bef\uff0c\u56e0\u4e3amainline\u5185\u6838\u8981\u5728\u4ea4\u53c9\u7f16\u8bd1\u4e2d\u6b63\u5e38\u4f7f\u7528\uff0c\u53ef\u80fd\u9700\u8981\u4e00\u4e9b\u989d\u5916\u7684patch\uff0c\u8fd9\u4e9b\u4e5f\u9700\u8981\u81ea\u5df1\u6536\u96c6\u4e00\u4e0b\u6253\u4e0a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u3000\u4f7f\u7528openwrt\u5df2\u7ecf\u6709\u4e00\u4e9b\u65f6\u95f4\u4e86\uff0copenwrt\u5b98\u65b9\u7684\u9879\u76ee\u63d0\u4f9b\u4e86\u5f88\u5b8c\u6574\u7684\u5de5\u5177\u94fe\uff0c\u53ea\u9700\u8981clone\u5b98\u65b9\u7684g [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,5],"tags":[246,64,187,66],"class_list":["post-1306","post","type-post","status-publish","format-standard","hentry","category-iot","category-5","tag-linux","tag-openwrt","tag-187","tag-66"],"_links":{"self":[{"href":"https:\/\/www.jarvisw.com\/index.php?rest_route=\/wp\/v2\/posts\/1306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jarvisw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jarvisw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jarvisw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jarvisw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1306"}],"version-history":[{"count":7,"href":"https:\/\/www.jarvisw.com\/index.php?rest_route=\/wp\/v2\/posts\/1306\/revisions"}],"predecessor-version":[{"id":1313,"href":"https:\/\/www.jarvisw.com\/index.php?rest_route=\/wp\/v2\/posts\/1306\/revisions\/1313"}],"wp:attachment":[{"href":"https:\/\/www.jarvisw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jarvisw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jarvisw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}