2013年10月28日月曜日

BeagleBone BlackでUbuntu 13.10へアップグレード

 FreeBSDのインストールが進まない中で、今はUbuntuを動かしているんだが、13.10がリリースされたようなので、アップグレードしてみた。


1.$ sudo apt-get install update-manager-core
 

2./etc/update-manager/release-upgradesを編集し、Prompt=normalを設定します 
 
3.$ sudo do-release-upgrade
 
wikiで調べたら、これでいいみたい。
実際やってみた。実は2は忘れたんだが、問題なく出来たような気がする(笑)
ホントにいいのかとか、結構決断を迫られるが、まあ、実に簡単だった。

 時間はせいぜい1時間程度だった気がする。

 13.10のイメージをダウンロードして、新規インストールしたほうが早そうだが、ユーザー設定し直すのも面倒だ。べつに大した事に使っているわけじゃないけど。microSDがいつまで持つか耐久テスト中というのが、今のubuntuの役目だ。

2013年10月15日火曜日

VMWare Player のネットワークアダプタをブリッジで使う

 VMWareも5・6年くらい前は良く使っていたが、最近はほとんど使わなくなっていたが、BeagleBone BlackへOSを載せるために、LinuxやらFreeBSDをインストールして久々に使った。
 以前使っていたときは、250GBのHDDが主流の時代で、今は2TBの時代なんで、仮想マシンに割り当てる50GB程度の領域なんざ、屁でもなくなってしまった。

 さて、仮想ネットワークアダプタをNATで使うと、DHCPでIPアドレス振ってくれて便利だし、ホストPCからTeraTerm使ってsshで接続するには便利だが、タブレットからログインして寝転びながらとかしようとすると、ホストPCからポートフォワードとかしないといけない。sshの22番ポートだけなんでそんなに面倒ではないが、VMWare Playerだと簡単にできないのか、メニュー探したがなかった。まあググれば何とかなると思いつつ、使っていると、svnでFreeBSDの/usr/srcをチェックアウトすると、途中でハングすること数回。うちの環境じゃ、うまくいって1時間程度掛かるので、仮想マシンのHDDを最初からすべて割り当てるとかしてないと、途中でパケットを失うとかするのかなと思い、ブリッジにしてみようと試みた。

 そのときの試行錯誤から、備忘メモ。

 1.仮想マシンのネットワークアダプタをブリッジにして、物理ネットワーク接続の状態を複製もチェックを入れる。アダプタの設定で、ホストPCのネットワークアダプタを選びチェックを入れる。

 2.ホストPCの コントロール パネル\ネットワークとインターネット\ネットワーク接続画面で、1.で選んだアダプタのプロパティーでVMware Bridge Protocolにチェックを入れる。
 
 3. ネットワーク接続画面にはVMware Network Adapter VMnet1があるが、こちらのVMware Bridge Protocolにはチェックをいれなくても結構。これは、あくまでホストPCが仮想マシンとのネットワークにつながった仮想アダプタの設定と考えるべし。これを、仮想マシンのアダプタだと考えてしまうのは間違いである。
 でも、ブリッジの場合、 VMware Network Adapter VMnet1は空気みたいなもんで、プロパティのチェックマーク全部外しても、問題なかったw 便宜上そこにあるだけなんだろうな。NATの場合のVMnet8とは違うみたい。

 4.仮想マシン側は、仮想マシンのOS内で設定する。ホストPCがDHCPならばDHCPで、ホストPCが固定IPなら固定IPで使うがよろしと、どこかで書いてあったが、別にそうしなければいけない訳ではない。固定IPだと他と重複しないように注意。ま、基本中の基本。

2013年10月11日金曜日

BeagleBone Black に FreeBSDをインストール 9

 ここしばらくBeagleBone BlackにFreeBSDをインストールすべく、いろいろ試してきた。一応MicroSDのimg作成までたどり着けそうなので、まとめておこう。
 crochet.shを使ったimg作成方法が良く作られているので、これを使う。ブラックボックス化されていて、何がされているのかは分かりにくいところはあるが、logも出力されて残るので、詳しく見てみることもできる。make xdev, make buildworld, make installworldとか何やってるのか良く分からないうちは、一連の作業を連続で行えるので、便利ではある。いろいろカスタマイズもできるようになっているみたいだ。
 URLは https://github.com/kientzle/crochet-freebsd.git

1.コンパイル環境としてFreeBSD(i386)を用意する。

 FreeBSDは10.0Alpha5のi386(32bit)版がよさそう。9.2と10.0ではコンパイラがgcc→clangになっているがBeagleBone用のソースが10.0なんで相性がよさそう。
 32bitがいい理由は途中portsパッケージのインストールを要求されるのだが、これが32bitでのコンパイルの方が問題無いからだ。
 PC上にVMWarePlayerを用意して、50Gくらいのディスクにインストールする。TeraTermからsshログインできるようにしておいたほうが便利。OSインストールして、ユーザーアカウント登録している所から始める。#はrootでの作業、$はユーザーアカウントでの作業。

 # portsnap fetch
 # portsnap extract    # portsがインストールできるようになる
 # cd/usr/ports/security/sudo
 # make install clean   # sudoのインストール
 # visudo               # これでユーザーがsudoを実行できるようにしておく
 # cd /usr/ports/devel/git
 # make install clean    # gitのインストール SVNにチェックを入れると
                # subversionもインストールされる

 portsからgit (subversion含む), sudo をインストールしておく。ソースはユーザーアカウントしておいて、ログインディレクトリ直下に配置し、sudo コマンド使ってrootでコンパイル(crochet.shの実行)をすることになる。

2.chrochet-freebsdの取得

 $ cd
 $ git clone https://github.com/kientzle/crochet-freebsd.git

3.config.shを用意する
 config.sh.sample を参考にconfig.shを用意する。

 board_setup BeagleBone
 option ImageSize 15900mb # for 16 Gigabyte card
 option User brahmint
 option SwapFile 768mb
 option UsrSrc
 FREEBSD_SRC=${TOPDIR}/src
 WORKDIR=${TOPDIR}/work

とりあえず、このあたりを設定してみる。

4.crochet.shを実行する

$ sudo /bin/sh crochet.sh -c config.sh
Password:xxx
Starting at Fri Oct 11 15:16:46 JST 2013
Loading configuration from config.sh
Board: BeagleBone
Option: ImageSize 15900mb
Option: User brahmint
Option: SwapFile 768mb
Option: UsrSrc
grep: /usr/home/brahmint/crochet-freebsd/src/sys/conf/newvers.sh: No such file or directory
OS major version is:
Image name is: /usr/home/brahmint/crochet-freebsd/work/FreeBSD-armv6--BEAGLEBONE.img
[: : bad number
[: : bad number
[: : bad number
Object files are at:
This does not look like a FreeBSD source tree.
Did not find: /usr/home/brahmint/crochet-freebsd/src/COPYRIGHT

You can obtain a suitable FreeBSD source tree with the folowing commands:

 $ svn co https://svn0.us-west.freebsd.org/base/head /usr/home/brahmint/crochet-freebsd/src

Set $FREEBSD_SRC in config.sh if you have the sources in a different directory.
Run this script again after you have the sources installed.

$

4.srcを用意する
 chrochet.shよりソースを読み込めと指示あり。

$ svn co https://svn0.us-west.freebsd.org/base/head /usr/home/brahmint/crochet-freebsd/src
A    src/tools
A    src/tools/debugscripts
A    src/tools/build

   ・
   ・  (途中略)
   ・
A    src/games/fortune/README
A    src/games/fortune/tools/do_uniq.py
A    src/games/fortune/fortune/fortune.c
A    src/games/ppt/ppt.c
A    src/games/morse/morse.6
 U   src
Checked out revision 256307.


 1時間ほどでチェックアウトが終わる。

5.chrochet.shの再実行

$ sudo /bin/sh crochet.sh -c config.sh
Starting at Fri Oct 11 18:32:41 JST 2013
Loading configuration from config.sh
Board: BeagleBone
Option: ImageSize 15900mb
Option: User brahmint
Option: SwapFile 768mb
Option: UsrSrc
OS major version is: 11
Image name is: /usr/home/brahmint/crochet-freebsd/work/FreeBSD-armv6-11.0-BEAGLEBONE.img
Object files are at:
Found suitable FreeBSD source tree in:
    /usr/home/brahmint/crochet-freebsd/src

Please consider installing sysutils/u-boot-beaglebone-eabi port.
That will avoid the need for Crochet to build U-Boot.

Can't find appropriate FreeBSD xdev tools.
If you have FreeBSD-CURRENT sources in /usr/src, you can build these with the following command:

cd /usr/src && sudo make XDEV=arm XDEV_ARCH=armv6 xdev

Run this script again after you have the xdev tools installed.
$



6.クロスコンパイル環境の構築
 
 ログにはthe xdev toolsをインストールしてねという事で

 $ cd /usr/src && sudo make XDEV=arm XDEV_ARCH=armv6 xdev

 (実行時間1時間38分)

7. U-Boot
 ログにはsysutils/u-boot-beaglebone-eabiのportsも入れとけば、crochet.shでのu-bootのビルドは必要ないというこなので、こちらも。

 $ cd /usr/ports/sysutils/u-boot-beaglebone-eabi && sudo make install clean

 arm-eabi-gcc-4.5.4 とかのインストールがされるので、そこそこ時間は掛かる。
 この途中で、gmp-5.1.3のビルド途中でエラーが出る。最後の方のログはこんな感じ。
 
/bin/sh /usr/ports/math/gmp/work/gnome-libtool --mode=compile --tag=CC ../mpn/m4-ccas --m4="m4" cc -c -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I..  -DOPERATION_`echo add_n | sed 's/_$//'`     -O2 -pipe -fno-strict-aliasing -Wa,--noexecstack `test -f 'add_n.asm' || echo './'`add_n.asm
gnome-libtool: compile:  ../mpn/m4-ccas --m4=m4 cc -c -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_add_n -O2 -pipe -fno-strict-aliasing -Wa,--noexecstack add_n.asm  -fPIC -DPIC -o .libs/add_n.o
m4  -DHAVE_CONFIG_H -D__GMP_WITHIN_GMP -DOPERATION_add_n -DPIC add_n.asm >tmp-add_n.s
 cc -c -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_add_n -O2 -pipe -fno-strict-aliasing -Wa,--noexecstack tmp-add_n.s -fPIC -DPIC -o .libs/add_n.o
cc: warning: argument unused during compilation: '-D HAVE_CONFIG_H'
cc: warning: argument unused during compilation: '-I .'
cc: warning: argument unused during compilation: '-I ..'
cc: warning: argument unused during compilation: '-D __GMP_WITHIN_GMP'
cc: warning: argument unused during compilation: '-I ..'
cc: warning: argument unused during compilation: '-D OPERATION_add_n'
cc: warning: argument unused during compilation: '-fno-strict-aliasing'
cc: warning: argument unused during compilation: '-fPIC'
cc: warning: argument unused during compilation: '-D PIC'
tmp-add_n.s:76:15: error: expected ']' in brackets expression
        ldr     r12, [r13, #0]
                         ^
tmp-add_n.s:77:11: error: unexpected token in argument list
        stmfd   r13!, { r8, r9, r14 }
                   ^
tmp-add_n.s:78:11: error: unknown token in expression
        cmp     r12, #1
                     ^
tmp-add_n.s:79:2: error: invalid instruction mnemonic 'b'
        b       .Lent
        ^
tmp-add_n.s:87:11: error: unexpected token in argument list
        stmfd   r13!, { r8, r9, r14 }
                   ^
tmp-add_n.s:88:10: error: unknown token in expression
        cmn     r0, #0
                    ^
tmp-add_n.s:89:16: error: unknown token in expression
.Lent:  tst     r3, #1
                    ^
tmp-add_n.s:90:2: error: invalid instruction mnemonic 'beq'
        beq     .Lskip1
        ^~~
tmp-add_n.s:91:17: error: unknown token in expression
        ldr     r12, [r1], #4
                           ^
tmp-add_n.s:92:17: error: unknown token in expression
        ldr     r14, [r2], #4
                           ^
tmp-add_n.s:93:2: error: invalid instruction mnemonic 'adcs'
        adcs    r12, r12, r14
        ^~~~
tmp-add_n.s:94:17: error: unknown token in expression
        str     r12, [r0], #4
                           ^
tmp-add_n.s:96:10: error: unknown token in expression
        tst     r3, #2
                    ^
tmp-add_n.s:97:2: error: invalid instruction mnemonic 'beq'
        beq     .Lskip2
        ^~~
tmp-add_n.s:98:10: error: unexpected token in argument list
        ldmia   r1!, { r8, r9 }
                  ^
tmp-add_n.s:99:10: error: unexpected token in argument list
        ldmia   r2!, { r12, r14 }
                  ^
tmp-add_n.s:100:2: error: invalid instruction mnemonic 'adcs'
        adcs    r8, r8, r12
        ^~~~
tmp-add_n.s:101:2: error: invalid instruction mnemonic 'adcs'
        adcs    r9, r9, r14
        ^~~~
tmp-add_n.s:102:10: error: unexpected token in argument list
        stmia   r0!, { r8, r9 }
                  ^
tmp-add_n.s:104:15: error: unknown token in expression
        bics    r3, r3, #3
                        ^
tmp-add_n.s:105:2: error: invalid instruction mnemonic 'beq'
        beq     .Lrtn
        ^~~
tmp-add_n.s:106:11: error: unexpected token in argument list
        stmfd   r13!, { r4, r5, r6, r7 }
                   ^
tmp-add_n.s:108:16: error: unexpected token in argument list
.Ltop:  ldmia   r1!, { r4, r5, r6, r7 }
                  ^
tmp-add_n.s:109:10: error: unexpected token in argument list
        ldmia   r2!, { r8, r9, r12, r14 }
                  ^
tmp-add_n.s:110:2: error: invalid instruction mnemonic 'adcs'
        adcs    r4, r4, r8
        ^~~~
tmp-add_n.s:111:14: error: unknown token in expression
        sub     r3, r3, #4
                        ^
tmp-add_n.s:112:2: error: invalid instruction mnemonic 'adcs'
        adcs    r5, r5, r9
        ^~~~
tmp-add_n.s:113:2: error: invalid instruction mnemonic 'adcs'
        adcs    r6, r6, r12
        ^~~~
tmp-add_n.s:114:2: error: invalid instruction mnemonic 'adcs'
        adcs    r7, r7, r14
        ^~~~
tmp-add_n.s:115:10: error: unexpected token in argument list
        stmia   r0!, { r4, r5, r6, r7 }
                  ^
tmp-add_n.s:116:10: error: unknown token in expression
        teq     r3, #0
                    ^
tmp-add_n.s:117:2: error: invalid instruction mnemonic 'bne'
        bne     .Ltop
        ^~~
tmp-add_n.s:119:11: error: unexpected token in argument list
        ldmfd   r13!, { r4, r5, r6, r7 }
                   ^
tmp-add_n.s:121:20: error: unknown token in expression
.Lrtn:  adc     r0, r3, #0
                        ^
tmp-add_n.s:122:11: error: unexpected token in argument list
        ldmfd   r13!, { r8, r9, r15 }
                   ^
*** [add_n.lo] Error code 1

make[7]: stopped in /usr/ports/math/gmp/work/gmp-5.1.3/mpn
1 error

make[7]: stopped in /usr/ports/math/gmp/work/gmp-5.1.3/mpn
*** [all-recursive] Error code 1

make[6]: stopped in /usr/ports/math/gmp/work/gmp-5.1.3
1 error

make[6]: stopped in /usr/ports/math/gmp/work/gmp-5.1.3
*** [all] Error code 2

make[5]: stopped in /usr/ports/math/gmp/work/gmp-5.1.3
1 error

make[5]: stopped in /usr/ports/math/gmp/work/gmp-5.1.3
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[4]: stopped in /usr/ports/math/gmp
*** Error code 1

Stop.
make[3]: stopped in /usr/ports/math/gmp
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/devel/arm-eabi-gcc
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/devel/arm-eabi-gcc
*** Error code 1

Stop.
make: stopped in /usr/ports/sysutils/u-boot-beaglebone-eabi
$


はて、どうしよう。手に余る感じだ。

2013年10月1日火曜日

BeagleBone Black に FreeBSDをインストール 8

 Ubuntuは簡単にインストール出来たので。FreeBSDはゆっくりと試していく事にする。

 10.0 Alpha2 を Atom D510 マシンへインストールして

1.クロスコンパイル環境
# cd /usr/src
# make xdev XDEV=arm XDEV_ARCH=armv6
 
2.crochet-freebsd.gitの読み込みとコンパイル

$ git clone git://github.com/kientzle/crochet-freebsd.git
Cloning into 'crochet-freebsd'...
remote: Counting objects: 2219, done.
remote: Compressing objects: 100% (1131/1131), done.
remote: Total 2219 (delta 983), reused 2203 (delta 970)
Receiving objects: 100% (2219/2219), 4.15 MiB | 847.00 KiB/s, done.
Resolving deltas: 100% (983/983), done.
Checking connectivity... done
$ cd crochet-freebsd
$ ls
README.md               config.sh.sample        lib
board                   crochet.sh              option
 
(ここでconfig.sh.sampleを修正したものでconfig.shを作成)
 

$ sudo sh crochet.sh -b BeagleBone -c config.sh
Password:xxxx
Starting at Mon Sep 30 11:27:14 JST 2013
Board: BeagleBone
Loading configuration from config.sh
Board: BeagleBone
Option: ImageSize 15900mb
Option: AutoSize
Option: SwapFile 768mb
Option: UsrSrc
Found suitable FreeBSD source tree in:
    /usr/src

Please consider installing sysutils/u-boot-beaglebone-eabi port.
That will avoid the need for Crochet to build U-Boot.

Found FreeBSD xdev tools for armv6
U-Boot build requires 'gsed'
Please install textproc/gsed and re-run this script.

# cd /usr/ports/textproc/gsed
# make install clean

$ sudo sh crochet.sh -b BeagleBone -c config.sh
Starting at Mon Sep 30 11:31:00 JST 2013
Board: BeagleBone
Loading configuration from config.sh
Board: BeagleBone
Option: ImageSize 15900mb
Option: AutoSize
Option: SwapFile 768mb
Option: UsrSrc
Found suitable FreeBSD source tree in:
    /usr/src

Please consider installing sysutils/u-boot-beaglebone-eabi port.
That will avoid the need for Crochet to build U-Boot.

Found FreeBSD xdev tools for armv6

Expected to see U-Boot sources in
    /usr/home/brahmint/crochet-freebsd/u-boot-2013.04
Use the following command to get the U-Boot sources

 $ ftp ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2
 $ tar xf u-boot-2013.04.tar.bz2

Edit $BEAGLEBONE_UBOOT_SRC in config.sh if you want the sources in a different directory.
Run this script again after you have the U-Boot sources installed.

$ ftp ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2
Connected to themis.denx.de.
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 11 of 50 allowed.
220-Local time is now 04:32. Server port: 21.
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
230 Anonymous user logged in
Remote system type is UNIX.
Using binary mode to transfer files.
200 TYPE is now 8-bit binary
250 OK. Current directory is /pub
250 OK. Current directory is /pub/u-boot
local: u-boot-2013.04.tar.bz2 remote: u-boot-2013.04.tar.bz2
229 Extended Passive mode OK (|||64656|)
150-Accepted data connection
150 9606.8 kbytes to download
100% |************************************************************************************|  9606 KiB   47.45 Ki
226-File successfully transferred
226 199.630 seconds (measured here), 48.12 Kbytes per second
9837387 bytes received in 03:22 (47.45 KiB/s)
221-Goodbye. You uploaded 0 and downloaded 9607 kbytes.
221 Logout.

$ tar xf u-boot-2013.04.tar.bz2
$ ls -l
total 9720
-rw-r--r--   1 brahmint   brahmint      4188 Sep 30 10:39 README.md
drwxr-xr-x  10 brahmint   brahmint       512 Sep 30 10:39 board
-rw-r--r--   1 brahmint   brahmint      8790 Sep 30 11:44 config.sh
-rw-r--r--   1 brahmint   brahmint      8717 Sep 30 10:39 config.sh.sample
-rwxr-xr-x   1 brahmint   brahmint      1615 Sep 30 10:39 crochet.sh
drwxr-xr-x   2 brahmint   brahmint       512 Sep 30 10:39 lib
drwxr-xr-x  10 brahmint   brahmint       512 Sep 30 10:39 option
drwxr-xr-x  20 brahmint   brahmint      1024 Apr 19 23:25 u-boot-2013.04
-rw-r--r--   1 brahmint   brahmint   9837387 Apr 20 04:53 u-boot-2013.04.tar.bz2
drwxr-xr-x   2 root       brahmint       512 Sep 30 11:27 work
$ sudo sh crochet.sh -b BeagleBone -c config.sh
Password:xxxx
Starting at Mon Sep 30 15:11:04 JST 2013
Board: BeagleBone
Loading configuration from config.sh
Board: BeagleBone
Option: ImageSize 15900mb
Option: AutoSize
Option: SwapFile 768mb
Option: UsrSrc
Found suitable FreeBSD source tree in:
    /usr/src

Please consider installing sysutils/u-boot-beaglebone-eabi port.
That will avoid the need for Crochet to build U-Boot.

Found FreeBSD xdev tools for armv6
Found U-Boot sources in:
    /usr/home/brahmint/crochet-freebsd/u-boot-2013.04

Please consider installing sysutils/u-boot-beaglebone-eabi port.
That will avoid the need for Crochet to build U-Boot.

Found FreeBSD xdev tools for armv6
Found U-Boot sources in:
    /usr/home/brahmint/crochet-freebsd/u-boot-2013.04
Building FreeBSD armv6 world at Mon Sep 30 15:11:05 JST 2013
    (Logging to /usr/home/brahmint/crochet-freebsd/work/_.buildworld.armv6.log)Failed to build FreeBSD armv6 world.
Log in /usr/home/brahmint/crochet-freebsd/work/_.buildworld.armv6.log

make[1]: stopped in /usr/src
1 error

make[1]: stopped in /usr/src
*** [buildworld] Error code 2

make: stopped in /usr/src
1 error

make: stopped in /usr/src
$ date
Mon Sep 30 22:56:46 JST 2013

------------------ 
ひえー、7時間45分後にエラーでたーw
(dateコマンドは長く掛かりそうなんで途中でキーボードから先打ちしてたw)
ログ調べてみよう。
------------------  
…前のほうは略… 
c++   -O -pipe -I/usr/src/lib/clang/libllvmtransformutils/../../../contrib/llvm/include -I/usr/src/lib/clang/libllvmtransformutils/../../../contrib/llvm/tools/clang/include -I/usr/src/lib/clang/libllvmtransformutils/../../../contrib/llvm/lib/Transforms/Utils -I. -I/usr/src/lib/clang/libllvmtransformutils/../../../contrib/llvm/../../lib/clang/include -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -fno-strict-aliasing -DLLVM_DEFAULT_TARGET_TRIPLE=\"armv6-gnueabi-freebsd10.0\" -DLLVM_HOST_TRIPLE=\"armv6-unknown-freebsd10.0\" -DDEFAULT_SYSROOT=\"\" -Qunused-arguments -Wno-c++11-extensions -fno-exceptions -fno-rtti -c /usr/src/lib/clang/libllvmtransformutils/../../../contrib/llvm/lib/Transforms/Utils/SimplifyInstructions.cpp -o SimplifyInstructions.o
In file included from /usr/src/lib/clang/libllvmtransformutils/../../../contrib/llvm/lib/Transforms/Utils/SimplifyInstructions.cpp:29:
In file included from /usr/src/lib/clang/libllvmtransformutils/../../../contrib/llvm/include/llvm/Transforms/Utils/Local.h:19:
In file included from /usr/src/lib/clang/libllvmtransformutils/../../../contrib/llvm/include/llvm/IR/IRBuilder.h:23:
In file included from /usr/src/lib/clang/libllvmtransformutils/../../../contrib/llvm/include/llvm/IR/Instructions.h:26:
In file included from /usr/src/lib/clang/libllvmtransformutils/../../../contrib/llvm/include/llvm/Support/IntegersSubset.h:24:
/usr/home/umainjana/crochet-freebsd/work/obj/arm.armv6/usr/src/tmp/usr/include/c++/v1/list:1498:57: error: no member named 'allocate' in 'std::__1::allocator_traits<std::__1::allocator<std::__1::__list_node<llvm::IntRange<llvm::IntItem>, void *> > >'
    unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
                                                        ^
/usr/src/lib/clang/libllvmtransformutils/../../../contrib/llvm/include/llvm/Support/IntegersSubsetMapping.h:544:14: note: in instantiation of member function 'std::__1::list<llvm::IntRange<llvm::IntItem>, std::__1::allocator<llvm::IntRange<llvm::IntItem> > >::push_back' requested here
      Ranges.push_back(i->first);
             ^
/usr/src/lib/clang/libllvmtransformutils/../../../contrib/llvm/include/llvm/IR/Instructions.h:2809:27: note: in instantiation of member function 'llvm::IntegersSubsetMapping<llvm::BasicBlock, llvm::IntegersSubset, llvm::IntItem>::getCase' requested here
      *SubsetIt = Mapping.getCase();
                          ^
1 error generated.
*** [SimplifyInstructions.o] Error code 1

make[6]: stopped in /usr/src/lib/clang/libllvmtransformutils
1 error

make[6]: stopped in /usr/src/lib/clang/libllvmtransformutils
*** [all] Error code 2

make[5]: stopped in /usr/src/lib/clang
1 error

make[5]: stopped in /usr/src/lib/clang
*** [all] Error code 2

make[4]: stopped in /usr/src/lib
1 error

make[4]: stopped in /usr/src/lib
A failure has been detected in another branch of the parallel make

make[3]: stopped in /usr/src
*** [libraries] Error code 2

make[2]: stopped in /usr/src
1 error

make[2]: stopped in /usr/src
*** [_libraries] Error code 2

make[1]: stopped in /usr/src
1 error

make[1]: stopped in /usr/src
*** [buildworld] Error code 2

make: stopped in /usr/src
1 error

make: stopped in /usr/src
 

2013年9月29日日曜日

BeagleBone Black に Ubuntuをインストール

 FreeBSDのインストールが進まないので、Ubuntuをインストールしてみた。Ubuntuはかなり久しぶりだ。もちろんインストールしたことがあるのはi386版だが。

 1.まず、ubuntu-ja-13.04-desktop-i386.iso をダウンロードして、PCのVMware Player の仮想マシンにインストールする。

 2.i386Ubuntuを簡単に設定して・・・Ubuntuの現在のGUIも初めて見る。なかなかよさそうだけど、評判悪いんだよなw・・・Terminal を開いて、以下一連のコマンドを実行する。
  
  $ sudo apt-get install aptitude
 $ sudo aptitude install uboot-mkimage wget pv dosfstools btrfs-tools parted git-core
 $ wget http://rcn-ee.net/deb/rootfs/raring/ubuntu-13.04-console-armhf-2013-08-24.tar.xz
 $ tar xJf ubuntu-13.04-console-armhf-2013-08-24.tar.xz
  $ cd ubuntu-13.04-console-armhf-2013-08-24
  USBポートにMicroSDが乗ったアダプタを差込む (/deb/sdb に認識された) 
  $ sudo ./setup_sdcard.sh --mmc /dev/sdb --uboot bone_dtb 
  こんな具合で、簡単にMicroSDカードに書き込めた。
 MicroSDをBeagleBone Blackに差込み、SDカードから立ち上げるためのボタンを押して
電源ONすると、Ubuntuが立ち上がり、DHCPでIPアドレスが決まって、
LANからSSHでログインできる。usb0にはIP 192.168.7.2 が割り振られていたので、
USBケーブルからでもできそう。
 LANの方のDHCPだと、環境によっては取得されるIPアドレスが予想しづらいことも
ありそうだしな。
 
 あとは通常のサーバー設定。ntpの設定。タイムゾーンの変更など、
お好きなように・・・。普通に使うパッケージは大体使えるんじゃないだろうか。
 Gitを試してみたら、問題なく使えた。
 
 Ubuntuはarm向けイメージも用意されてるから、簡単でいいわーw
 この際Ubuntuでずっと行こうかと、ちょっと気持ちが揺れてます。

2013年9月28日土曜日

BeagleBone Black に FreeBSDをインストール 7

 いろいろ調べていたら、FreeBSDには、最初からクロスコンパイラ環境のソースも納められている事が判明w
 
# cd /usr/src
# make xdev XDEV=arm XDEV_ARCH=armv6
 
 これで、/usr/armv6-freebsd 配下に arm用ツールチェインが作成されるらしい。
 実行して確認してみたところ。

# cd /usr/armv6-freebsd
# ls -ltotal 60
drwxr-xr-x   2 root  wheel   512 Sep 12 19:07 bin
drwxr-xr-x   7 root  wheel   512 Sep 12 19:07 boot
dr-xr-xr-x   2 root  wheel   512 Sep 12 19:07 dev
drwxr-xr-x  21 root  wheel   512 Sep 12 19:07 etc
drwxr-xr-x   3 root  wheel  1536 Sep 12 20:11 lib
drwxr-xr-x   3 root  wheel   512 Sep 12 19:07 libexec
drwxr-xr-x   2 root  wheel   512 Sep 12 19:07 media
drwxr-xr-x   2 root  wheel   512 Sep 12 19:07 mnt
dr-xr-xr-x   2 root  wheel   512 Sep 12 19:07 proc
drwxr-xr-x   2 root  wheel   512 Sep 12 19:07 rescue
drwxr-xr-x   2 root  wheel   512 Sep 12 19:07 root
drwxr-xr-x   2 root  wheel   512 Sep 12 19:07 sbin
drwxrwxrwt   2 root  wheel   512 Sep 12 19:07 tmp
drwxr-xr-x  15 root  wheel   512 Sep 12 19:07 usr
drwxr-xr-x   2 root  wheel   512 Sep 12 19:07 var
 とまあ、こんな感じ。
  http://blog.khubla.com/freebsd/building-a-beaglebone-freebsd-kernel
 ここを参考にして、続ける。

# git clone git://github.com/kientzle/crochet-freebsd.git
Cloning into 'crochet-freebsd'...
remote: Counting objects: 2200, done.
remote: Compressing objects: 100% (1114/1114), done.
remote: Total 2200 (delta 988), reused 2179 (delta 970)
Receiving objects: 100% (2200/2200), 4.14 MiB | 776.00 KiB/s, done.
Resolving deltas: 100% (988/988), done.
Checking connectivity... done
# cd crochet-freebsd
# ls -l
total 44
drwxr-xr-x   8 root  wheel   512 Sep 12 21:35 .git
-rw-r--r--   1 root  wheel    29 Sep 12 21:35 .gitignore
-rw-r--r--   1 root  wheel  4188 Sep 12 21:35 README.md
drwxr-xr-x  10 root  wheel   512 Sep 12 21:35 board
-rw-r--r--   1 root  wheel  8717 Sep 12 21:35 config.sh.sample
-rwxr-xr-x   1 root  wheel  1615 Sep 12 21:35 crochet.sh
drwxr-xr-x   2 root  wheel   512 Sep 12 21:35 lib
drwxr-xr-x  10 root  wheel   512 Sep 12 21:35 option
 
 とまあ、いろいろ試行錯誤していたのだが、
UART用のケーブル、http://akizukidenshi.com/catalog/g/gM-05840/ 
これを買いに秋葉に2週連続で足を運んだんだが、品切れ中orz
コンパイルしたkernelが一発で動いて、LANからsshでログインできれば不要なんだが、うまくいきそうじゃない予感(笑)
FreeBSD も 9.2 のリリース間近で、 10.0のAlpha2が出たりで、どれにするか思案中。
 秋葉に行ったときにMicroSD 16G(Class 10)が699円とか、安かったので2枚買ってきた。
とりあえず、Ubuntuでもインストールして、BeagleBone Black の性能とかを試してみようと思う。
 


2013年9月10日火曜日

BeagleBone Black に FreeBSDをインストール 6

 では、include/configs/am335x_evm.h に修正を加えて 早速makeしてみる。

C:\Users\hogehoge\Desktop\u-boot-am33x>make -j3 ARCH=arm CROSS_COMPILE=/opt/arm-cs-tools/bin/arm-none-eabi- am335x_evm
'make' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。


 ううむ、makeが無いw PATHの設定は… 問題ない。じゃ、CodeSourceryのbin配下にmakeは無いのか… 無いw ……… cs-make.exe というのはあるな。 cs-make でググると、makeの代わりに cs-make でいいみたい。じゃが、Makefileの中にmakeは使われているんじゃないかと、ちと不安w
 で、cs-make 使って実行!

C:\Users\hogehoge\Desktop\u-boot-am33x>cs-make -j3 ARCH=arm CROSS_COMPILE=/opt/arm-cs-tools/bin/arm-none-eabi- am335x_evm
'uname' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。
'uname' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。
-x の使い方が誤っています。
'awk' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。
cs-make: *** No rule to make target `am335x_evm'.  Stop.


 ううむ、道のりは遠いw

BeagleBone Black に FreeBSDをインストール 5

 さて、FreeBSDのGitではcloneできたけど、今度はWindows版Gitでやってみよう。tortoisegitが使い易そうなんで、これを選ぶ。
 http://code.google.com/p/tortoisegit/wiki/Download ここから64bit版 1.8.5.0 と 日本語のLanguagePackもダウンロード。
 http://code.google.com/p/msysgit/ ここからmsyGit 最新版もダウンロード。
 で、あれやこれやで、インストール。
 armのソースをダウンロードするだけなら、sshとか使わないから必要ないかもしれないが、puTTYgenで公開鍵作成とかもやってみた。そのうち使う事もあるだろう。
 で、 http://arago-project.org/git/projects/u-boot-am33x.git からU-Bootのリポジトリをcloneしてみた。あれやこれやで、勘違いしたりで、やっと成功w

 u-boot-am33x なる名前のフォルダーにソース一式が読み込まれたのでした。

C:\Users\umainjana\Desktop\u-boot-am33x>dir /A
 ドライブ C のボリューム ラベルがありません。
 ボリューム シリアル番号は 9AE3-EB0F です

 C:\Users\umainjana\Desktop\u-boot-am33x のディレクトリ

2013/09/10  01:43    <DIR>          .
2013/09/10  01:43    <DIR>          ..
2013/09/10  01:43               288 .checkpatch.conf
2013/09/10  01:50    <DIR>          .git
2013/09/10  01:43               878 .gitignore
2013/09/10  01:43    <DIR>          api
2013/09/10  01:43    <DIR>          arch
2013/09/10  01:43    <DIR>          board
2013/09/10  01:43           117,523 boards.cfg
2013/09/10  01:43    <DIR>          common
2013/09/10  01:43            11,018 config.mk
2013/09/10  01:43            16,704 COPYING
2013/09/10  01:43            12,741 CREDITS
2013/09/10  01:43    <DIR>          disk
2013/09/10  01:43    <DIR>          doc
2013/09/10  01:43    <DIR>          drivers
2013/09/10  01:43    <DIR>          dts
2013/09/10  01:43    <DIR>          examples
2013/09/10  01:43    <DIR>          fs
2013/09/10  01:43    <DIR>          include
2013/09/10  01:43    <DIR>          lib
2013/09/10  01:43            26,669 MAINTAINERS
2013/09/10  01:43            21,792 MAKEALL
2013/09/10  01:43            28,649 Makefile
2013/09/10  01:43             4,703 mkconfig
2013/09/10  01:43    <DIR>          nand_spl
2013/09/10  01:43    <DIR>          net
2013/09/10  01:43    <DIR>          post
2013/09/10  01:43           185,007 README
2013/09/10  01:43             2,555 rules.mk
2013/09/10  01:43                18 snapshot.commit
2013/09/10  01:43    <DIR>          spl
2013/09/10  01:43    <DIR>          test
2013/09/10  01:43    <DIR>          tools
              13 個のファイル             428,545 バイト
              21 個のディレクトリ  1,080,202,301,440 バイトの空き領域

2013年9月9日月曜日

BeagleBone Black に FreeBSDをインストール 4

 さて、 U-boot の続きに移ろう。Gitの使い方も良く分からんのだが、FreeBSDマシンでリポジトリをゲットしてみる。

# mkdir uboot
# cd uboot
# git clone git://arago-project.org/git/projects/u-boot-am33x.git
Cloning into 'u-boot-am33x'...
remote: Counting objects: 194729, done.
remote: Compressing objects: 100% (40345/40345), done.
remote: Total 194729 (delta 156551), reused 189594 (delta 151599)
Receiving objects: 100% (194729/194729), 49.90 MiB | 282.00 KiB/s, done.
Resolving deltas: 100% (156551/156551), done.
Checking connectivity... done
Checking out files: 100% (7448/7448), done.


 OK!読み込めた。
 ちょっと、ディレクトリ内部を見てみると…

# ls -l
total 4
drwxr-xr-x  21 root  wheel  1024  9月  9 06:02 u-boot-am33x

# cd u-boot-am33x
# ls -l
total 524
-rw-r--r--    1 root  wheel     274  9月  9 06:01 .checkpatch.conf
drwxr-xr-x    8 root  wheel     512  9月  9 06:02 .git
-rw-r--r--    1 root  wheel     799  9月  9 06:01 .gitignore
-rw-r--r--    1 root  wheel   16398  9月  9 06:01 COPYING
-rw-r--r--    1 root  wheel   12200  9月  9 06:01 CREDITS
-rw-r--r--    1 root  wheel   25370  9月  9 06:01 MAINTAINERS
-rwxr-xr-x    1 root  wheel   21003  9月  9 06:01 MAKEALL
-rw-r--r--    1 root  wheel   27807  9月  9 06:01 Makefile
-rw-r--r--    1 root  wheel  179855  9月  9 06:01 README
drwxr-xr-x    2 root  wheel     512  9月  9 06:01 api
drwxr-xr-x   16 root  wheel     512  9月  9 06:01 arch
drwxr-xr-x  290 root  wheel    5120  9月  9 06:01 board
-rw-r--r--    1 root  wheel  116414  9月  9 06:01 boards.cfg
drwxr-xr-x    3 root  wheel    3584  9月  9 06:01 common
-rw-r--r--    1 root  wheel   10680  9月  9 06:01 config.mk
drwxr-xr-x    2 root  wheel     512  9月  9 06:01 disk
drwxr-xr-x    7 root  wheel    3072  9月  9 06:01 doc
drwxr-xr-x   28 root  wheel     512  9月  9 06:01 drivers
drwxr-xr-x    2 root  wheel     512  9月  9 06:01 dts
drwxr-xr-x    4 root  wheel     512  9月  9 06:01 examples
drwxr-xr-x   11 root  wheel     512  9月  9 06:01 fs
drwxr-xr-x   18 root  wheel    5632  9月  9 06:02 include
drwxr-xr-x    7 root  wheel    1024  9月  9 06:02 lib
-rwxr-xr-x    1 root  wheel    4512  9月  9 06:02 mkconfig
drwxr-xr-x    3 root  wheel     512  9月  9 06:02 nand_spl
drwxr-xr-x    2 root  wheel     512  9月  9 06:02 net
drwxr-xr-x    6 root  wheel     512  9月  9 06:02 post
-rw-r--r--    1 root  wheel    2487  9月  9 06:02 rules.mk
-rw-r--r--    1 root  wheel      17  9月  9 06:02 snapshot.commit
drwxr-xr-x    2 root  wheel     512  9月  9 06:02 spl
drwxr-xr-x    2 root  wheel     512  9月  9 06:02 test
drwxr-xr-x   12 root  wheel    1536  9月  9 06:02 tools


 とまあ、こんな感じ。
 Gitの方が、Subversionより使い易い様な感じがする。現在はSubversionを使っているけど、履歴を残す+サーバーにバックアップするという感覚で使っている。使用者が自分一人だけなんで面倒が少ないけど、グループで開発とかになったら、また別の問題も発生するんだろうな。Subversionを仕事で初めて使いたてのときには、結構updateせずにcommitして、他の人の変更箇所を無視してしまったりという間違いをしていたしなあw

BeagleBone Black に FreeBSDをインストール 3

 前回、「Getting Started Guide に、上記tarファイルの解凍の仕方とかも載っていた。」と書いたが、とんでもなかった。gz2ファイルの解凍までは乗っているが、その後どうすればいいのかは書いてなかったw。
 arm-2013.05-24-arm-none-linux-gnueabi.sh が解凍のシェルスクリプトらしいが、Bash用なのに実行してみたら、次のようなエラーが…
  # bash arm-2013.05-24-arm-none-linux-gnueabi.sh
  arm-2013.05-24-arm-none-linux-gnueabi.sh: 行 181: grep: コマンドが見つかりません
  arm-2013.05-24-arm-none-linux-gnueabi.sh: 行 181: sed: コマンドが見つかりません

 PATHの設定なのかも知れんが、そもそもBASH使う環境になっていないのかも。

 Windows版とLinux版はインストーラーがあるので、面倒が少なくていいのだろう。ディレクトリ構成とか、Linuxと同じなんだろうから、Linux版をインストールすればいいかもしれないが、Linux用のパッケージのインストールの仕方も分からないし、Linuxマシンもない。Linuxをインストールしたマシンを用意するのも面倒だ。とりあえずWindows版をインストールして、ディレクトリ構成とかを調べてみるか…。

 Windows用は arm-2013.05-24-arm-none-linux-gnueabi.exe を実行してインストールしてみた。
環境変数PATHに C:\Program Files (x86)\CodeSourcery\Sourcery_CodeBench_Lite_for_ARM_GNU_Linux\bin_cache が追加されていたが、最後の bin_cache は bin でいいんじゃないかと思って、bin の方も追加しておく。

 Getting Started Guide にあるように、確認のコマンドを打ち込んだら、以下の様に…

>arm-none-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-none-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=c:/program\ files\ (x86)/codesourcery/sourcery_codebench_lite_for_arm_gnu_linux/bin/../libexec/gcc/arm-none-
linux-gnueabi/4.7.3/lto-wrapper.exe
Target: arm-none-linux-gnueabi
Configured with: /scratch/jbrown/2013.05-arm-linux-release/src/gcc-4.7-2013.05/configure --build=i686-pc-linux-gnu --host=i686-m
ingw32 --target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --enable-e
xtra-sgxxlite-multilibs --with-arch=armv5te --with-gnu-as --with-gnu-ld --with-specs='%{save-temps: -fverbose-asm} %{funwind-tab
les|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables} -D__CS_SOURCERYGXX_MAJ__=2013 -D__CS_SOURCERYGXX_MIN__=5
-D__CS_SOURCERYGXX_REV__=24 %{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-loca
l-statics: -fremove-local-statics}}}' --enable-languages=c,c++ --enable-shared --enable-lto --enable-symvers=gnu --enable-__cxa_
atexit --with-pkgversion='Sourcery CodeBench Lite 2013.05-24' --with-bugurl=https://sourcery.mentor.com/GNUToolchain/ --disable-
nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratch/jbrown
/2013.05-arm-linux-release/install/host-i686-mingw32/arm-none-linux-gnueabi/libc --with-libiconv-prefix=/scratch/jbrown/2013.05-
arm-linux-release/obj/pkg-2013.05-24-arm-none-linux-gnueabi/arm-2013.05-24-arm-none-linux-gnueabi.extras/host-libs-i686-mingw32/
usr --with-gmp=/scratch/jbrown/2013.05-arm-linux-release/obj/pkg-2013.05-24-arm-none-linux-gnueabi/arm-2013.05-24-arm-none-linux
-gnueabi.extras/host-libs-i686-mingw32/usr --with-mpfr=/scratch/jbrown/2013.05-arm-linux-release/obj/pkg-2013.05-24-arm-none-lin
ux-gnueabi/arm-2013.05-24-arm-none-linux-gnueabi.extras/host-libs-i686-mingw32/usr --with-mpc=/scratch/jbrown/2013.05-arm-linux-
release/obj/pkg-2013.05-24-arm-none-linux-gnueabi/arm-2013.05-24-arm-none-linux-gnueabi.extras/host-libs-i686-mingw32/usr --with
-ppl=/scratch/jbrown/2013.05-arm-linux-release/obj/pkg-2013.05-24-arm-none-linux-gnueabi/arm-2013.05-24-arm-none-linux-gnueabi.e
xtras/host-libs-i686-mingw32/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-cloog=/scratc
h/jbrown/2013.05-arm-linux-release/obj/pkg-2013.05-24-arm-none-linux-gnueabi/arm-2013.05-24-arm-none-linux-gnueabi.extras/host-l
ibs-i686-mingw32/usr --with-libelf=/scratch/jbrown/2013.05-arm-linux-release/obj/pkg-2013.05-24-arm-none-linux-gnueabi/arm-2013.
05-24-arm-none-linux-gnueabi.extras/host-libs-i686-mingw32/usr --disable-libgomp --disable-libitm --enable-poison-system-directo
ries --with-build-time-tools=/scratch/jbrown/2013.05-arm-linux-release/obj/tools-i686-pc-linux-gnu-2013.05-24-arm-none-linux-gnu
eabi-i686-mingw32/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/jbrown/2013.05-arm-linux-release/obj/tools-i686-pc
-linux-gnu-2013.05-24-arm-none-linux-gnueabi-i686-mingw32/arm-none-linux-gnueabi/bin
Thread model: posix
gcc version 4.7.3 (Sourcery CodeBench Lite 2013.05-24)
 

 とりあえず、使えるようだ。
 一応、 ディレクトリ構成とbin配下を記す。

>cd C:\Program Files (x86)\CodeSourcery\Sourcery_CodeBench_Lite_for_ARM_GNU_Linux
 
>dir
 ドライブ C のボリューム ラベルがありません。
 ボリューム シリアル番号は 9AE3-EB0F です

 C:\Program Files (x86)\CodeSourcery\Sourcery_CodeBench_Lite_for_ARM_GNU_Linux のディレクトリ

2013/09/08  14:23    <DIR>          .
2013/09/08  14:23    <DIR>          ..
2013/09/08  14:23    <DIR>          arm-none-linux-gnueabi
2013/09/08  14:23    <DIR>          bin
2013/09/08  14:21    <DIR>          i686-mingw32
2013/09/08  14:23    <DIR>          jre
2013/09/08  14:21    <DIR>          lib
2013/09/08  14:21    <DIR>          libexec
2013/04/30  03:13               692 README_Sourcery_CodeBench_Lite_for_ARM_GNU_Linux.html
2013/04/30  03:13               483 README_Sourcery_CodeBench_Lite_for_ARM_GNU_Linux.txt
2013/09/08  14:21    <DIR>          share
2013/09/08  14:24    <DIR>          uninstall
2013/09/08  14:21             2,024 Uninstall_Sourcery_CodeBench_Lite_for_ARM_GNU_Linux.lnk
               3 個のファイル               3,199 バイト
              10 個のディレクトリ  1,083,337,068,544 バイトの空き領域
 

>cd bin
 

>dir
 ドライブ C のボリューム ラベルがありません。
 ボリューム シリアル番号は 9AE3-EB0F です

 C:\Program Files (x86)\CodeSourcery\Sourcery_CodeBench_Lite_for_ARM_GNU_Linux\bin のディレクトリ

2013/09/08  14:23    <DIR>          .
2013/09/08  14:23    <DIR>          ..
2013/04/30  03:12           759,310 arm-none-linux-gnueabi-addr2line.exe
2013/04/30  19:12           784,910 arm-none-linux-gnueabi-ar.exe
2013/04/30  19:12         1,266,190 arm-none-linux-gnueabi-as.exe
2013/04/30  03:12         1,457,678 arm-none-linux-gnueabi-c++.exe
2013/04/30  03:12           758,798 arm-none-linux-gnueabi-c++filt.exe
2013/04/30  03:12         1,456,142 arm-none-linux-gnueabi-cpp.exe
2013/04/30  03:12            75,278 arm-none-linux-gnueabi-elfedit.exe
2013/04/30  03:12         1,457,678 arm-none-linux-gnueabi-g++.exe
2013/04/30  03:12         1,454,606 arm-none-linux-gnueabi-gcc-4.7.3.exe
2013/04/30  03:12            58,894 arm-none-linux-gnueabi-gcc-ar.exe
2013/04/30  03:12            58,894 arm-none-linux-gnueabi-gcc-nm.exe
2013/04/30  03:12            58,894 arm-none-linux-gnueabi-gcc-ranlib.exe
2013/04/30  03:12         1,454,606 arm-none-linux-gnueabi-gcc.exe
2013/04/30  03:12         1,167,886 arm-none-linux-gnueabi-gcov.exe
2013/04/30  03:12         4,893,198 arm-none-linux-gnueabi-gdb.exe
2013/04/30  03:12           829,966 arm-none-linux-gnueabi-gprof.exe
2013/04/30  19:12         1,227,278 arm-none-linux-gnueabi-ld.exe
2013/04/30  19:12           770,062 arm-none-linux-gnueabi-nm.exe
2013/04/30  19:12           928,782 arm-none-linux-gnueabi-objcopy.exe
2013/04/30  19:12         1,115,662 arm-none-linux-gnueabi-objdump.exe
2013/04/30  19:12           784,910 arm-none-linux-gnueabi-ranlib.exe
2013/04/30  03:12           438,798 arm-none-linux-gnueabi-readelf.exe
2013/04/30  03:12           760,846 arm-none-linux-gnueabi-size.exe
2013/04/30  03:12           760,334 arm-none-linux-gnueabi-strings.exe
2013/04/30  19:12           928,782 arm-none-linux-gnueabi-strip.exe
2013/04/30  19:12           214,030 cs-make.exe
2013/04/30  19:12            69,646 cs-rm.exe
              27 個のファイル          25,992,058 バイト
               2 個のディレクトリ  1,083,337,011,200 バイトの空き領域


2013年9月7日土曜日

戦国IXAとIXA用ツール開発の変遷 3

 JSActionsを使っていたのは2010年の春頃からのことだったと記憶している。

3.GreaseMonkeyとの出会い

 JSActionsを使って色々なスクリプトを作っていた。IXAの地図上で、敵拠点の城主のプロフィールや合戦報告書を表示するのは出来たのだが、自分の最短の位置にある拠点からの距離を表示するのは地図上から出来なかった。

 Javascriptに対してはかなり理解が深まったのだが、HTMLやスタイルシート(CSS)など、WEBに関する知識に疎かったため、どうすることも出来なく、何とかしようと試行錯誤はしていた。
 FireFoxのアドオンはどうだろうかと試そうとしたり。結局いろいろ大変そうなので諦めたが…。

 そんなときWebでGreaseMonkeyの記述を見て、調べてみると、特定のページに対して、HTMLコードを操作して、特別な事を仕込む事が簡単に出来るらしいという事が分かった。

 試してみて、JSActionsのように手軽にスクリプトが組み込めるし、ボタンを表示させそこからスクリプトの起動するようなことも出来るので、いろいろ応用が利く事が分かった。

 同盟情報から同盟員の一覧を、リンクを辿った情報と一緒にまとめて、Excelに貼り付けられるように加工したりするスクリプトを作ったりした。

 こんな中で「どこ近」が作られた、ある地点に陣を作成しようとしたり、同じ同盟員の拠点に加勢を送ったりするときに、自分のどの拠点が一番近いのかを表示するスクリプトだ。

 最短の距離から部隊を送り出した後で、より近い拠点があったことが分かり残念に思った事が何度もあったので、これを無くしたいという思いから生まれた。

 「どこ近」のスクリプトがやっているのは、ある特定の座標において、自分のプロフィール画面から、自分の拠点の座標を拾い集めたものと、距離を計算して、最も近い拠点を表示することである。実際には、近い順に3箇所、ただし2番目以降は、もっとも近い地点と比べて、そこそこ近いものがある場合だけ表示される。距離10と距離50の拠点がある場合は、ひとつしか表示されない。最短拠点の距離と25%遠いところまでが表示される可能性がある仕様だったと思う。(ソース確認しろよw)

 こんな風にツールを使っていたが、座標を拾ってくる部分などは、HTMLソースをRegEx(正規表現)関数を使って抜き出す自前プログラムで行っていた。この時はまだjQueryは知らなかったのである。

BeagleBone Black に FreeBSDをインストール 2

 4.Build U-Boot

  i. Take U-Boot source from TI / Arago Project U-Boot GIT repository: http://arago-project.org/git/projects/U-Boot-am33x.git

   これのために、portsからGitをFreeBSDにインストール。
   /usr/ports/devel/git にて make install clean の呪文を唱える。
  # git --version
  git version 1.8.3.4

   とりあえずGitのインストールだけで、リポジトリの取得は後で。

  ii. Install some ARM cross tools (i.e. CodeSourcery)

   クロスコンパイラーとか必要なんで http://www.mentor.com/ から
   氏名やらメールアドレス打ち込んで申し込むと、メールが送られてきて、
   ダウンロードのページに誘導される。
   WindowsとLinux用のインストーラーはあるが、FreeBSD用はないので
   Source Tarを選ぶと
   arm-2013.05-24-arm-none-linux-gnueabi.src.tar.bz2
   というファイルがダウンロードされる。
   こいつをとりあえず試してみることにする。

   ダウンロードして解凍して、tarファイルを確認
   /root 配下に CodeSourcery でディレクトリを作成、その下でtarファイルを解凍
   arm-2013.05-24-arm-none-linux-gnueabi というディレクトリに各ファイルが出来ている



  -rw-r--r--  1 root  wheel      1014 Apr 30 19:21 arm-2013.05-24-arm-none-linux-gnueabi-summary.xml
   -rw-r--r--  1 root  wheel   2987780 Apr 30 19:21 arm-2013.05-24-arm-none-linux-gnueabi.sh
   -rw-r--r--  1 root  wheel  20427087 Apr 30 17:54 binutils-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel    596138 Apr 30 17:55 cloog-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel     43075 Apr 30 17:57 config-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel   5156461 Apr 30 17:57 coreutils-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel    375490 Apr 30 17:57 cs-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel    430787 Apr 30 17:57 expat-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel  77188106 Apr 30 17:55 gcc-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel  21121592 Apr 30 17:55 gdb-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel  17954037 Apr 30 17:56 glibc-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel     63286 Apr 30 17:56 glibc_localedef-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel   2056651 Apr 30 17:55 gmp-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel    319602 Apr 30 17:57 json_c-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel   2500884 Apr 30 17:57 libcurl-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel    135455 Apr 30 17:57 libelf-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel   3697970 Apr 30 17:57 libiconv-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel  86111518 Apr 30 17:57 linux-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel   1204404 Apr 30 17:57 make-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel    505944 Apr 30 17:55 mpc-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel   1227542 Apr 30 17:55 mpfr-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel   2040260 Apr 30 17:55 ncurses-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel   3588916 Apr 30 17:57 openssl-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel  12451504 Apr 30 17:55 ppl-2013.05-24.tar.bz2
   -rw-r--r--  1 root  wheel    508904 Apr 30 17:55 zlib-2013.05-24.tar.bz2

  他にドキュメント類のPDFファイルがあるのでそれらもダウンロードしておく。
  Getting Started Guide に、上記tarファイルの解凍の仕方とかも載っていた。
 

2013年9月6日金曜日

BeagleBone Black に FreeBSDをインストール 1

 beagleboard.org のサイトにBeagleBone に FreeBSDを載せるプロジェクトらしきリンクがあったので、この通りやってみることにする。

 1. 自前のAtom D510マシンに、FreeBSD9.2RC3をインストールして、こいつで作業する事にする。microSDカードをUSBポートから USBカードリーダー・ライター (¥105)を某100円ショップで購入。microSD→SDカードアダプタ→これ→USBポート と差込み、準備完了。

 2.FreeBSDマシン上で microSDが /dev/da0 で認識されている事を確認
   アダプタ2つも介してるので、接触不良に注意する。最初認識しなかったw

 3.Format SD card
以下を実行する
   # dd if=/dev/zero of=/dev/da0 bs=512 count=1
   1+0 records in
   1+0 records out
   512 bytes transferred in 0.002112 secs (242407 bytes/sec)


   # gpart create -s mbr da0
   da0 created


   # gpart add -s64m -t \!14 da0
   da0s1 added


   # gpart set -a active -i 1 da0
   active set on da0s1


   # gpart add -t freebsd da0
   da0s2 added


   # newfs_msdos -F 16 /dev/da0s1
   /dev/da0s1: 130872 sectors in 16359 FAT16 clusters (4096 bytes/cluster)
   BytesPerSec=512 SecPerClust=8 ResSectors=1 FATs=2 RootDirEnts=512 Media=0xf0 FATsecs=64 SecPerTrack=63 Heads=255 HiddenSecs=0 HugeSectors=131040


   # newfs /dev/da0s2
   /dev/da0s2: 14927.5MB (30571440 sectors) block size 32768, fragment size 4096
           using 24 cylinder groups of 626.09MB, 20035 blks, 80256 inodes.
   super-block backups (for fsck_ffs -b #) at:
    192, 1282432, 2564672, 3846912, 5129152, 6411392, 7693632, 8975872, 10258112, 11540352, 12822592, 14104832, 15387072, 16669312,
    17951552, 19233792, 20516032, 21798272, 23080512, 24362752, 25644992, 26927232, 28209472, 29491712




BeagleBone Black 購入

 巷で、Raspberry Pi が有名になったので、一つ欲しいなと思っていたのだが、いまひとつ手を出す魅力が足りないと思っていたら、BeagleBone Blackというのも出ている事を知る。こちらの方が、入出力用信号が多く、拡張性が高いし、CPU性能も少し高いらしいので、こっちでいいかと購入決定。
 きばん本舗というところからAmazon通して購入。
 その後、ビデオケーブルやらmicroSDメモリーとかを追加購入。すべてAmazonからwww
 
 http://www.amazon.co.jp/gp/product/B00CHHMZ9S/  ¥4,980 BeagleBone Black
 http://www.amazon.co.jp/gp/product/B001TH7T2U/    ¥671 HDMI-DVI-Dケーブル
 http://www.amazon.co.jp/gp/product/B005DPJPTO/   ¥596
HDMIマイクロ変換アダプタ
 あと microSDカード 16G ¥1,190 (これはリンク張るまでもないだろ)

 合計で、¥7,437 の出費でした。

2013年3月29日金曜日

さくらVPSサーバーの環境設定4

久しぶりに、さくらVPSサーバーの環境を整える。

  • portsツリー更新
    # portsnap fetch
    # portsnap extract
  • portupgradeインストール
    # cd /usr/ports/ports-mgmt/portupgrade/
    # make BATCH=yes install clean
    # rehash
    # cd
    # chmod 640 /usr/local/etc/pkgtools.conf
    # vi /usr/local/etc/pkgtools.conf
      MAKE_ARGS = {
     '*' => [                      ;* この4行を追加
      'WITH_BDB_VER=42',    ;* この4行を追加
      'WITHOUT_IPV6=yes',   ;* この4行を追加
     ],                            ;* この4行を追加
      }
    # 
    # freebsd-update fetch
    # freebsd-update install
    ;* 
  • crontab に追加
    
    # vi /etc/crontab  ;* 次の行を最下行に追加
    0 4 * * * root /usr/sbin/freebsd-update cron
     

2013年1月28日月曜日

さくらVPSサーバーの環境設定3

 ☆virtioに対応する
  • 現在のfstabをチェック
    # cat /etc/fstab
    # Device        Mountpoint      FStype  Options Dump    Pass#
    /dev/ada0p2     /               ufs     rw      1       1
    /dev/ada0p3     none            swap    sw      0       0
  • virtioモジュールをportsからインストール
    # cd /usr/ports/emulators/virtio-kmod
    # make install clean
  • /boot/loader.conf に以下を追記。
    virtio_load="YES"
    virtio_pci_load="YES"
    virtio_blk_load="YES"
    if_vtnet_load="YES"
    virtio_balloon_load="YES"
  • /etc/fstab の修正
    /dev/ada0p2 → /dev/vtbd0p2
    /dev/ada0p3 → /dev/vtbd0p3
  • /etc/rc.conf の修正
    ifconfig_em0 → ifconfig_vtnet0
  • 修正後に、さくらVPSのコントロールパネルからLinuxを再インストールする振りをして virtio機能をONにする
    もちろんLinuxはインストールはせずにすぐに再起動して、ディスクに書き込んであるFreeBSDを起動する
  • df -k を実行してみると以下の様に表示されて成功
     Filesystem   1024-blocks    Used    Avail Capacity  Mounted on
    /dev/vtbd0p2    97503036 3326296 86376500     4%    /
    devfs                  1       1        0   100%    /dev

さくらVPSサーバーの環境設定2





 ☆Subversionをインストール

  • /usr/ports/devel/subversion 配下で make; make inatall; make clean
  • svn 用アカウントを追加
  • /etc/rc.conf に以下を追加
    • svnserve_enable="YES"
      svnserve_flags="-d --log-file /home/svn/svn.log"
      svnserve_data="/home/svn"
      svnserve_user="svn"
      svnserve_group="svn"
  • /home/svn 配下にバックアップしておいたリポジトリデータを展開
  • リブートしてみて、PC側からcheckoutしてみる
ここまでやってみた。いまはsvnだけで接続だが、いずれはsshトンネリングで、ssh+svnでアクセスできるようにする予定。

2013年1月11日金曜日

さくらVPSサーバーの環境設定1

さくらVPSサーバー(FreeBSD9.1)の環境設定1

 ☆アカウント、グループの追加
  • とりあえずwheelグループにも追加して、suできるようにしておく
  • sudoをインストールしたらいらなくなるけどね

 ☆基本的な追加コマンドをインストール
  • bash
    /usr/ports/shells/bash 配下で make; make install; make clean
  • sudo
    /usr/ports/security/sudo 配下で  make; make install; make clean
  • pkg_tree
    /usr/ports/ports-mgmt/pkg_tree 配下で make; make install; make clean

 ☆ssh環境
  • TeraTermでポート22へログイン(ssh2)
  • インストール直後はチャレンジレスポンス認証でパスワード入力してログインできるので。それで作業を行う
  • .ssh ディレクトリを作成して、その中にauthorized_keysを作成して、PC側から公開鍵をペーストする
  • .ssh は drwx------ 、authorized_keys は -rw------- の属性にする
  •  /etc/ssh/sshd_config を、公開鍵でしかログインできないように修正(rootで作業)
    ChallengeResponseAuthentication no  ← チャレンジレスポンス認証は禁止
    AllowUsers user1 user2     ← 登録したユーザーしかログインできないようにする
  •  # servise sshd restart で再起動して動作確認する

 ☆sudo環境 (rootで実行)
  •  visudo で、sudoできるアカウントを登録する
    user1 ALL = (ALL) ALL ← これでuser1がrootで出来ることを行えるようになる
  •  /etc/group の wheel グループから user1 を外してもOK