{"id":1192,"date":"2017-08-02T18:34:54","date_gmt":"2017-08-02T10:34:54","guid":{"rendered":"http:\/\/www.kumouse.com\/?p=1192"},"modified":"2017-08-04T17:14:02","modified_gmt":"2017-08-04T09:14:02","slug":"openwrt%e5%bc%80%e5%8f%91%e4%b9%8b-%e7%9b%ae%e5%bd%95%e5%88%86%e6%9e%90%e4%b8%8emake%e8%bf%87%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.kumouse.com\/?p=1192","title":{"rendered":"OpenWRT\u5f00\u53d1\u4e4b\u2014\u2014\u76ee\u5f55\u5206\u6790\u4e0emake\u8fc7\u7a0b"},"content":{"rendered":"<h2 id=\"h2_0\">1.\u76ee\u5f55\u4ecb\u7ecd<\/h2>\n<p>\u6709\u51e0\u4e2a\u91cd\u8981\u76ee\u5f55\uff1apackage, target, build_dir, staging_dir, bin, dl, &#8230;<\/p>\n<p>&#8212;include \u76ee\u5f55\u662f\u5b58\u653e *.mk \u6587\u4ef6\u3002\u8fd9\u91cc\u7684\u6587\u4ef6\u4e0a\u662f\u5728Makefile\u91cc\u88abinclude\u7684<\/p>\n<p>&#8212;build_dir\/host \u76ee\u5f55\u662f\u5efa\u7acb\u5de5\u5177\u94fe\u65f6\u7684\u4e34\u65f6\u76ee\u5f55<\/p>\n<p>&#8212;build_dir\/toolchain-&lt;arch&gt;* \u5bf9\u5e94\u786c\u4ef6\u7684\u5de5\u5177\u94fe\u7684\u76ee\u5f55<\/p>\n<p>&#8212;staging_dir\/toolchain-&lt;arch&gt;*\u00a0 \u662f\u5de5\u5177\u94fe\u7684\u5b89\u88c5\u4f4d\u7f6e<\/p>\n<p>&#8212;target\/linux\/&lt;platform&gt; \u76ee\u5f55\u91cc\u9762\u662f\u5404\u4e2a\u5e73\u53f0(arch)\u7684\u76f8\u5173\u4ee3\u7801<\/p>\n<p>&#8212;target\/linux\/&lt;platform&gt;\/config-3.10 \u6587\u4ef6\u5c31\u662f\u914d\u7f6e\u6587\u4ef6\u4e86<\/p>\n<p>&#8212;dl \u76ee\u5f55\u662f&#8217;download&#8217;\u7684\u7f29\u5199,\u00a0\u5728 \u7f16\u8bd1\u524d\u671f\uff0c\u9700\u8981\u4ece\u7f51\u7edc\u4e0b\u8f7d\u7684\u6570\u636e\u5305\u90fd\u4f1a\u653e\u5728\u8fd9\u4e2a\u76ee\u5f55\u4e0b\uff0c\u8fd9\u4e9b\u8f6f\u4ef6\u5305\u7684\u4e00\u4e2a\u7279\u70b9\u5c31\u662f\uff0c\u4f1a\u81ea\u52a8\u5b89\u88c5\u5728\u6240\u7f16\u8bd1\u7684\u56fa\u4ef6\u4e2d\uff0c\u4e5f\u5c31\u662f\u6211\u4eecmake menuconfig\u7684\u65f6\u5019\uff0c\u4e3a\u56fa\u4ef6\u914d\u7f6e\u7684\u4e00\u4e9b\u8f6f\u4ef6\u5305\u3002\u5982\u679c\u6211\u4eec\u9700\u8981\u66f4\u6539\u8fd9\u4e9b\u6e90\u7801\u5305\uff0c\u53ea\u9700\u8981\u5c06\u66f4\u6539\u597d\u7684\u6e90\u7801\u5305\u6253\u5305\u6210\u76f8\u540c\u7684\u540d\u5b57\u653e\u5728\u8fd9\u4e2a\u76ee\u5f55\u4e0b\uff0c\u7136\u540e\u5f00\u59cb\u7f16 \u8bd1\u5373\u53ef\u3002\u7f16\u8bd1\u65f6\uff0c\u4f1a\u5c06\u8f6f\u4ef6\u5305\u89e3\u538b\u5230build_dir\u76ee\u5f55\u4e0b\u3002<\/p>\n<p>&#8212;build_dir\/ \u76ee\u5f55\u4e0b\u8fdb\u884c\u89e3\u538b\uff0c\u7f16\u8bd1\u548c\u6253\u8865\u4e01\u7b49\u3002<\/p>\n<p>&#8212;package\/ \u76ee\u5f55\u91cc\u9762\u5305\u542b\u4e86\u6211\u4eec\u5728\u914d\u7f6e\u6587\u4ef6\u91cc\u8bbe\u5b9a\u7684\u6240\u6709\u7f16\u8bd1\u597d\u7684\u8f6f\u4ef6\u5305\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4f1a\u6709\u9ed8\u8ba4\u9009\u62e9\u7684\u8f6f\u4ef6\u5305\u3002<\/p>\n<p>\u5728openwrt\u4e2dipk\u5c31\u662f\u4e00\u5207, \u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\uff1a<\/p>\n<pre>$\u00a0.\/scripts\/feeds\u00a0update\u00a0#\u6765\u5bf9\u8f6f\u4ef6\u5305\u8fdb\u884c\u66f4\u65b0.<\/pre>\n<pre>$\u00a0.\/scripts\/feeds\u00a0search\u00a0nmap\u00a0#\u67e5\u627e\u8f6f\u4ef6\u5305'nmap'\r\nSearch\u00a0results\u00a0in\u00a0feed\u00a0\u2019packages\u2019:\u00a0\r\nnmap\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Network\u00a0exploration\u00a0and\/or\u00a0security\u00a0auditing\u00a0utility<\/pre>\n<pre>$\u00a0.\/scripts\/feeds\u00a0install\u00a0nmap\u00a0#\u5b89\u88c5'nmap'\u8fd9\u4e2a\u8f6f\u4ef6<\/pre>\n<p>&#8212;feeds\/packages \u4e3a\u6267\u884c.\/scripts\/feeds install \u4e4b\u540e\u7684package\u3002<\/p>\n<p>&#8212;bin \u76ee\u5f55\u4e0b\u751f\u6210\u4e86\u5f88\u591abin\u6587\u4ef6\uff0c\u6839\u636e\u4e0d\u540c\u7684\u5e73\u53f0\u6765\u533a\u5206\u3002<\/p>\n<p>&#8212;bin\/&lt;platform&gt;\/package \u76ee\u5f55\u91cc\u9762\u6709\u5f88\u591aipk\u540e\u7f00\u7684\u6587\u4ef6\uff0c\u90fd\u662fpackage\u76ee\u5f55\u4e0b\u7684\u6e90\u7801\u5728build_dir\u76ee\u5f55\u4e0b\u7f16\u8bd1\u540e\u7684\u751f\u6210\u7684\u7ed3\u679c\u3002<\/p>\n<p>\u6ce8\uff1a\u4ee5\u4e0a\u6458\u81ea\uff1a[<a href=\"http:\/\/blog.csdn.net\/kingvenll\/article\/details\/27545221\" target=\"_blank\" rel=\"nofollow noopener\">openwrt\u6846\u67b6\u5206\u6790<\/a>]<\/p>\n<h2 id=\"h2_1\">2.\u5305\u7684make\u8fc7\u7a0b<\/h2>\n<p>\u6bd4\u5982\uff1alua\u5305\uff0cmips\u67b6\u6784\u3002<\/p>\n<p>make\u6b65\u9aa4\uff1a<\/p>\n<ol>\n<li>\u5728 make \u65f6\uff0cmake \u8bfb\u53d6\u5230 package\/utils\/lua\/Makefile \u6587\u4ef6\u5185\u5bb9\u3002<\/li>\n<li>\u5982\u679cgit\u6216svn\u6e90\uff0c\u90a3\u4e48\u5c31\u4f1a\u5728 tmp\/dl\/ \u76ee\u5f55\u4e0b\u5c06\u6e90\u4ee3\u7801 clone \u4e0b\u6765\u3002\u7136\u540e\uff0c\u5c06 clone \u4e0b\u6765\u7684\u6e90\u7801\u5220\u9664 .git \u6216 .svn \u76ee\u5f55\u5220\u9664\uff0c\u7136\u540e\u538b\u7f29\u6210 lua-1.5.1.tar.gz \u6587\u4ef6\uff0c\u5e76\u590d\u5236\u5230 dl\/ \u76ee\u5f55\u4e0b\u3002<\/li>\n<li>\u5728\u7f16\u8bd1\u524d\u6bb5\uff0c\u5c06 dl\/ \u76ee\u5f55\u4e0b\u7684 lua-1.5.1.tar.gz \u6587\u4ef6\u89e3\u538b\u5230 build_dir\/target-mips_&lt;board&gt;\/ \u76ee\u5f55\u4e0b\u3002<\/li>\n<li>\u8fdb\u5165 build_dir\/target-mips_&lt;board&gt;\/lua-1.5.1\/<\/li>\n<li>.\/configure\uff0cmake\uff0cmake install\u3002<\/li>\n<li>make install \u4f1a\u5c06\u751f\u6210\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u5b89\u88c5\u5230 build_dir\/target-mips_&lt;board&gt;\/lua-1.5.1\/ipkg-ar71xx\/ \u76ee\u5f55\u4e0b\u3002<\/li>\n<li>\u6700\u540e\u5c06 build_dir\/target-mips_&lt;board&gt;\/lua-1.5.1\/ipkg-ar71xx\/ \u6253\u6210\u5305\u6210lua-5.1.5-1_ar71xx.ipk\uff0c\u5e76\u590d\u5236\u5230 bin\/ar71xx\/packages\/base\/ \u3002\u51fa\u5904\uff1ahttps:\/\/my.oschina.net\/hevakelcj\/blog\/417402<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>1.\u76ee\u5f55\u4ecb\u7ecd \u6709\u51e0\u4e2a\u91cd\u8981\u76ee\u5f55\uff1apackage, target, build_dir, staging_dir, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-1192","post","type-post","status-publish","format-standard","hentry","category-linux-c"],"_links":{"self":[{"href":"https:\/\/www.kumouse.com\/index.php?rest_route=\/wp\/v2\/posts\/1192","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kumouse.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kumouse.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kumouse.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kumouse.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1192"}],"version-history":[{"count":2,"href":"https:\/\/www.kumouse.com\/index.php?rest_route=\/wp\/v2\/posts\/1192\/revisions"}],"predecessor-version":[{"id":1194,"href":"https:\/\/www.kumouse.com\/index.php?rest_route=\/wp\/v2\/posts\/1192\/revisions\/1194"}],"wp:attachment":[{"href":"https:\/\/www.kumouse.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kumouse.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kumouse.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}