説明例2 †
いくつかのページを参考にしながらまとめてみました。
呪文の意味がよくわかってないので無駄な部分があるのかもしれません。
- first.html, second.html (下記参照)
- PuTTY (telnet/SSHクライアント)
- linux.bin
- openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma
- out.hex
- HFS (HTTP File Server)
- TFTPサーバ
- viの操作説明
- 有線LANのIPアドレスを
IP: 169.254.255.2
Subnet mask: 255.255.255.0
Gateway: 169.254.255.1
DNS: 169.254.255.1
に設定
- PCとLa FoneraをLANケーブルで接続
- 設定ページでFirmware Version: 0.7.1 r1 かそれ以前であることを確認
(r2以降の場合は適当なページを参照のこと)
- ブラウザからfirst.htmlとsecond.htmlをsubmit
- puttyからsshで169.254.255.1にログイン
user: root / PW: admin
- mv /etc/init.d/dropbear /etc/init.d/S50dropbear
- vi /etc/firewall.user
- 以下の行のコメントを解除
# iptables -t nat -A prerouting_rule -i $WAN -p tcp -dport 22 -j ACCEPT
# iptables -A input_rule -i $WAN -p tcp -dport 22 -j ACCEPT
- 保存して終了
- vi /bin/thinclient
- 以下の行をコメントアウト
. /tmp/.thinclient.sh
- 代わりに以下の行を挿入
cp /tmp/.thinclient.sh /tmp/thinclient-$(date '+%Y%m%d-%H%M')
- 保存して終了
- HFSを起動して
openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma
out.hex
の2つのファイルを送信できるようにする
- wget http://169.254.255.2/openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma
- mtd -e vmlinux.bin.l7 write openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma vmlinux.bin.l7
- Writing from openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma to vmlinux.bin.l7 ... [w]で2分くらいかかる
- reboot
- 再起動までに2分ほどかかる
- PuTTYでrestart session
- user: root / PW: adminでログイン
- wget http://169.254.255.2/out.hex
- mtd -e "RedBoot config" write out.hex "RedBoot config"
- La Foneraの電源を切る
- 有線LANのIPアドレスを
IP: 192.168.1.2
Subnet mask: 255.255.255.0
Gateway: 192.168.1.254
DNS: 192.168.1.254
に設定
- TFTPサーバを起動しlinux.binが入っているフォルダに指定する
- La Foneraの電源を入れる
- PuTTYから192.168.1.254 9000にtelnet
- RedBoot> ip_address -l 192.168.1.254 -h 192.168.1.2
- RedBoot> load -r -v -b 0x80041000 linux.bin
- RedBoot> fis init
- RedBoot> fis create linux
- 15分待つ(45分以上かかる場合もあるらしい)
- 次の通り入力
RedBoot> fconfig
Run script at boot: true
Boot script:
.. fis load -l vmlinux.bin.l7
.. exec
Enter script, terminate with empty line
>> fis load -l linux
>> exec
>>
Boot script timeout (1000ms resolution): 10
Use BOOTP for network configuration: false
Gateway IP address:
Local IP address: 192.168.1.254
Local IP address mask: 255.255.255.0
Default server IP address:
Console baud rate: 9600
GDB connection port: 9000
Force console for special debug messages: false
Network debug at boot time: false
Update RedBoot non-volatile configuration - continue (y/n)? y
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
- RedBoot>reset
- PCのIPアドレスの設定を自動取得に戻す
- 192.168.1.1
ID: root / PW:admin
first.html †
<html>
<head></head>
<body>
<center>
<form method="post" action="http://169.254.255.1/cgi-bin/webif/connection.sh" enctype="multipart/form-data">
<input name="username" value="$(/usr/sbin/iptables -I INPUT 1 -p tcp -dport 22 -j ACCEPT)" size="68">
<input type="submit" name="submit" value="Submit">
</form>
</center>
</body>
</html>
second.html †
<html>
<head></head>
<body>
<center>
<form method="post" action="http://169.254.255.1/cgi-bin/webif/connection.sh" enctype="multipart/form-data">
<input name="username" value="$(/etc/init.d/dropbear)" size="68"><input type="submit" name="submit" value="Submit">
</form>
</center>
</body>
</html>