#!/usr/bin/expect -f
spawn cu -l /dev/ttyUSB0 -s 9600
#match_max 100000
set timeout 3600
# Look for passwod prompt
#expect "Connected.\r\n"
# send blank line (\r) to make sure we get back to gui
expect "enter ^C to abort"
send \003
expect "RedBoot>"
send -- "ip_address -h 44.156.137.162 -l 44.156.137.188/27\r"
expect "RedBoot>"
send -- "load -r -b %\{FREEMEMLO\} openwrt-atheros-2.6-vmlinux.lzma\r"
expect "RedBoot>"
send -- "fis init\r"
expect "(y/n)? "
send -- "y\r"
expect "RedBoot>"
send -- "fis create -e 0x80041000 -r 0x80041000 vmlinux.bin.l7\r"
expect "RedBoot>"
send -- "load -r -b %\{FREEMEMLO\} openwrt-atheros-2.6-root.jffs2-64k\r"
expect "RedBoot>"
send -- "fis create -l 0x006F0000 rootfs\r"
expect "RedBoot>"
send -- "fconfig -d\n"
expect "Run script at boot:"
send -- "true\n"
expect "Enter script, terminate with empty line"
send -- "fis load -l vmlinux.bin.l7\rexec\r\r"
expect "Boot script timeout (1000ms resolution):"
send -- "10\n"
expect "Use BOOTP for network configuration:"
send -- "false\n"
expect "Gateway IP address:"
send -- "44.156.137.161\n"
expect "Local IP address:"
send -- "44.156.137.188\n"
expect "Local IP address mask:"
send -- "255.255.255.224\n"
expect "Default server IP address:"
send -- "44.156.137.162\n"
expect "Console baud rate:"
send -- "9600\n"
expect "GDB connection port:"
send -- "23\n"
expect "Force console for special debug messages:"
send -- "false\n"
expect "Network debug at boot time:"
send -- "false\n"
expect "(y/n)?"
send -- "y\r"
expect "RedBoot>"
send -- "reset\r"
es futas kozben:
% expect fonera-openwrt.exp
spawn cu -l /dev/ttyUSB0 -s 9600
Connected.
+PHY ID is 0022:xxxx
Ethernet eth0: MAC address 00:18:84:xx:xx:xx
IP: 0.0.0.0/255.255.255.255, Gateway: 0.0.0.0
Default server: 0.0.0.0
RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version v1.3.0 - built 16:57:58, Aug 7 2006
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Board: ap51
RAM: 0x80000000-0x81000000, [0x80040450-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 1.000 seconds - enter ^C to abort
^C
RedBoot> ip_address -h 44.156.137.162 -l 44.156.137.188/27
IP: 44.156.137.188/255.255.255.224, Gateway: 0.0.0.0
Default server: 44.156.137.162
RedBoot> load -r -b %{FREEMEMLO} openwrt-atheros-2.6-vmlinux.lzma
Using default protocol (TFTP)
Raw file loaded 0x80040800-0x801007ff, assumed entry at 0x80040800
RedBoot> fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> fis create -e 0x80041000 -r 0x80041000 vmlinux.bin.l7
... Erase from 0xa8030000-0xa80f0000: ............
... Program from 0x80040800-0x80100800 at 0xa8030000: ............
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> load -r -b %{FREEMEMLO} openwrt-atheros-2.6-root.jffs2-64k
Using default protocol (TFTP)
Raw file loaded 0x80040800-0x801e07ff, assumed entry at 0x80040800
RedBoot> fis create -l 0x006F0000 rootfs
... Erase from 0xa80f0000-0xa87e0000: ...............................................................................................................
... Program from 0x80040800-0x801e0800 at 0xa80f0000: ..........................
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> fconfig -d
Run script at boot: true ? true
Boot script:
.. fis load -l vmlinux.bin.l7
.. exec
Enter script, terminate with empty line
>> fis load -l vmlinux.bin.l7
>> exec
>>
Boot script timeout (1000ms resolution): 1 ? 10
Use BOOTP for network configuration: false ? false
Gateway IP address: ? 44.156.137.161
Local IP address: ? 44.156.137.188
Local IP address mask: 255.255.255.255 ? 255.255.255.224
Default server IP address: ? 44.156.137.162
Console baud rate: 9600 ? 9600
GDB connection port: 9000 ? 23
Force console for special debug messages: false ? false
Network debug at boot time: false ? false
Update RedBoot non-volatile configuration - continue (y/n)? y
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> reset
- snitt_ blogja
- A hozzászóláshoz be kell jelentkezni
- 1159 megtekintés