{"id":212,"date":"2022-01-09T18:07:44","date_gmt":"2022-01-09T10:07:44","guid":{"rendered":"https:\/\/dailyrenewblog.com\/?p=212"},"modified":"2022-01-09T18:07:44","modified_gmt":"2022-01-09T10:07:44","slug":"wsl2%e7%bc%96%e8%af%91openwrt%e5%9b%ba%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/dailyrenewblog.com\/?p=212","title":{"rendered":"Windows\u4e0b\u4f7f\u7528WSL2\u7f16\u8bd1openwrt\u56fa\u4ef6\uff08lean\uff09"},"content":{"rendered":"\n<p>1.\u5b89\u88c5WSL<\/p>\n\n\n\n<p>windows\u7cfb\u7edf\u542f\u7528WSL\u529f\u80fd(Home edition\u65e0\u6cd5\u542f\u7528)<\/p>\n\n\n\n<p>windows10\uff08\u7248\u672c\u53f7\u81f3\u5c111903\uff09\u6216windows11\u7cfb\u7edf\uff0c\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u8fd0\u884cpowershell\uff0c\u8f93\u5165<\/p>\n\n\n\n<p><code>dism.exe \/online \/enable-feature \/featurename:Microsoft-Windows-Subsystem-Linux \/all \/norestart<\/code><\/p>\n\n\n\n<p><code>dism.exe \/online \/enable-feature \/featurename:VirtualMachinePlatform \/all \/norestart<\/code><\/p>\n\n\n\n<p>\u5b89\u88c5wsl<\/p>\n\n\n\n<p><code>wsl&nbsp;--install -d Ubuntu<\/code><\/p>\n\n\n\n<p>\u6309WIN\u952e+R\uff0c\u8fd0\u884cwsl.exe,\u542f\u52a8wsl\uff0c\u8bbe\u7f6e\u7528\u6237\u540d\u4e0e\u5bc6\u7801,\u7f16\u8bd1\u65f6\u4e0d\u8981\u4f7f\u7528root\u7528\u6237<\/p>\n\n\n\n<p>\u4e3awsl\u914d\u7f6e\u56fd\u5185apt\u6e90<\/p>\n\n\n\n<p><code>sudo echo &gt; \/etc\/apt\/sources.list<\/code><\/p>\n\n\n\n<p><code>sudo cat &lt;&lt; EOF &gt; \/etc\/apt\/sources.list<br>deb http:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\/ focal main restricted universe multiverse<br>deb-src http:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\/ focal main restricted universe multiverse<br>deb http:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\/ focal-updates main restricted universe multiverse<br>deb-src http:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\/ focal-updates main restricted universe multiverse<br>deb http:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\/ focal-backports main restricted universe multiverse<br>deb-src http:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\/ focal-backports main restricted universe multiverse<br>deb http:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\/ focal-security main restricted universe multiverse<br>deb-src http:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\/ focal-security main restricted universe multiverse <\/code><\/p>\n\n\n\n<p><code>EOF<\/code><\/p>\n\n\n\n<p>2.\u51c6\u5907\u73af\u5883<\/p>\n\n\n\n<p><code>sudo apt update &amp;&amp; sudo apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib antlr3 gperf wget curl swig rsync<\/code><\/p>\n\n\n\n<p>\u4ece\u4e0b\u4e00\u6b65\u5fc5\u987b\u5f00\u59cb\u786e\u4fdd\u7f51\u7edc\u8bbf\u95eegithub.com\u7b49\u7f51\u7ad9\u65e0\u969c\u788d<\/p>\n\n\n\n<p>\u914d\u7f6ewsl\u7cfb\u7edf\u8d70http\u4ee3\u7406<\/p>\n\n\n\n<p><code>export ALL_PROXY=http:\/\/<strong><em>127.0.0.1<\/em><\/strong>:<strong><em>3128<\/em><\/strong> &amp;&amp; source ~\/.bashrc <\/code><\/p>\n\n\n\n<p>\u5176\u4e2d127.0.0.1\u4e0e3128\u7aef\u53e3\u6362\u6210\u4f60\u81ea\u5df1\u5b9e\u9645\u4f7f\u7528\u7684<\/p>\n\n\n\n<p>\u8bbe\u7f6e\u597dgo\u6a21\u5757\u4ee3\u7406<\/p>\n\n\n\n<p><code>export GOPROXY=https:\/\/goproxy.io,direct &amp;&amp; source ~\/.bashrc <\/code><\/p>\n\n\n\n<p><code>cd ~\/<\/code>\u8fdb\u5165\u4f7f\u7528\u8005\u7528\u6237\u76ee\u5f55<\/p>\n\n\n\n<p>\u4f7f\u7528&nbsp;<code>git clone https:\/\/github.com\/coolsnowwolf\/lede<\/code>&nbsp;\u547d\u4ee4\u4e0b\u8f7d\u597d\u6e90\u4ee3\u7801\uff0c\u7136\u540e&nbsp;<code>cd lede<\/code>&nbsp;\u8fdb\u5165\u76ee\u5f55<\/p>\n\n\n\n<p>\u6dfb\u52a0\u4e00\u4e9b<strong>\u5fc5\u987b<\/strong>\u7684\u8f6f\u4ef6\u6e90\u7801<\/p>\n\n\n\n<p><code>sed -i '$a src-git kenzo https:\/\/github.com\/kenzok8\/openwrt-packages' feeds.conf.default &amp;&amp; sed -i '$a src-git small https:\/\/github.com\/kenzok8\/small' feeds.conf.default<\/code><\/p>\n\n\n\n<p><code>.\/scripts\/feeds update -a &amp;&amp; .\/scripts\/feeds install -a<\/code><\/p>\n\n\n\n<p>3.\u9996\u6b21\u7f16\u8bd1<\/p>\n\n\n\n<p><code>make menuconfig<\/code><\/p>\n\n\n\n<p>\u6b64\u65f6\u56fe\u5f62\u754c\u9762\u9009\u62e9\u7f16\u8bd1\u9009\u9879\uff0c\u9009\u62e9\u9700\u8981\u7684\u5e94\u7528\uff0c\u952e\u76d8\u4e0a\u4e0b\u79fb\u52a8\u5149\u6807\uff0c\u56de\u8f66\u8fdb\u5165\u83dc\u5355\uff0cesc\u8fd4\u56de\uff0cy\u9009\u62e9\uff0cn\u53bb\u9664\u9009\u62e9\u3002\u5982\u679c\u5237\u673a\u5230\u8def\u7531\u5668\u4e0a\u6ce8\u610f\u56fa\u4ef6\u5927\u5c0f\u9650\u5236<\/p>\n\n\n\n<p>(1)\u542f\u7528ipv6\u9700\u8981\u5728Extra packages\u4e2d\u9009\u62e9ipv6helper<\/p>\n\n\n\n<p>(2)\u542f\u7528samba4<\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<p>Extra packages\u91cc\u53d6\u6d88\u52fe\u9009autosamba.<\/p>\n\n\n\n<p>LuCI &#8211; Applications\u91cc\u53d6\u6d88\u52fe\u9009luci-app-samba\uff0c\u52fe\u9009luci-app-samba4.<\/p>\n\n\n\n<p>Network\u91cc\u53d6\u6d88samba36-server.<\/p>\n\n\n\n<p>(3) \u5982\u679c\u9700\u8981cloudflare ddns\u670d\u52a1<\/p>\n<\/div><\/div>\n\n\n\n<p>Network&#8211;IP Addresses and Names\u91cc\u52fe\u9009ddns-scripts_cloudflare.com-v4<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>SAVE\u4fdd\u5b58.config\u6587\u4ef6\uff0c\u8fde\u6309esc\u9000\u51fa\u7f16\u8bd1\u9009\u9879\u754c\u9762<\/p>\n\n\n\n<p>\u8f93\u5165<code>source \/etc\/environment<\/code>\uff0c\u8fd9\u4e00\u6b65\u5f88\u91cd\u8981\uff0c\u4e0d\u8f93\u8fd9\u6bb5\u4ee3\u7801\u80af\u5b9a\u4f1a\u62a5\u9519\u3002<\/p>\n\n\n\n<p><code>make -j8 download V=s <\/code>\u4e0b\u8f7ddl\u5e93<\/p>\n\n\n\n<p><code>make -j1 V=s<\/code>\uff08-j1 \u540e\u9762\u662f\u7ebf\u7a0b\u6570\u3002\u7b2c\u4e00\u6b21\u7f16\u8bd1\u63a8\u8350\u7528\u5355\u7ebf\u7a0b\uff09\u5373\u53ef\u5f00\u59cb\u7f16\u8bd1\u4f60\u8981\u7684\u56fa\u4ef6 <\/p>\n\n\n\n<p>\u7f16\u8bd1\u5b8c\u6bd5\u540e\uff0c<code>cd ~\/lede\/bin\/targets<\/code> \uff0c\u8be5\u76ee\u5f55\u5b58\u653e\u7f16\u8bd1\u597d\u7684\u56fa\u4ef6\uff0c\u5c06sysupgrade \u56fa\u4ef6\u7528breed\u5199\u5165\u8def\u7531\u5668\uff0c\u5982\u679c\u8def\u7531\u5668\u56fa\u4ef6\u5927\u5c0f\u8d85\u8fc7\u9650\u5236\uff0c\u5c06\u6ca1\u6709sysupgrade\u56fa\u4ef6<\/p>\n\n\n\n<p>4.\u540e\u7eed\u518d\u6b21\u7f16\u8bd1<\/p>\n\n\n\n<p> <code>cd ~\/lede<\/code> <\/p>\n\n\n\n<p><code>git pull<\/code><\/p>\n\n\n\n<p><code>.\/scripts\/feeds update -a &amp;&amp; .\/scripts\/feeds install -a<\/code> <\/p>\n\n\n\n<p>\u6e05\u9664\u65e7\u7684\u7f16\u8bd1\u4ea7\u7269\uff08\u53ef\u9009\uff09,\u5728\u6e90\u7801\u6709\u5927\u89c4\u6a21\u66f4\u65b0\u6216\u8005\u5185\u6838\u66f4\u65b0\u540e\u6267\u884c\uff0c\u4ee5\u4fdd\u8bc1\u7f16\u8bd1\u8d28\u91cf\u3002\u6b64\u64cd\u4f5c\u4f1a\u5220\u9664<code>\/bin<\/code>\u548c<code>\/build_dir<\/code>\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u3002<\/p>\n\n\n\n<p><code>make clean<\/code><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u6e05\u9664\u65e7\u7684\u7f16\u8bd1\u4ea7\u7269\u3001\u4ea4\u53c9\u7f16\u8bd1\u5de5\u5177\u53ca\u5de5\u5177\u94fe\u7b49\u76ee\u5f55\uff08\u53ef\u9009\uff09,\u66f4\u6362\u67b6\u6784\u7f16\u8bd1\u524d\u5fc5\u987b\u6267\u884c\u3002\u6b64\u64cd\u4f5c\u4f1a\u5220\u9664<code>\/bin<\/code>\u548c<code>\/build_dir<\/code>\u76ee\u5f55\u7684\u4e2d\u7684\u6587\u4ef6(<code>make clean<\/code>)\u4ee5\u53ca<code>\/staging_dir<\/code>\u3001<code>\/toolchain<\/code>\u3001<code>\/tmp<\/code>\u548c<code>\/logs<\/code>\u4e2d\u7684\u6587\u4ef6\u3002<\/p>\n\n\n\n<p><code>make dirclean<\/code><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u6e05\u9664\u4e34\u65f6\u6587\u4ef6,\u5220\u9664\u6267\u884c<code>make menuconfig<\/code>\u540e\u4ea7\u751f\u7684\u4e00\u4e9b\u4e34\u65f6\u6587\u4ef6\uff0c\u5305\u62ec\u4e00\u4e9b\u8f6f\u4ef6\u5305\u7684\u68c0\u7d22\u4fe1\u606f\uff0c\u5220\u9664\u540e\u4f1a\u91cd\u65b0\u52a0\u8f7d<code>package<\/code>\u76ee\u5f55\u4e0b\u7684\u8f6f\u4ef6\u5305\u3002\u82e5\u4e0d\u5220\u9664\u4f1a\u5bfc\u81f4\u4e00\u4e9b\u65b0\u52a0\u5165\u7684\u8f6f\u4ef6\u5305\u4e0d\u663e\u793a\u3002<\/p>\n\n\n\n<p><code>rm -rf tmp<\/code><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u5220\u9664\u7f16\u8bd1\u914d\u7f6e\u6587\u4ef6,\u5728\u4e0d\u5220\u9664\u7684\u60c5\u51b5\u4e0b\u5982\u679c\u53d6\u6d88\u9009\u62e9\u67d0\u4e9b\u7ec4\u4ef6\u5b83\u7684\u4f9d\u8d56\u7ec4\u4ef6\u4e0d\u4f1a\u81ea\u52a8\u53d6\u6d88\uff0c\u6240\u4ee5\u5bf9\u4e8e\u9700\u8981\u8c03\u6574\u7ec4\u4ef6\u7684\u60c5\u51b5\u4e0b\u5efa\u8bae\u5220\u9664\u3002<\/p>\n\n\n\n<p><code>rm -f .config<\/code><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u8c03\u6574 Open\u00adWrt \u7cfb\u7edf\u7ec4\u4ef6<\/p>\n\n\n\n<p><code>make menuconfig<\/code><\/p>\n\n\n\n<p>\u4e0d\u6253\u7b97\u8c03\u6574\u7ec4\u4ef6\u5219\u8f93\u5165make defconfig<\/p>\n\n\n\n<p>\u9884\u4e0b\u8f7d\u7f16\u8bd1\u6240\u9700\u7684\u8f6f\u4ef6\u5305<\/p>\n\n\n\n<p><code>make download -j8 V=s<\/code><\/p>\n\n\n\n<p>\u5f00\u59cb\u7f16\u8bd1<\/p>\n\n\n\n<p><code>make -j$(nproc) || make -j1 || make -j1 V=s<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.\u5b89\u88c5WSL windows\u7cfb\u7edf\u542f\u7528WSL\u529f\u80fd(Home edition\u65e0\u6cd5\u542f\u7528) windows10\uff08\u7248\u672c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-212","post","type-post","status-publish","format-standard","hentry","category-openwrt"],"_links":{"self":[{"href":"https:\/\/dailyrenewblog.com\/index.php?rest_route=\/wp\/v2\/posts\/212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dailyrenewblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dailyrenewblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dailyrenewblog.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dailyrenewblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=212"}],"version-history":[{"count":0,"href":"https:\/\/dailyrenewblog.com\/index.php?rest_route=\/wp\/v2\/posts\/212\/revisions"}],"wp:attachment":[{"href":"https:\/\/dailyrenewblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dailyrenewblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dailyrenewblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}