В ос Debian GNU/Linux потребовалось установить следующие пакеты:
sudo apt-get install minicom lrzsz
Запускаем minicom
. Видим:
Welcome to minicom 2.6.1 OPTIONS: I18n Compiled on Feb 11 2012, 18:12:55. Port /dev/ttyS0 Press CTRL-A Z for help on special keys
После включения устройства появляется следующее:
U-Boot 1.1.4 (Jul 15 2010 - 12:16:03) AP81 (ar7100) U-boot DRAM: sri 32 MB id read 0x100000ff flash size 4MB, sector count = 64 Flash: 4 MB Using default environment In: serial Out: serial Err: serial Net: ag7100_enet_initialize... No valid address in Flash. Using fixed address bsingle_phy = 0 eth0: 00:03:7f:09:0b:ad eth0 up eth0 Autobooting in 1 seconds
Вводим команду
tpl
Появляется приглашение командной строки:
ar7100> ar7100> loady ## Ready for binary (ymodem) download to 0x81000000 at 115200 bps...
Нажимаем CTRL+A Z
и переходим в пункт загрузки файла ( )
Выбираем файл для загрузки и протокол отправки (ymodem)
После этого видим
Cm - CRC mode, 30722(SOH)/0(STX)/0(CAN) packets, 5 retries ## Total Size = 0x003c0000 = 3932160 Bytes ar7100>
Далее задаём команды записи загруженной в устройство прошивки в нужную область памяти:
ar7100> erase 0xbf020000 +0x3c0000 First 0x2 last 0x3d sector size 0x10000 61 Erased 60 sectors ar7100> cp.b 0x81000000 0xbf020000 0x3c0000 Copy to Flash... write addr: bf020000 done ar7100>
Перезагружаем устройство:
ar7100> reset Resetting... U-Boot 1.1.4 (Jul 15 2010 - 12:16:03) AP81 (ar7100) U-boot DRAM: sri 32 MB id read 0x100000ff flash size 4MB, sector count = 64 Flash: 4 MB Using default environment In: serial Out: serial Err: serial Net: ag7100_enet_initialize... No valid address in Flash. Using fixed address bsingle_phy = 0 eth0: 00:03:7f:09:0b:ad eth0 up eth0 Autobooting in 1 seconds## Booting image at bf020000 ... Uncompressing Kernel Image ... OK Starting kernel ... OpenWrt kernel loader for AR7XXX/AR9XXX Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org> Looking for OpenWrt image... found at 0xbf022000 Decompressing kernel... done! Starting kernel at 80060000... [ 0.000000] Linux version 3.10.58 (openwrt@gb-13) (gcc version 4.8.3 (OpenWr4 [ 0.000000] bootconsole [early0] enabled [ 0.000000] CPU revision is: 00019374 (MIPS 24Kc) [ 0.000000] SoC: Atheros AR9132 rev 2 [ 0.000000] Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:100.000MHz, Ref:5.00z [ 0.000000] Determined physical RAM map: [ 0.000000] memory: 02000000 @ 00000000 (usable) [ 0.000000] Initrd not found or empty - disabling initrd [ 0.000000] Zone ranges: [ 0.000000] Normal [mem 0x00000000-0x01ffffff] [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x00000000-0x01ffffff] [ 0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes. [ 0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32s [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pa8 [ 0.000000] Kernel command line: board=TL-WA901ND-v2 console=ttyS0,115200 rd [ 0.000000] PID hash table entries: 128 (order: -3, 512 bytes) [ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) [ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) [ 0.000000] Writing ErrCtl register=00000000 [ 0.000000] Readback ErrCtl register=00000000 [ 0.000000] Memory: 28588k/32768k available (2374k kernel code, 4180k reserv) [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] NR_IRQS:51 [ 0.000000] Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104) [ 0.080000] pid_max: default: 32768 minimum: 301 [ 0.080000] Mount-cache hash table entries: 512 [ 0.090000] NET: Registered protocol family 16 [ 0.100000] MIPS: machine is TP-LINK TL-WA901ND v2 [ 0.330000] bio: create slab <bio-0> at 0 [ 0.340000] Switching to clocksource MIPS [ 0.350000] NET: Registered protocol family 2 [ 0.350000] TCP established hash table entries: 512 (order: 0, 4096 bytes) [ 0.350000] TCP bind hash table entries: 512 (order: -1, 2048 bytes) [ 0.360000] TCP: Hash tables configured (established 512 bind 512) [ 0.360000] TCP: reno registered [ 0.370000] UDP hash table entries: 256 (order: 0, 4096 bytes) [ 0.370000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) [ 0.380000] NET: Registered protocol family 1 [ 0.400000] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 0.410000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORI. [ 0.420000] msgmni has been set to 55 [ 0.420000] io scheduler noop registered [ 0.430000] io scheduler deadline registered (default) [ 0.430000] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled [ 0.470000] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A [ 0.470000] console [ttyS0] enabled, bootconsole disabled [ 0.470000] console [ttyS0] enabled, bootconsole disabled [ 0.490000] ath79-spi ath79-spi: master is unqueued, this is deprecated [ 0.490000] m25p80 spi0.0: found en25f32, expected m25p80 [ 0.500000] m25p80 spi0.0: en25f32 (4096 Kbytes) [ 0.510000] 5 tp-link partitions found on MTD device spi0.0 [ 0.510000] Creating 5 MTD partitions on "spi0.0": [ 0.520000] 0x000000000000-0x000000020000 : "u-boot" [ 0.520000] 0x000000020000-0x000000130e00 : "kernel" [ 0.530000] mtd: partition "kernel" must either start or end on erase block y [ 0.540000] 0x000000130e00-0x0000003f0000 : "rootfs" [ 0.550000] mtd: partition "rootfs" must either start or end on erase block y [ 0.560000] mtd: device 2 (rootfs) set to be root filesystem [ 0.570000] 1 squashfs-split partitions found on MTD device rootfs [ 0.570000] 0x000000310000-0x0000003f0000 : "rootfs_data" [ 0.580000] 0x0000003f0000-0x000000400000 : "art" [ 0.590000] 0x000000020000-0x0000003f0000 : "firmware" [ 0.600000] libphy: ag71xx_mdio: probed [ 0.910000] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:0c [uid=00008] [ 0.920000] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:MII [ 0.920000] TCP: cubic registered [ 0.930000] NET: Registered protocol family 17 [ 0.930000] Bridge firewalling registered [ 0.940000] 8021q: 802.1Q VLAN Support v1.8 [ 0.950000] VFS: Mounted root (squashfs filesystem) readonly on device 31:2. [ 0.960000] Freeing unused kernel memory: 272K (8034c000 - 80390000) procd: Console is alive procd: - watchdog - [ 4.120000] usbcore: registered new interface driver usbfs [ 4.130000] usbcore: registered new interface driver hub [ 4.140000] usbcore: registered new device driver usb [ 4.150000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 4.150000] ehci-platform: EHCI generic platform driver [ 4.160000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver procd: - preinit - Press the [f] key and hit [enter] to enter failsafe mode Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level jffs2 is not ready - marker found procd: - early - procd: - watchdog - procd: - ubus - procd: - init - Please press Enter to activate this console. [ 10.520000] NET: Registered protocol family 10 [ 10.530000] ip6_tables: (C) 2000-2006 Netfilter Core Team [ 10.550000] Loading modules backported from Linux version master-2014-10-08-5 [ 10.560000] Backport generated by backports.git backports-20140905-1-gde42785 [ 10.570000] ip_tables: (C) 2000-2006 Netfilter Core Team [ 10.580000] nf_conntrack version 0.5.0 (450 buckets, 1800 max) [ 10.630000] xt_time: kernel timezone is -0000 [ 10.660000] cfg80211: Calling CRDA to update world regulatory domain [ 10.660000] cfg80211: World regulatory domain updated: [ 10.670000] cfg80211: DFS Master region: unset [ 10.670000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_ga) [ 10.680000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 ) [ 10.690000] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 ) [ 10.700000] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 ) [ 10.710000] cfg80211: (5170000 KHz - 5250000 KHz @ 160000 KHz), (N/A, 2000) [ 10.710000] cfg80211: (5250000 KHz - 5330000 KHz @ 160000 KHz), (N/A, 2000) [ 10.720000] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000) [ 10.730000] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 ) [ 10.740000] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0) [ 10.820000] PPP generic driver version 2.4.2 [ 10.820000] NET: Registered protocol family 24 [ 10.970000] ieee80211 phy0: Atheros AR9100 MAC/BB Rev:7 AR2133 RF Rev:a2 mem2 [ 10.980000] cfg80211: Calling CRDA for country: US [ 11.000000] cfg80211: Regulatory domain changed to country: US [ 11.000000] cfg80211: DFS Master region: FCC [ 11.010000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_ga) [ 11.020000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 3000 ) [ 11.020000] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 1700 ) [ 11.030000] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz), (N/A, 2300 ) [ 11.040000] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 3000 ) [ 11.050000] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4) [ 17.950000] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0 [ 17.970000] jffs2_build_filesystem(): unlocking the mtd device... done. [ 17.970000] jffs2_build_filesystem(): erasing all blocks after the end markey [ 23.110000] device eth0 entered promiscuous mode [ 23.140000] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready done. [ 25.260000] jffs2: notice: (862) jffs2_build_xattr_subsystem: complete build. procd: - init complete -
Жмём на клавиатуре ENTER
. Получаем консоль администратора:
BusyBox v1.22.1 (2014-10-26 01:54:05 UTC) built-in shell (ash) Enter 'help' for a list of built-in commands. _______ ________ __ | |.-----.-----.-----.| | | |.----.| |_ | - || _ | -__| || | | || _|| _| |_______|| __|_____|__|__||________||__| |____| |__| W I R E L E S S F R E E D O M ----------------------------------------------------- CHAOS CALMER (Bleeding Edge, r43061) ----------------------------------------------------- * 1 1/2 oz Gin Shake with a glassful * 1/4 oz Triple Sec of broken ice and pour * 3/4 oz Lime Juice unstrained into a goblet. * 1 1/2 oz Orange Juice * 1 tsp. Grenadine Syrup ----------------------------------------------------- root@OpenWrt:/#
После подключения кабеля видим:
[ 108.970000] eth0: link up (100Mbps/Full duplex) [ 108.970000] br-lan: port 1(eth0) entered forwarding state [ 108.980000] br-lan: port 1(eth0) entered forwarding state [ 108.980000] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready [ 108.990000] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready [ 110.980000] br-lan: port 1(eth0) entered forwarding state
Можем установить пароль администратора прямо из этой консоли:
root@OpenWrt:/# passwd Changing password for root New password: Retype password: Password for root changed by root root@OpenWrt:/#
Если требуется установить на сетевой интерфейс IP-адрес, отличный от адреса по умолчанию (192.168.1.1), следует отредактировать следующий файл, указав в нём нужный адрес (в данном примере - 192.168.1.111):
config interface 'loopback' option ifname 'lo' option proto 'static' option ipaddr '127.0.0.1' option netmask '255.0.0.0' config globals 'globals' option ula_prefix 'fd69:a24c:834e::/48' config interface 'lan' option ifname 'eth0' option force_link '1' option proto 'static' option ipaddr '192.168.1.111' option netmask '255.255.255.0' option ip6assign '60' option delegate '0'
после чего перезапустить сеть:
/etc/init.d/network reload
В конце полезно разрешить автозапуск веб-интерфейса и запустить его сразу:
/etc/init.d/uhttpd enable /etc/init.d/uhttpd start