- 追加された行はこの色です。
- 削除された行はこの色です。
[[RMR9000-技術情報]]
#contents
以下の手順に沿って、お手元のLinux PCにSDKをダウンロードし、開発環境を準備下さい。
*Download RMR9000 development SDK [#gb1d58f8]
*Step0: RMR9000 development SDKのダウンロード [#gb1d58f8]
-access : http://220.110.201.21/openwrt/stable (Thinktube 公開サーバー)
-click tt-openwrt-sdk-stable-3.1.6.tar.gz and starts download (Stable版を選択)
-click tt-openwrt-sdk-stable-3.1.7.tar.gz and starts download (最新Stable版を選択)
*Build openwrt-tt [#j5e94d11]
tar zxvf tt-openwrt-sdk-stable-3.1.6.z.tar.gz
*Step1: ソースツリーのBuild [#e899707b]
註:処理の中でインターネットにアクセスしソースをダウンロードしますのでPCからインターネットへのアクセスが可能な環境で実行ください。
tar zxvf tt-openwrt-sdk-stable-3.1.7.tar.gz
cd tt-openwrt-sdk
cd openwrt-tt
cp default-config-rsp .config
make V=99 (Build完了までに暫く時間かかります)
-Note: you might need to install following packages before "make"
-参考: makeコマンドがエラーで終了した場合は、以下のパッケージが手元のPCに導入済みか確認ください。導入手順は以下のとおりです。(ubuntuの場合)
sudo apt-get install build-essential flex gawk gettext libncurses5-dev zlib1g-dev git-core subversion (上記mnakeを実行前に必要な場合があります)
sudo apt-get install gcc-multilib (you need to install 32bit gcc,if you use 64bit system )
-Note: During make process, packages will be downloaded from 220.110.201.21/openwrt/stable/sources/ by default. If the target package is not found there, then it will try to get it from the global site defined in Makefile of each package. if you want it download it only from the global site, then do the next
-参考: make処理の途中でソフトウェアソースコードをThinktube公開サーバよりダウンロードします。もし対象のパッケージが当該サーバーに存在しない場合は、クラウド上のソースコード提供サイトよりダウンロードを試みます。以下コマンドを実行するとまず最初にダウンロードを試みるサイトを確認いただくことができます。
execute "make menuconfig"
go to [Advanced configuration options (for developers)->local mirror for source packages]
remove "220.110.201.21/openwrt/stable/sources/"
save and exit
* Trouble shooting [#c57649e5]
** build failure due to download a certain package [#u9e94aef]
-solution
*Step2: 独自ソフトウェアのBuild [#y1951a76]
以下の例では、 my-packages というディレクトリを作成し、その下にパッケージごとにサブディレクトリを作成します。
cd ~/tt-openwrt-sdk
mkdir my-packages
mkdir helloWorld
cd helloWorld
edit Makefile (以下参照)
mkdir src
edit src/Makefile (以下参照)
edit src/helloWorld.c (以下参照)
cd ~/tt-openwrt-sdk
edit feeds.conf.default (以下参照)
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig --> select "M" for Samples/helloWorld、 "save"で終了
make packages/feeds/my-packages/helloWorld/compile V=99
make packages/feeds/my-packages/helloWorld/install V=99
make packages/index V=99
- helloWorld/Makefileの例~
参照 http://wiki.openwrt.org/doc/devel/packages
include $(TOPDIR)/rules.mk
PKG_NAME:=helloWorld
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/helloWorld
CATEGORY:=Samples
MAINTAINER:=Takayuki Kaiso <tkaiso@thinktube.com>
TITLE:=Thinktube sample application
endef
define Package/helloWorld/description
Sample application to learn how to make a package.
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
define Package/helloWorld/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/helloWorld $(1)/usr/bin/
endef
$(eval $(call BuildPackage,helloWorld))
- helloWorld/src/Makefile の例
TARGET = helloWorld
OBJS = helloWorld.o
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) -o $(TARGET) $(OBJS)
clean:
rm -f *.o *~ $(TARGET)
- helloWorld/src/helloWorld.cの例
int main()
{
printf("hello world \n");
return 0;
}
- tt-openwrt-sdk/feeds.conf.default の編集
src-link openwrt ../../packages-openwrt
#src-link thinktube ../../packages-thinktube --> comment out or remove
src-link luci ../../luci/contrib/package
src-link my_packages ../../my-packages --> add this line !
*Step3: BuildしたパッケージをRMR9000へ導入 [#f71fae34]
- PCにてWebサーバーを起動、WebサーバーがBuildパッケージへアクセスできるようにアクセスパスを設定
ln -s ~/tt-openwrt-sdk/openwrt-tt/ tt-openwrt-sdk
- PCからRMR9000のWebサーバへアクセス
- 「システム」->「ソフトウェア」をクリック
- 「パッケージリストとインストールターゲットの編集」をクリックし、1行目のWebサーバ(この場合はBuildを行ったPC)のアドレスとパスを設定し保存
#src/gz snapshots http://220.110.201.21/openwrt/stable/ar71xx/packages
src/gz snapshots http://192.168.1.1/tt-openwrt-sdk/bin/ar71xx/packages
- 「システム」->「ソフトウェア」へ戻る
-- 画面上部の「パッケージリストの更新」をクリック
-- 画面下部の「インストール可能なパッケージ」に以下が表示されていることを確認し、「インストール」をクリック
インストール helloWorld 1 Sample application to learn how to make a package.
*注意点 [#o2c8ac27]
- Step1のBuildによりtt-openwrt-sdk/openwrt-tt/bin/ar71xxにファームウェア・イメージ・ファイルが作成されますが、~
こちらにはMeshCruzerなどのThinktube提供するパッケージは含まれていませんので、このファイルを使用して~
RMR9000のファームウェア更新は行わないでください。~
あくまでも当SDKは、個別パッケージのBuildならびに追加実装の目的でご利用ください。
- ファームウェア全体の更新を行うときは、Thinktube公開サーバーhttp://220.110.201.21/openwrt/stable/ にある~
最新版ファームウェアをダウンロードして更新を行ってください。
#br
#br
* トラブルシューティング [#c57649e5]
- 特定パッケージがダウンロードできない場合
--download that package from http://220.110.201.21/openwrt/stable/sources/
--copy that package into your tt-openwrt-sdk/openwrt-tt/dl
--restart building by "make V=99"
*References [#n36d2355]
-build environment
--http://wiki.openwrt.org/doc/start
--http://wiki.openwrt.org/doc/howto/buildroot.exigence
--http://downloads.openwrt.org/docs/buildroot-documentation.html
--http://wiki.openwrt.org/about/toolchain
-create packages
--http://wiki.openwrt.org/doc/devel/packages
--http://wiki.openwrt.org/doc/howtobuild/single.package
--https://forum.openwrt.org/viewtopic.php?id=16040$