- 追加された行はこの色です。
- 削除された行はこの色です。
[[bc10]] ~
[[bc10-router]] ~
#contents
* buildrootについて [#q76f29a4]
buildrootは以下のURLにあるbeagleboard-xm用にカスタムされたbuildrootを使用しています。~
bc10で動作させるためのビルド環境の構築とビルド手順を記載します。~
- Embedded HOWTOs ~
http://blog.galemin.com/ ~
- github/MaxGalemin /buildroot ~
https://github.com/MaxGalemin/buildroot ~
* Toolchainについて [#oe9c45b3]
今回使用するbuildrootのデフォルトToolchainはCodeSourceryの2011.03ですが~
[[bc10-router/arago-project]]で使用したTIが配布しているToolchain~
ti-sdk-beagleboard-05.05.01.00を使用します。~
* ビルド環境構築手順について [#d1738175]
git cloneのみ以下のURLに記載されている手順で行います。~
その後、Toolchainの取得、bc10用ファイルの配置を行います。~
http://blog.galemin.com/2012/03/buildroot-2012-02-for-beagleboard-xm-with-li-5m03-mt9p031-camera-support/
** buildrootの取得 [#ib5f94bf]
gitコマンドを使用しbuildrootを取得します。
$ cd ${HOME}
$ mkdir work_router
$ cd work_router
$ git clone https://github.com/MaxGalemin/buildroot.git
** Toolchainのインストール [#o4482f6f]
TIのWebサイトからToolchainを適当なディレクトリにダウンロードします。~
またインストール先を指定しなければ${HOME}/ti-sdk-beagleboard-05.05.01.00~
以下にToolchainが展開されます。~
$ wget http://software-dl.ti.com/dsps/dsps_public_sw/am_bu/sdk/BeagleBoardSDK/latest/exports/ti-sdk-beagleboard-05.05.01.00-Linux-x86-Install
$ chmod +x ti-sdk-beagleboard-05.05.01.00-Linux-x86-Install
consoleでインストールするため --mode consoleオプションを付けて実行します。~
$ ./ti-sdk-beagleboard-05.05.01.00-Linux-x86-Install --mode console
インストールしたToolchainのPATHをbashrcの末尾に設定します。~
$ vi ${HOME}/.bashrc
PATH=${HOME}/ti-sdk-beagleboard-05.05.01.00/linux-devkit/bin:$PATH
$ source ${HOME}/.bashrc
** bc10用のconfig配置 [#w323c746]
bc10用のconfigファイルは
#ref(linux-3.2.8.config)、#ref(bc10_defconfig)、~
#ref(busybox-1.19.x.config)があります。~
それぞれダウンロードをしてください。~
#ref(linux-3.2.8.config) ~
#ref(bc10_defconfig) ~
#ref(busybox-1.19.x.config) ~
があります。それぞれ適当なディレクトリにダウンロードしてください。~
~
各ファイルの配置は以下のとおりです。~
boardディレクトリにbc10ディレクトリを作成してください。~
kernel-patchesディレクトリはbuildroot/board/beagleboard/xm/kernel-patchesを~
コピーします。~
busybox-1.19.x.configは同名のファイルが存在しますので元のファイルを適当な名前に~
リネームしてください。~
work_router/
`- buildroot/
|- board/
| `-bc10/
| |- kernel-patches/
| `- linux-3.2.8.config
|- configs/
| `- bc10_defconfig
`-package/
`- busybox/
`- busybox-1.19.x.config (bc10用編集済みbusyboxのconfigファイル)
*** 配置ファイルの設定確認 [#b8565f74]
配置完了後、make bc10_defconfig、make menuconfigコマンドを実行して~
各設定が以下のようになっていることを確認してください。~
特にToolchain Pathは上記の設定が記載されていること(インストール先が異なる場合は適宜変更をしてください)、~
KernelのCustom kernel patches、Configuration file pathのディレクトリ指定が~
board/bc10/を設定している事を確認してください。~
$ cd ~/work_router/buildroot
$ make bc10_defconfig
$ make menuconfig
Toolchain --->
|- Toolchain type(External toolchain)
|- Toolchain (Custom toolchain)
|- (${HOME}/ti-sdk-beagleboard-05.05.01.00/linux-devkit) Toolchain Path
|- ($(ARCH)-arago-linux-gnueabi) Toolchain prefix
|- External toolchain C library (glibc)
...
|- [*] Toolchain has C++ support?
...
Package Selection for the target --->
...
|- (package/busybox/busybox-1.19.x.config) BusyBox configuration file to use?
...
Kernel --->
...
|- (board/bc10/kernel-patches) Custom kernel patches
...
|- (board/bc10/linux-3.2.8.config) Configuration file path
...
** buildrootの修正、変更について [#xc5a18b2]
TIのToolchainを使用した際、CodeSourcery2011.03のToolchainとは~
バージョンなど幾つもの異なる点があるためエラーが起こる箇所が何点かあります。~
その点を予め修正、変更しビルドを実行します。~
~
基本的に[[bc10-router/arago-project]]で使用しているバージョンに合わせる~
方法で修正、変更を行います。~
*** libtoolのバージョン変更 [#if791a68]
buildrootのlibtoolのバージョンを2.2.10から[[bc10-router/arago-project]]で~
使用している2.2.6bに変更します。~
これは2.2.10のままではホストPCのlibtoolが2.2.6bでその上で生成されたlibtoolと~
ライブラリのバージョン不一致が起こる事を防ぐためです。~
$ cd ${HOME}/work_router/buildroot
$ vi package/libtool/libtool.mk
- LIBTOOL_VERSION = 2.2.10
+ # LIBTOOL_VERSION = 2.2.10
+ LIBTOOL_VERSION = 2.2.6b
LIBTOOL_SOURCE = libtool-$(LIBTOOL_VERSION).tar.gz
*** ncursesのバージョン変更 [#b5c59daf]
ncursesのバージョンを5.7から5.9に変更します。~
これも同様にTIのToolchainでのビルド時にエラーが起こる事を回避するためです。~
$ cd ${HOME}/work_router/buildroot
$ vi package/ncurses/ncurses.mk
--- ncurses.mk_orig 2012-12-21 17:10:01.570116798 +0900
+++ ncurses.mk 2012-12-21 15:30:30.220956375 +0900
@@ -23,27 +23,52 @@
# USA
# TARGETS
-NCURSES_VERSION = 5.7
+#NCURSES_VERSION = 5.7
+NCURSES_VERSION = 5.9
NCURSES_SITE = $(BR2_GNU_MIRROR)/ncurses
NCURSES_INSTALL_STAGING = YES
NCURSES_DEPENDENCIES = host-ncurses
+HOSTCPPFLAGS += "-D_GNU_SOURCE"
+
NCURSES_CONF_OPT = \
+ --enable-widec \
+ --without-progs \
--with-shared \
- --without-cxx \
- --without-cxx-binding \
--without-ada \
- --without-progs \
- --without-tests \
+ --enable-hard-tabs \
+ --enable-xmc-glitch \
+ --enable-colorfgbg \
--disable-big-core \
- --without-profile \
- --disable-rpath \
- --enable-echo \
- --enable-const \
- --enable-overwrite \
- --enable-broken_linker \
+ --disable-rpath-hack \
+ --with-ticlib \
+ --with-termlib=tinfo \
+ --enable-sigwinch \
+ --enable-pc-files \
+ --with-build-cc="${HOSTCC}" \
+ --with-build-cpp="${HOSTCPP}" \
+ --with-build-ld="${HOSTLD}" \
+ --with-build-cflags="${HOSTCFLAGS}" \
+ --with-build-cppflags='${HOSTCPPFLAGS}' \
+ --with-build-ldflags='${HOSTLDFLAGS}' \
--disable-static
+#NCURSES_CONF_OPT = \
+# --with-shared \
+# --without-cxx \
+# --without-cxx-binding \
+# --without-ada \
+# --without-progs \
+# --without-tests \
+# --disable-big-core \
+# --without-profile \
+# --disable-rpath \
+# --enable-echo \
+# --enable-const \
+# --enable-overwrite \
+# --enable-broken_linker \
+# --disable-static
+
ifneq ($(BR2_ENABLE_DEBUG),y)
NCURSES_CONF_OPT += --without-debug
endif
@@ -99,7 +124,7 @@ endif
define NCURSES_INSTALL_TARGET_CMDS
mkdir -p $(TARGET_DIR)/usr/lib
- cp -dpf $(NCURSES_DIR)/lib/libncurses.so* $(TARGET_DIR)/usr/lib/
+ cp -dpf $(NCURSES_DIR)/lib/* $(TARGET_DIR)/usr/lib/
$(NCURSES_INSTALL_TARGET_PANEL)
$(NCURSES_INSTALL_TARGET_FORM)
$(NCURSES_INSTALL_TARGET_MENU)
@@ -120,6 +145,32 @@ define NCURSES_INSTALL_TARGET_CMDS
$(NCURSES_INSTALL_TARGET_DEVFILES)
endef # NCURSES_INSTALL_TARGET_CMDS
+
+
+
+# define NCURSES_INSTALL_TARGET_CMDS
+# mkdir -p $(TARGET_DIR)/usr/lib
+# cp -dpf $(NCURSES_DIR)/lib/libncurses.so* $(TARGET_DIR)/usr/lib/
+# $(NCURSES_INSTALL_TARGET_PANEL)
+# $(NCURSES_INSTALL_TARGET_FORM)
+# $(NCURSES_INSTALL_TARGET_MENU)
+# ln -snf /usr/share/terminfo $(TARGET_DIR)/usr/lib/terminfo
+# mkdir -p $(TARGET_DIR)/usr/share/terminfo/x
+# cp -dpf $(STAGING_DIR)/usr/share/terminfo/x/xterm $(TARGET_DIR)/usr/share/terminfo/x
+# cp -dpf $(STAGING_DIR)/usr/share/terminfo/x/xterm-color $(TARGET_DIR)/usr/share/terminfo/x
+# cp -dpf $(STAGING_DIR)/usr/share/terminfo/x/xterm-xfree86 $(TARGET_DIR)/usr/share/terminfo/x
+# mkdir -p $(TARGET_DIR)/usr/share/terminfo/v
+# cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt100 $(TARGET_DIR)/usr/share/terminfo/v
+# cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt102 $(TARGET_DIR)/usr/share/terminfo/v
+# cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt200 $(TARGET_DIR)/usr/share/terminfo/v
+# cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt220 $(TARGET_DIR)/usr/share/terminfo/v
+# mkdir -p $(TARGET_DIR)/usr/share/terminfo/a
+# cp -dpf $(STAGING_DIR)/usr/share/terminfo/a/ansi $(TARGET_DIR)/usr/share/terminfo/a
+# mkdir -p $(TARGET_DIR)/usr/share/terminfo/l
+# cp -dpf $(STAGING_DIR)/usr/share/terminfo/l/linux $(TARGET_DIR)/usr/share/terminfo/l
+# $(NCURSES_INSTALL_TARGET_DEVFILES)
+# endef # NCURSES_INSTALL_TARGET_CMDS
+
*** udev-181のpatch追加 [#o9d998ff]
udev-181でもTIのToolchain使用時にエラーが起こります、また[[bc10-router/arago-project]]で~
使用しているudevは165でダウンロード元サイトには100以前と170以降しか~
アーカイブされていないため、バージョンは181のままでエラーを回避するpatchを~
package/udev/udev-181-define-trigger-happy.patchという名前で作成します。~
patchの内容は以下の通りです。~
$ vi package/udev/udev-181-define-trigger-happy.patch
diff -Naur udev-181.orig/src/udev-builtin-input_id.c udev-181/src/udev-builtin-input_id.c
--- udev-181.orig/src/udev-builtin-input_id.c 2012-03-05 11:41:10.000000000 -0500
+++ udev-181/src/udev-builtin-input_id.c 2012-03-05 11:46:31.000000000 -0500
@@ -30,6 +30,10 @@
#include "udev.h"
+#ifndef BTN_TRIGGER_HAPPY
+#define BTN_TRIGGER_HAPPY 0x2c0
+#endif
+
/* we must use this kernel-compatible implementation */
#define BITS_PER_LONG (sizeof(unsigned long) * 8)
#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1)
** イメージの作成 [#q85964e0]
上記の手順まで完了後ビルドを実行します。~
$ make
ビルド完了後、work_router/buildroot/output/imagesに以下の各ファイルが~
作成されます。~
MLO rootfs.tar u-boot.img uEnv.txt uImage
*** uEnv.txtの編集 [#abc12934]
uboot用環境設定ファイルuEnv.txtは上記までの手順で作成されますが、~
以下の内容に変更します。~
--- __uEnv.txt_orig 2012-12-18 15:20:53.344986130 +0900
+++ uEnv.txt 2012-12-18 15:21:06.901053349 +0900
@@ -1,3 +1,2 @@
-mpurate=1000
-dvimode=1024x768MR-16@60
-uenvcmd=mmc init; run loaduimagefat; run mmcboot
+mmcroot=/dev/mmcblk0p2 rw
+uenvcmd=run loaduimagefat; run mmcboot
* SDへの書き込み [#x964d970]
[[bc10/booting 起動用SDカードの作成>http://labs.beatcraft.com/ja/index.php?bc10%2Fbooting#q0449272]]の手順で作成されたSDカードを~
使用する前提で記載しています。FAT32、Ext3それぞれのディレクトリ名は~
/media/FAT,/media/EXT3とします。~
上記までで作成したファイルをそれぞれのディレクトリにコピー、展開をします。~
$ cp MLO /media/FAT
$ cp u-boot.img /media/FAT
$ cp uImage /media/FAT
$ sudo tar xvf rootfs.tar -C /media/EXT3
以上で、SDへの書き込みは完了です。 ~
* 更新記録 [#df5632a3]
2012/12/21 初稿掲載~
RIGHT:syariten