Armadillo G3Lでのtunデバイス有効化手順

<h1 id="__asciidoctor-preview-436__">tunデバイス有効化手順</h1>
<div id="toc" class="toc">
<div id="toctitle">目次</div>
<ul class="sectlevel1">
<li><a href="#__">1. 事前準備</a>
<ul class="sectlevel2">
<li><a href="#_atde">1.1. ATDEにログイン</a></li>
<li><a href="#___2">1.2. 資源のダウンロード</a></li>
</ul>
</li>
<li><a href="#___3">2. カーネルコンフィギュレーション</a></li>
<li><a href="#___4">3. ビルド</a></li>
<li><a href="#___5">4. カーネルとデバイスツリーの差し替え</a></li>
</ul>
</div>
<div class="sect1">
<h2 id="__"><a class="link" href="#__">1. 事前準備</a></h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_atde"><a class="link" href="#_atde">1.1. ATDEにログイン</a></h3>

</div>
<div class="sect2">
<h3 id="___2"><a class="link" href="#___2">1.2. 資源のダウンロード</a></h3>
<div id="__asciidoctor-preview-608__" class="listingblock">
<div class="content">
<pre class="highlights editor-colors lang-bash"><div class="line"><span class="syntax--source syntax--shell"><span>$ wget https://armadillo.atmark-techno.com/files/downloads/armadillo-iot-g3l/source/linux-3.14-x1-at20.tar.gz</span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>$ wget https://armadillo.atmark-techno.com/files/downloads/armadillo-iot-g3l/source/initramfs_x1-v1.1.0.cpio.gz</span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>$ wget https://armadillo.atmark-techno.com/files/downloads/armadillo-iot-g3l/image/u-boot-x1-sd-at13.bin</span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span> </span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>$ wget https://armadillo.atmark-techno.com/files/downloads/armadillo-iot-g3l/debian/debian-jessie-armhf_aiotg3l_20180131.tar.gz</span></span>
</div></pre>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="___3"><a class="link" href="#___3">2. カーネルコンフィギュレーション</a></h2>
<div class="sectionbody">
<div id="__asciidoctor-preview-662__" class="listingblock">
<div class="content">
<pre class="highlights editor-colors lang-bash"><div class="line"><span class="syntax--source syntax--shell"><span class="syntax--comment syntax--line syntax--number-sign syntax--shell"><span class="syntax--punctuation syntax--definition syntax--comment syntax--shell"><span>#</span></span><span> カーネルの展開</span></span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>$ tar xf linux</span><span class="syntax--keyword syntax--operator syntax--glob syntax--shell"><span>*</span></span><span>tar.gz</span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>$ </span><span class="syntax--support syntax--function syntax--builtin syntax--shell"><span>cd</span></span><span> linux-</span><span class="syntax--keyword syntax--operator syntax--glob syntax--shell"><span>*</span></span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span> </span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span class="syntax--comment syntax--line syntax--number-sign syntax--shell"><span class="syntax--punctuation syntax--definition syntax--comment syntax--shell"><span>#</span></span><span> initramfsアーカイブへのシンボリックリンク作成</span></span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>$ ln -s ../initramfs_x1-</span><span class="syntax--keyword syntax--operator syntax--glob syntax--shell"><span>*</span></span><span>.cpio.gz initramfs_x1.cpio.gz</span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span> </span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span class="syntax--comment syntax--line syntax--number-sign syntax--shell"><span class="syntax--punctuation syntax--definition syntax--comment syntax--shell"><span>#</span></span><span> コンフィグレーション</span></span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>$ make ARCH=arm x1_defconfig</span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>$ make ARCH=arm menuconfig</span></span>
</div></pre>
</div>
</div>
<div id="__asciidoctor-preview-668__" class="imageblock">
<div class="content">
<img src="C:\work\download\as\Armadilloモデムリセット仕様\image\kernel_config.png?atomcache=1521474969218" alt="kernel config.png">
</div>
</div>
<div id="__asciidoctor-preview-680__" class="listingblock">
<div class="content">
<pre class="highlights editor-colors lang-bash"><div class="line"><span class="syntax--source syntax--shell"><span class="syntax--comment syntax--line syntax--number-sign syntax--shell"><span class="syntax--punctuation syntax--definition syntax--comment syntax--shell"><span>#</span></span><span> コンフィギュレーションの反映を確認</span></span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>※ =yになっていることを確認</span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>grep CONFIG_TUN .config</span></span>
</div></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="___4"><a class="link" href="#___4">3. ビルド</a></h2>
<div class="sectionbody">
<div id="__asciidoctor-preview-708__" class="listingblock">
<div class="content">
<pre class="highlights editor-colors lang-bash"><div class="line"><span class="syntax--source syntax--shell"><span>$ make CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm</span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>※ 20分ぐらい待機</span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LOADADDR=0x80008000 uImage</span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span> </span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>$ ls -l arch/arm/boot/uImage</span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>$ ls -l arch/arm/boot/dts/armadillo_iotg_g3l.dtb</span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span> </span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>※ ファイルの作成を確認したら、上記2ファイルをATDEからArmadilloに移動させる</span></span>
</div></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="___5"><a class="link" href="#___5">4. カーネルとデバイスツリーの差し替え</a></h2>
<div class="sectionbody">
<div id="__asciidoctor-preview-764__" class="listingblock">
<div class="content">
<pre class="highlights editor-colors lang-bash"><div class="line"><span class="syntax--source syntax--shell"><span class="syntax--comment syntax--line syntax--number-sign syntax--shell"><span class="syntax--punctuation syntax--definition syntax--comment syntax--shell"><span>#</span></span><span> カーネルとデバイスツリーの差し替え</span></span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>$ mount -t vfat /dev/mmcblk2p1 /mnt</span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>$ cp uImage /mnt/uImage</span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>$ cp armadillo_iotg_g3l.dtb /mnt/armadillo_iotg_g3l.dtb</span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>$ umount /mnt</span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>$ reboot</span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span> </span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span class="syntax--comment syntax--line syntax--number-sign syntax--shell"><span class="syntax--punctuation syntax--definition syntax--comment syntax--shell"><span>#</span></span><span> 結果確認</span></span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>※ =yになっていることを確認</span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>$ zcat /proc/config.gz </span><span class="syntax--keyword syntax--operator syntax--pipe syntax--shell"><span>|</span></span><span> grep </span><span class="syntax--string syntax--quoted syntax--double syntax--shell"><span class="syntax--punctuation syntax--definition syntax--string syntax--begin syntax--shell"><span>"</span></span><span>CONFIG_TUN=</span><span class="syntax--punctuation syntax--definition syntax--string syntax--end syntax--shell"><span>"</span></span></span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span> </span></span>
</div><div class="line"><span class="syntax--source syntax--shell"><span>$ ls -l /dev/net/tun</span></span>
</div></pre>
</div>
</div>
<div id="__asciidoctor-preview-768__" class="paragraph">
<p><a href="https://manual.atmark-techno.com/armadillo-iot-g3/armadillo-iotg-g3_product_manual_ja-1.4.0/ch22.html#sct.howto-customized-image" class="bare">https://manual.atmark-techno.com/armadillo-iot-g3/armadillo-iotg-g3_product_manual_ja-1.4.0/ch22.html#sct.howto-customized-image</a></p>
</div>
</div>
</div>![kernel_config.png](https://qiita-image-store.s3.amazonaws.com/0/105362/752549b8-a614-ad55-f12a-47065e85e92c.png)