{"id":280,"date":"2019-09-12T11:27:44","date_gmt":"2019-09-12T03:27:44","guid":{"rendered":"http:\/\/iqotom.com\/?p=280"},"modified":"2019-10-17T15:10:15","modified_gmt":"2019-10-17T07:10:15","slug":"openwrt-x86-%e5%88%86%e5%8c%ba%e6%89%a9%e5%ae%b9","status":"publish","type":"post","link":"https:\/\/iqotom.cn\/?p=280","title":{"rendered":"X86 OpenWrt \u5206\u533a\u6269\u5bb9"},"content":{"rendered":"\n<p>\u4e4b\u524d\u5b89\u88c5\u4e86OpenWrt\u8def\u7531\u7cfb\u7edf\uff0c\u7ed3\u679c\u67e5\u770b\u7cfb\u7edf\u53ea\u7528\u4e86\u4e24\u767e\u591aM\uff0c\u6211\u7684\u786c\u76d8\u662f8G\uff0c\u592a\u6d6a\u8d39\u7a7a\u95f4\u4e86\uff0c\u800c\u4e14\u5982\u679c\u957f\u65f6\u95f4\u5b9e\u7528\uff0c\u5b89\u88c5\u66f4\u591a\u7684\u8f6f\u4ef6\uff0c\u540e\u9762\u7a7a\u95f4\u53ef\u80fd\u4f1a\u4e0d\u591f\u7528\u3002<br>\u8fd9\u91cc\u6559\u5927\u5bb6\u600e\u4e48\u6269\u5bb9OpenWrt\u5206\u533a\uff0c\u5145\u5206\u5229\u7528\u78c1\u76d8\u7a7a\u95f4\u3002 <\/p>\n\n\n\n<p> ================================================================<br>\u300a<a href=\"http:\/\/iqotom.com\/?p=106\">OpenWrt X86 \u5b89\u88c5\u6559\u7a0b<\/a>\u300b<br>\u300a<a href=\"http:\/\/iqotom.com\/?p=253\">OpenWrt X86 \u7f16\u8bd1\u6559\u7a0b<\/a>\u300b<br>\u300a<a href=\"http:\/\/iqotom.com\/?p=280\">OpenWrt X86 \u5206\u533a\u6269\u5bb9<\/a>\u300b<br>================================================================ <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u67e5\u770b\u78c1\u76d8\u5206\u914d\u60c5\u51b5<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>root@OpenWrt:\/# df -h\nFilesystem                Size      Used Available Use% Mounted on\n\/dev\/root               252.0M     13.8M    233.0M   6% \/\ntmpfs                     1.9G      1.1M      1.9G   0% \/tmp\n\/dev\/sda1                15.7M      4.5M     10.9M  29% \/boot\n\/dev\/sda1                15.7M      4.5M     10.9M  29% \/boot\ntmpfs                   512.0K         0    512.0K   0% \/dev<\/code><\/pre>\n\n\n\n<p><strong> \u4f7f\u7528fdisk -l\u53d1\u73b0\u627e\u4e0d\u5230\u547d\u4ee4\uff0c\u8fd9\u91cc\u9700\u8981\u624b\u52a8\u5b89\u88c5\u4e0b <\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>opkg install fdisk<\/code><\/pre>\n\n\n\n<p><strong> \u5b89\u88c5\u540e\u6267\u884cfdisk -l\u67e5\u770b\u7a7a\u95f4\u5206\u914d\u60c5\u51b5 <\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@OpenWrt:\/# fdisk -l\nDisk \/dev\/sda: 14.9 GiB, 16013942784 bytes, 31277232 sectors\nUnits: sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 512 bytes\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\nDisklabel type: dos\nDisk identifier: 0x6ad5f5a9\n\nDevice     Boot Start    End Sectors  Size Id Type\n\/dev\/sda1  *      512  33279   32768   16M 83 Linux\n\/dev\/sda2       33792 558079  524288  256M 83 Linux<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"> \u5bf9\u7a7a\u95f2\u7a7a\u95f4\u8fdb\u884c\u5206\u533a <\/h3>\n\n\n\n<p> openwrt\u7684fdisk\u8c8c\u4f3c\u6ca1\u6709\u5206\u533a\u529f\u80fd\uff0c\u6ca1\u6709fdisk -n\u547d\u4ee4\uff0c\u67e5\u627e\u8d44\u6599\u540e\u53d1\u73b0\u53ef\u4ee5\u4f7f\u7528cfdisk\u5de5\u5177\u8fdb\u884c\u5206\u533a\uff0ccfdisk\u662f\u4e00\u4e2a\u57fa\u4e8ecurses\u7684\u7a0b\u5e8f\uff0c\u7528\u4e8e\u5206\u533a\u4efb\u4f55\u786c\u76d8\u9a71\u52a8\u5668<br> <code>opkg install cfdisk<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"850\" height=\"538\" src=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/09\/openwrt-x86-kuorong-00.png\" alt=\"\" class=\"wp-image-281\" srcset=\"http:\/\/iqotom.cn\/wp-content\/uploads\/2019\/09\/openwrt-x86-kuorong-00.png 850w, http:\/\/iqotom.cn\/wp-content\/uploads\/2019\/09\/openwrt-x86-kuorong-00-300x190.png 300w, http:\/\/iqotom.cn\/wp-content\/uploads\/2019\/09\/openwrt-x86-kuorong-00-768x486.png 768w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><figcaption>cfdisk<\/figcaption><\/figure>\n\n\n\n<p> <strong>\u5bf9\u7a7a\u95f2\u7a7a\u95f4\u8fdb\u884c\u5206\u533a\uff0c\u9ed8\u8ba4\u5206\u533a\u7c7b\u578b\u4e3aLinux <\/strong><br> \u9009\u62e9Free space\u2014\u2014&gt;primary\u2014\u2014&gt;Write\u2014\u2014&gt;yes <br> fdisk -l\u67e5\u770b\u5df2\u7ecf\u5206\u597d\u533a\u4e86 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Device     Boot  Start      End  Sectors  Size Id Type\n\/dev\/sda1  *       512    33279    32768   16M 83 Linux\n\/dev\/sda2        33792   558079   524288  256M 83 Linux\n\/dev\/sda3       559104 31277231 30718128 14.7G 83 Linux<\/code><\/pre>\n\n\n\n<p><strong> \u5148\u5bf9\u5206\u533a\u8fdb\u884c\u683c\u5f0f\u5316\uff0c\u7136\u540e\u8fdb\u884c\u6302\u8f7d <\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkfs.ext4 \/dev\/sda3\nmkdir opt\nmount -o rw \/dev\/sda3 opt\/\nroot@OpenWrt:\/# df -h\nFilesystem                Size      Used Available Use% Mounted on\n\/dev\/root               252.0M     14.2M    232.7M   6% \/\ntmpfs                     1.9G      1.1M      1.9G   0% \/tmp\n\/dev\/sda1                15.7M      4.5M     10.9M  29% \/boot\n\/dev\/sda1                15.7M      4.5M     10.9M  29% \/boot\ntmpfs                   512.0K         0    512.0K   0% \/dev\n\/dev\/sda3                14.4G     40.0M     13.6G   0% \/opt<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"> \u8c03\u6574\u5b89\u88c5\u76ee\u5f55 <\/h3>\n\n\n\n<p> \u5b89\u88c5\u76ee\u5f55\u5728\u914d\u7f6e\u6587\u4ef6\/etc\/opkg.conf\u4e2d\u5b9a\u4e49\u3002\u914d\u7f6e\u6587\u4ef6\u4e2d\u76ee\u7684\u5730\u5740\u683c\u5f0f\u662f\u4ee5dest\u5f00\u5934\uff0c\u7d27\u8ddf\u7740\u76ee\u7684\u5730\u5740\u7684\u540d\u79f0\uff0c\u6700\u540e\u662f\u76ee\u5f55\u8def\u5f84\uff0c\u5fc5\u987b\u4ece\u8ddf\u76ee\u5f55\u5f00\u59cb\u3002 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dest root \/\ndest ram \/tmp\ndest soft \/opt<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5\u76ee\u5f55\u5b9a\u4e49\u540e\uff0c\u76ee\u7684\u5730\u5740\u540d\u79f0\u5c31\u53ef\u4ee5\u5728\u5b89\u88c5\u547d\u4ee4\u4e2d\u5f15\u7528\u4e86\u3002\u4f8b\u5982\u201c-d ram\u201d\u8868\u793a\u5c06\u8f6f\u4ef6\u5b89\u88c5\u5230\u4e34\u65f6\u76ee\u5f55\/tmp\u4e0b\u3002<br> \u5b89\u88c5\u547d\u4ee4\u7c7b\u4f3c\u5982\u4e0b\u683c\u5f0f\uff1a <br><strong> opkg install &lt;pkg&gt; -d &lt;\u76ee\u7684\u5730\u5740&gt; <\/strong><br> \u4f8b\u5982\uff1a <br> \u5148\u5378\u8f7d\u4e4b\u524d\u5b89\u88c5\u7684fdisk\uff0c<code>opkg remove fdisk <\/code><br> \u91cd\u65b0\u5b89\u88c5\u5230opt\u76ee\u5f55\uff0c<code>opkg install fdisk -d soft <\/code><br> \u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u5982\u679c\u6267\u884cfdisk\uff0c\u5e76\u4e0d\u4f1a\u627e\u5230\u8be5\u547d\u4ee4\uff0c\u8fd8\u9700\u8981\u8bbe\u7f6e\u73af\u5883\u53d8\u91cfPATH\uff0c\u7f16\u8bd1\u914d\u7f6e\u6587\u4ef6\/etc\/profile <br><code>export PATH=\"\/usr\/sbin:\/usr\/bin:\/sbin:\/bin:\/opt\/bin:\/opt\/sbin:\/opt\/usr\/sbin:\/opt\/usr\/bin\"<\/code><br><code>export LD_LIBRARY_PATH=\/opt\/lib:\/opt\/usr\/lib<\/code><\/p>\n\n\n\n<p> \u4fee\u6539\u540e\u4f7f\u7528\u6b63\u5e38 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@OpenWrt:\/# ls \/opt\/usr\/sbin\/\nfdisk    hostapd\nroot@OpenWrt:\/# fdisk -l\nDisk \/dev\/sda: 14.94 GiB, 16013942784 bytes, 31277232 sectors\nDisk model: KINGSTON RBU-SMS\nUnits: sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 512 bytes\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\nDisklabel type: dos\nDisk identifier: 0x7fd3e4c3\n\nDevice     Boot  Start      End  Sectors  Size Id Type\n\/dev\/sda1  *       512    33279    32768   16M 83 Linux\n\/dev\/sda2        33792   295935   262144  128M 83 Linux\n\/dev\/sda3       296960 31277231 30980272 14.8G 83 Linux<\/code><\/pre>\n\n\n\n<p> \u6709\u4e9b\u8f6f\u4ef6\u5b89\u88c5\u5305\u4f1a\u5728Init.d\u751f\u6210\u542f\u52a8\u811a\u672c\uff0c\u6bd4\u5982openvpn\uff0c\u8fd9\u65f6\u5c31\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u542f\u52a8\u8f6f\u8fde\u63a5\uff1b\u4f8b\u5982\uff1a <br><code>ln -s \/opt\/etc\/init.d\/openvpn \/etc\/init.d\/openvpn<\/code><\/p>\n\n\n\n<p> \u8bb8\u591a\u8f6f\u4ef6\u5305\u5728\u81ea\u5b9a\u4e49\u7684\u4f4d\u7f6e\u4e0d\u80fd\u542f\u52a8\u6216\u8005\u5373\u4f7f\u542f\u52a8\u4e5f\u4e0d\u80fd\u6210\u529f\u6267\u884c\uff0c\u56e0\u4e3a\u5b83\u5728\u9ed8\u8ba4\u4f4d\u7f6e\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\uff0c\u56e0\u6b64\u9700\u8981\u5728\u53c2\u6570\u4e2d\u5236\u5b9a\u914d\u7f6e\u6587\u4ef6\u4f4d\u7f6e\uff0c\u5426\u5219\u4f1a\u56e0\u4e0d\u80fd\u627e\u5230\u5fc5\u987b\u7684\u914d\u7f6e\u6587\u4ef6\u800c\u51fa\u9519\uff1b<br>\u8fd8\u6709\u4e9b\u8f6f\u4ef6\u5305\u5728\u66f4\u6539\u4e86\u76ee\u5f55\u540e\u9700\u8981\u989d\u5916\u7684\u8f6f\u8fde\u63a5\u6216\u8005\u4fee\u6539\u52a8\u6001\u94fe\u63a5\u5e93\u6587\u4ef6\u540d\u540e\u7f00\u624d\u80fd\u4f7f\u7528\uff0c\u5e76\u4e14Luci\u914d\u7f6e\u9875\u9762\u53ea\u4f1a\u663e\u793a\u5b89\u88c5\u5728\u6839\u76ee\u5f55\u7684\u8f6f\u4ef6\u5305\uff0c\u5e0c\u671b\u540e\u9762\u53ef\u4ee5\u4f18\u5316\uff0c\u5c06\u6307\u5b9a\u7684\u5b89\u88c5\u76ee\u5f55\u52a0\u5165\u7a7a\u95f2\u7a7a\u95f4\u3002 <\/p>\n","protected":false},"excerpt":{"rendered":"<p>X86 OpenWrt \u5206\u533a\u6269\u5bb9\uff0c\u4fee\u6539\u8f6f\u4ef6\u5b89\u88c5\u8def\u5f84\uff0c\u5145\u5206\u5408\u7406\u5229\u7528\u78c1\u76d8\u7a7a\u95f4\u3002<\/p>\n","protected":false},"author":1,"featured_media":284,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[11,13],"_links":{"self":[{"href":"https:\/\/iqotom.cn\/index.php?rest_route=\/wp\/v2\/posts\/280"}],"collection":[{"href":"https:\/\/iqotom.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iqotom.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iqotom.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iqotom.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=280"}],"version-history":[{"count":9,"href":"https:\/\/iqotom.cn\/index.php?rest_route=\/wp\/v2\/posts\/280\/revisions"}],"predecessor-version":[{"id":917,"href":"https:\/\/iqotom.cn\/index.php?rest_route=\/wp\/v2\/posts\/280\/revisions\/917"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/iqotom.cn\/index.php?rest_route=\/wp\/v2\/media\/284"}],"wp:attachment":[{"href":"https:\/\/iqotom.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iqotom.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iqotom.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}