Chumby(チャンビー)とは、アメリカ・カリフォルニア州サンディエゴに本社を置く Chumby Industries, Inc.社が開発、販売するWifi情報端末です。ベッドサイドに置くアラーム時計の2.0版といったコンセプトで開発されたChumbyは、Flashで作成されたウィジェットと呼ばれるプログラムを組み込むことで、ニュース、天気予報を始め、写真共有サイトにアップロードされた画像や、お気に入りのブログ、YouTubeなどを3.5インチのタッチスクリーン上で楽しむことのできるガジェットです。
日本においては正規代理店より、日本語化、ソフトウェア&ハードウェアのローカライズ仕様の研究・開発、カスタマーユースや企業における専用ツールの企画、デザイン、開発が推進されています。また、通信事業者と連携を進め、マイホームにおける無線LAN環境のスマートな提供等、Chumbyは今、日本のマーケットに向けて、どんどん便利で楽しい機能が追加され続けています。
私たちは Kubuntu DapperDrake を使用する傾向がありますが、どの Linux システムでもほとんどは動作します。また、通常の GNU toolchain をあらかじめインストールしておいてください。Ubuntu や Debian ベースのシステムでは、sudo apt-get install build-essential でインストールできます。
chumby で使われている ARM9 プロセッサ用にビルドするため、http://wiki.chumby.com/mediawiki/index.php/GNU_Toolchain に従って GNU Toolchain をインストールしてください。
注意: ファームウェアのバージョン1.7からEABIに変更となりました。以前のバージョンのtoolchainでビルドされたlighttpdは動作しないため、最新のtoolchainでビルドし直してください。
# wget http://www.lighttpd.net/download/lighttpd-1.4.16.tar.gz # tar xzvf lighttpd-1.4.16.tar.gz
# cd lighttpd-1.4.16 # ./configure --build=i386-linux --host=arm-linux --prefix=/mnt/usb/lighty # make
Ubuntu では通常、USB メモリ等を /media 以下へマウントするため、あらかじめ空の /mnt/usb を作成する必要があります。
configfile.c: In function 'config_parse_cmd': configfile.c:919: error: 'PATH_MAX' undeclared (first use in this function)
configfile.c:919: error: (Each undeclared identifier is reported only once configfile.c:919: error: for each function it appears in.)
configfile.c:919: warning: unused variable 'oldpwd' make[2]: *** [configfile.o] Error 1 make[2]: Leaving directory `/home/user/lighttpd-1.4.16/src'
make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/user/lighttpd-1.4.16' make: *** [all] Error 2
このような場合は、lighttpd-1.4.16/src/configfile.c の先頭に #include <linux/limits.h> を書き加えてください。
# make install
この時点で、/mnt/usb/lighty 以下に bin と lib と sbin ディレクトリがあるはずです。このディレクトリを、USB のルートに lighty ディレクトリが配置されるようコピーしてください。
まず、lighty ディレクトリ内に html と cgi-bin ディレクトリを作成してください。
HTML ファイルは html 内に、CGI スクリプトは cgi-bin 内に入れます。
また html 内には index.html を置いておくと良いかもしれません。
次に、lighttpd の設定をするため lighttpd.conf を lighty 内に作成する必要があります。
server.modules = ( "mod_cgi", "mod_accesslog" ) server.document-root = "/mnt/usb/lighty/html"
server.errorlog = "/tmp/logs/lighttpd.error.log" accesslog.filename = "/tmp/logs/lighttpd.access.log"
index-file.names = ( "index.php", "index.html", "index.htm", "default.htm" ) cgi.assign = ( "/mnt/usb/lighty/cgi-bin")
mimetype.assign= ( ".pdf" => "application/pdf", ".sig" => "application/pgp-signature", ".spl" =>
"application/futuresplash", ".class" => "application/octet-stream", ".ps" => "application/postscript", ".torrent" =>
"application/x-bittorrent", ".dvi" => "application/x-dvi", ".gz" => "application/x-gzip", ".pac" =>
"application/x-ns-proxy-autoconfig", ".swf" => "application/x-shockwave-flash", ".tar.gz" => "application/x-tgz", ".tgz" =>
"application/x-tgz", ".tar" => "application/x-tar", ".zip" => "application/zip", ".mp3" =>
"audio/mpeg", ".m3u" => "audio/x-mpegurl", ".wma" => "audio/x-ms-wma", ".wax" =>
"audio/x-ms-wax", ".ogg" => "application/ogg", ".wav" => "audio/x-wav", ".gif" =>
"image/gif", ".jpg" => "image/jpeg", ".jpeg" => "image/jpeg", ".png" => "image/png", ".xbm" =>
"image/x-xbitmap", ".xpm" => "image/x-xpixmap", ".xwd" => "image/x-xwindowdump", ".css" =>
"text/css", ".html" => "text/html", ".htm" => "text/html", ".js" => "text/javascript", ".asc" =>
"text/plain", ".c" => "text/plain", ".cpp" => "text/plain", ".log" => "text/plain", ".conf" =>
"text/plain", ".text" => "text/plain", ".txt" => "text/plain", ".dtd" => "text/xml", ".xml" =>
"text/xml", ".mpeg" => "video/mpeg", ".mpg" => "video/mpeg", ".mov" => "video/quicktime", ".qt" =>
"video/quicktime", ".avi" => "video/x-msvideo", ".asf" => "video/x-ms-asf", ".asx" =>
"video/x-ms-asf", ".wmv" => "video/x-ms-wmv", ".bz2" => "application/x-bzip", ".tbz" =>
"application/x-bzip-compressed-tar", ".tar.bz2" => "application/x-bzip-compressed-tar" )
これはあくまでも最低限必要な設定だけであるということに注意してください。実際、私たちは結局 lighttpd モジュール (lib ディレクトリ内にあります) の大部分をビルドすることになったので、あなたも lighttpd の機能を有効にするためにオンラインドキュメントを見直す必要があるかもしれません。
USB のルートディレクトリに debugchumby を下記の内容で作成します。
#!/bin/sh # kill the built-in web server killall httpd # create the log directory mkdir /tmp/logs
# start lighttpd LD_LIBRARY_PATH=/mnt/usb/lighty/lib /mnt/usb/lighty/sbin/lighttpd -f /mnt/usb/lighty/lighttpd.conf
これで chumby の IPアドレスへ接続すれば web サーバが応答するはずです。chumby の IP アドレスはコントロールパネルの 設定->Chumby情報 で調べることができます。
以後ログファイルは、RAM 上の /tmp 内に容量が足りなくなるまで書き込まれます。もしログファイルを USB 内に書き込みたい場合、あるいはログファイルが不要な場合 (/dev/null へ書き込む) は、lighttpd.conf を編集してください。
このリンク先で配布されているlighttpdは古いバージョンのtoolchainでビルドされたもので、最新バージョンのChumbyでは動作しません。
心配する必要はありません。既にビルドされたものを用意してあります。