2014-02-27

OpenBlocks における開発環境構築手順について [debian Wheezy][AX3][A7][A6]

Debian Wheezy環境でのソフトウェア評価記事に関してのインデックスを右のタグから飛べるソフトウェア動作検証のページにまとめました。

また、当ブログでは、OpenBlocksの開発環境はすでにあるものとして記事を書いてきましたが、DPモデルではない、SSDオプションとの組み合わせや、USBおよびeSATA(AX3モデルのみ)の外付けストレージデバイスを使用した場合の環境構築方法にいての一連の手順を、本記事にまとめて上記ページよりリンクしておきます。

1. ストレージデバイスの用意


本体内蔵のSSDオプションを用意するか、もしくは、USB,eSATA(AX3のみ)ポートにストレージデバイスを接続します。

<内蔵ハーフサイズSSD>

<内蔵2.5inchSSD>

 <外付けUSBデバイス例>

2.パーティションの設定とフォーマット


fdiskによりパーティションを作成します。

# fdisk /dev/sda
Using /dev/sda
Command (m for help): o
Command (m for help): n
Partition type
   e   extended
   p   primary partition (1-4)
p
First cylinder  (default 0cyl): (Enter key)
Last cylinder or +size or +sizeMB or +sizeKB  (default 991cyl): (Enter key)
Warning: You requested a partition from 0cyl to 991cyl.
The closest location we can manage is 0cyl to 990cyl.  Is this still acceptable to you?
   y   Yes
   n   No
y
Command (m for help): w
Information: Don't forget to update /etc/fstab, if necessary.

Writing all changes to /dev/sda.

mke2fsによりフォーマットを行い、ボリュームラベルとしてDEBIANを設定します。

# mke2fs -j -L DEBIAN /dev/sda1
mke2fs 1.42.5 (29-Jul-2012)
Filesystem label=DEBIAN
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
991232 inodes, 3964030 blocks
198201 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4060086272
121 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done.

2. 起動後の確認


以下の例では、内蔵のSSD(/dev/sda)が接続された状態で、外付けのUSBメモリにボリュームラベルとしてDEBIANを設定していますので、/dev/sdb1が使用されています。

# mount
/dev/root on / type ext2 (rw,relatime,errors=continue,user_xattr,acl)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=51132k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev type tmpfs (rw,relatime,size=10240k,mode=755)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=102260k)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
/dev/sdb1 on /.rw type ext3 (rw,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered)
aufs on /etc type aufs (rw,relatime,si=57e9d387)
aufs on /bin type aufs (rw,relatime,si=57e9d987)
aufs on /home type aufs (rw,relatime,si=57e9de87)
aufs on /lib type aufs (rw,relatime,si=57e9df87)
aufs on /sbin type aufs (rw,relatime,si=57e9dc87)
aufs on /usr type aufs (rw,relatime,si=57e9d287)
aufs on /var type aufs (rw,relatime,si=57e9d687)
aufs on /root type aufs (rw,relatime,si=57e9d087)
aufs on /opt type aufs (rw,relatime,si=57e9d887)
aufs on /srv type aufs (rw,relatime,si=57e9db87)
aufs on /media type aufs (rw,relatime,si=45009587)

3. 環境の設定


一連の手順はユーザマニュアルに記載があります。
私がいつも行う手順は以下の通りです。

ネットワークの設定

# vi /etc/network/interfaces

DHCPによりアドレスを取得する場合

auto eth0
iface eth0 inet dhcp

固定アドレスを割り振る場合 ( アドレスはお使いのものに置き換えます)

auto eth0
iface eth0 inet static
     address 192.168.254.254
     network 192.168.254.0
     netmask 255.255.255.0
     broadcast 192.168.254.255
     gateway 192.168.254.1

設定後再起動するか、ifdown / ifup コマンドでネットワークインターフェースの設定を反映させます。

インストール可能なパッケージ情報の更新


#aptitude update


インストール済みパッケージの更新


#aptitude safe-upgrade

インストール済みのdebianの各種パッケージおよび、本体ファームウェアについても最新のものがリリースされていれば更新されます。

タイムゾーンの設定

# dpkg-reconfigure tzdata

ロケールの設定

# aptitude install locales
# dpkg-reconfigure locales

特にポリシーがないならば、ja_JP.UTF-8で設定しておくことをお勧めします。
また、日本語の扱いなどが必要ないならば、デフォルトのままでも構いません。

4. 開発環境の構築


 よく利用されるツール一式をインストールします。

# tasksel install standard

開発ツール一式をインストールします。(debianのパッケージ開発ツール)

# aptitude install build-essential

Webアプリケーションなどを構築する際のLAMP環境、Ruby環境などについては別途必要なものをインストールしてください。
いくつかのパッケージのインストール手順に関しては、本blogでも事前準備として記述していますので、参考にして下さい。

5. さいごに


今回は、ディスク共有モードでの一連の開発を行うための環境構築について説明をしました。
RAMディスクモードにおいて、ファームウェアや各種ランタイムプログラムを再構築する手順に関しては、以下の記事において解説しています。

OpenBlocks ファームウェア作成ガイドをgithubにて公開しました


0 件のコメント:

コメントを投稿