OpenWRT for Nexx WT1520

目標は、WT1520に挿したUSBメモリに入ってる地デジTSを、Androidで快適に観ること。多少面倒で良ければ、そのままでもOKだけど、

  • SMBだと激遅
  • FTPだとFFW/RWDが今いち、また(プレイヤーのせいかもしれんが)途中で固まる
  • DLNAは動いてない(backdoorのtelnetでログインしてみたら、upnpdは動いてるがこれはたぶんポート解放絡み、minidlna.confはあるけどminidlnaバイナリが無い)

というわけで、いつものオレオレDLNAサーバを組み込んだfirmwareを作ってみたい。ひとまずは普通のHTTPサーバが動けばいいかな。

環境構築

VirtualBox上に、lubuntu-14.04.1_x86をインストール。特に工夫もなし。

Synapticで、make、git、subversion、openssh-serverを追加。
一度リブートして、puttyからsshして続き。

レポジトリ展開

勝手が判らんので、素直にWiKiの通り
http://wiki.openwrt.org/doc/howto/buildroot.exigence

$ sudo apt-get install git-core build-essential

$ git clone git://git.openwrt.org/openwrt.git

$ cd openwrt
$ ./scripts/feeds update -a
$ ./scripts/feeds install -a

WT1520向けのパッチをあてる。ただしpastebinにあるパッチは、何故か向きが逆。
パッチを眺めながら手で編集した。
https://forum.openwrt.org/viewtopic.php?pid=246678#p246678

オリジナルの方も参考に。
https://github.com/hackruu/nexx-wt1520-openwrt

ビルド準備の準備

さて

$ make defconfig
Checking 'working-make'... ok.
Checking 'case-sensitive-fs'... ok.
Checking 'getopt'... ok.
Checking 'fileutils'... ok.
Checking 'working-gcc'... ok.
Checking 'working-g++'... ok.
Checking 'ncurses'... failed.
Checking 'zlib'... failed.
Checking 'gawk'... failed.
Checking 'unzip'... ok.
Checking 'bzip2'... ok.
Checking 'perl'... ok.
Checking '/usr/bin/python2.7'... ok.
Checking 'wget'... ok.
Checking 'git'... ok.
Checking 'gnutar'... ok.
Checking 'svn'... ok.
Checking 'openssl'... ok.
Checking 'gnu-find'... ok.
Checking 'getopt-extended'... ok.
Checking 'file'... ok.
Checking 'non-root'... ok.

Build dependency: Please install ncurses. (Missing libncurses.so or ncurses.h)
Build dependency: Please install zlib. (Missing libz.so or zlib.h)
Build dependency: Please install GNU awk.

Prerequisite check failed. Use FORCE=1 to override.
make: *** [tmp/.prereq-build] エラー 1

無いものは、Synapticから適当に検索して、libncurses5-dev、zlib1g-dev、gawkを追加。
もう一度 defconfigして。。OK

$ make prereq
$ make menuconfig

う。Target Profileに、NEXX WT-1520が出てこない。。。Wikiの下の方に、

After add a new board, you may should clean the tmp folder first.

とあるので、tmpを消してmake menuconfigすると選択肢に出てきた。
http://wiki.openwrt.org/doc/devel/add.new.device

ビルド準備

Target System: Ralink RT288x/RT3xxx
Subtarget: RT3x5x/RT5350 base board
Target Profile: NEXX WT-1520

パッケージは下記を参考に適当に。
https://github.com/hackruu/nexx-wt1520-openwrt/blob/master/build.sh

ビルド

$ make kernel-menuconfig

良く分からんので、そのまま終了して保存。

https://github.com/hackruu/nexx-wt1520-openwrt
のFILES_1520の下を、openwrt/filesとしてコピー。

$ make defconfig
$ make V=99