LINUX.ORG.RU

Эксперименты с роутером — как не выстрелить в ногу?

 ,


0

0

Накатил OpenWRT на свой WZR-HP-G300NH2 с помощью tftp. Теперь хочу дальше эксперементировать с LibreCMC. Как не окирпичить девайс? Можно ли некорректной прошивкой так сломать tftp сервер, что не получится залить другую прошивку?

На openwrt.org выложили bootlog:

BUFFALO U-BOOT Ver 1.03
  == CPU:400MHz, DDR:400MHz, AHB:200MHz ==
PB93 (ar7241 - Virian) U-boot
DRAM:  64 MB
WAN port disabling: done
Top of RAM usable for U-Boot at: 84000000
Reserving 265k for U-Boot at: 83fbc000
Reserving 192k for malloc() at: 83f8c000
Reserving 44 Bytes for Board Info at: 83f8bfd4
Reserving 36 Bytes for Global Data at: 83f8bfb0
Reserving 128k for boot params() at: 83f6bfb0
Stack Pointer at: 83f6bf98
Now running in RAM - U-Boot at: 83fbc000
flash bank #0 found 16 MB flash [MX25L128-45E, blk:0x10000, sectors:256]
flash bank #1 found 16 MB flash [MX25L128-45E, blk:0x10000, sectors:256]
Flash: 32 MB
In:    serial
Out:   serial
Err:   serial
Memory Test
uboot use  83F6BFB0 - 84000000
Memory Test start(80000000) end(83F00000) size(03F00000)
Pattern 00000000  Writing...  Reading...
Memory Test OK
### buf_ver=[1.03] U-Boot Ver.=[1.03]
### build_date(env)=[Mar  7 2011 - 05:27:46] build_date(bin)=[Mar  7 2011 - 05:27:46]
ag7240_enet_initialize...
Reading MAC Address from ENV(0x83f8c322)
No valid address in Flash. Using fixed address
Virian MDC CFG Value ==> 4
: cfg1 0x7 cfg2 0x7014
eth0: 02:aa:bb:cc:dd:1a
eth0 up
Virian MDC CFG Value ==> 4
: cfg1 0xf cfg2 0x7214
eth1: 00:03:7f:09:0b:ad
ATHRS26: resetting s26
ATHRS26: s26 reset done
eth1 up
eth0  02:AA:BB:CC:DD:1A
, eth1  00:03:7F:09:0B:AD

dup 1 speed 1000

tftp server(receive) go, waiting:4[sec]
Load address: 0x81f00000
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
         $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
         $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
         $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
         $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
         $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
         $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
         $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
tftp server done
Bytes transferred = 2621476 (280024 hex)

Airstation Public header
Recv fw image [2621444] bytes, now writing...

flash-addr 0xBF060000 - 0xBF2EFFFF
search sector 0xbf060000 - 0xbf2effff
BANK #1 (6 : 46)
  000  PPPP.Poooooooooooooooooooooooooo
  032  ooooooooooooooo.................
  064  ................................
  096  ................................
  128  ................................
  160  ................................
  192  ................................
  224  ................................
BANK #2 (-1 : -1)
  000  ................................
  032  ................................
  064  ................................
  096  ................................
  128  ................................
  160  ................................
  192  ................................
  224  ................................

First 0x6 last 0x2e sector size 0x10000
  46
Erased 41 sectors
Copy to Flash... 
 Copy 2621444 byte to Flash...
write data: 81f00020 --> bf060000  (len:280004)
done
change bootargs
console=ttyS0,115200 root=31:03 rootfstype=jffs2 init=/sbin/init mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),1152k@384k(uImage),6592k@1536k(rootfs),64k@320k(ART),64k@8128k(properties),8192k@8192k(flash1),16384k@16384k(flash2) mem=64M product_rev=1
## Booting image at bf060000 ...
   Image Name:   MIPS OpenWrt Linux-2.6.39.4
   Created:      2011-12-15  18:39:27 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    871284 Bytes = 850.9 kB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum ... crc32_fw: bf060040 - bf134bb3 (len:000d4b74) calc...
crc32_fw: range1 bf060040 - bf134bb3
OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 67108864

Starting kernel ...

[    0.000000] Linux version 2.6.39.4 (mdeneen@build) (gcc version 4.5.4 20110808 (prerelease) (Linaro GCC 4.5-2011.08) ) #1 Thu Dec 15 13:39:21 EST 2011
[    0.000000] prom: fw_arg0=00000008, fw_arg1=a3f6bfb0, fw_arg2=a3f6c4b0, fw_arg3=00000020
[    0.000000] MyLoader: sysp=00000000, boardp=00000000, parts=00000000
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Atheros AR7242 rev 1
[    0.000000] Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:5.000MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone PFN ranges:
[    0.000000]   Normal   0x00000000 -> 0x00004000
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[1] active PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00004000
[    0.000000] On node 0 totalpages: 16384
[    0.000000] free_area_init_node: node 0, pgdat 802b9570, node_mem_map 81000000
[    0.000000]   Normal zone: 128 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16256 pages, LIFO batch:3
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line:  board=WZR-HP-G300NH2 console=ttyS0,115200 rootfstype=squashfs,jffs2 noinitrd
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 61848k/65536k available (2013k kernel code, 3688k reserved, 393k data, 184k init, 0k highmem)
[    0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:80
[    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 Buffalo WZR-HP-G300NH2
[    0.100000] ar71xx: pll_reg 0xb805002c: 0x62000000
[    0.530000] registering PCI controller with io_map_base unset
[    0.540000] bio: create slab <bio-0> at 0
[    0.550000] pci 0000:00:00.0: [168c:ff1c] type 0 class 0x000200
[    0.550000] pci 0000:00:00.0: fixup device configuration
[    0.550000] pci 0000:00:00.0: reg 10: [mem 0x00000000-0x0000ffff 64bit]
[    0.550000] pci 0000:00:00.0: supports D1
[    0.550000] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[    0.550000] pci 0000:00:00.0: PME# disabled
[    0.550000] pci 0000:00:00.0: BAR 0: assigned [mem 0x10000000-0x1000ffff 64bit]
[    0.560000] pci 0000:00:00.0: BAR 0: set to [mem 0x10000000-0x1000ffff 64bit] (PCI address [0x10000000-0x1000ffff])
[    0.570000] PCI: mapping irq 72 to pin1@0000:00:00.0
[    0.570000] Switching to clocksource MIPS
[    0.580000] NET: Registered protocol family 2
[    0.580000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.580000] TCP established hash table entries: 2048 (order: 2, 16384 bytes)
[    0.590000] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[    0.590000] TCP: Hash tables configured (established 2048 bind 2048)
[    0.600000] TCP reno registered
[    0.600000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.610000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.610000] NET: Registered protocol family 1
[    0.620000] PCI: CLS 0 bytes, default 32
[    0.640000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.640000] JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.650000] msgmni has been set to 120
[    0.660000] io scheduler noop registered
[    0.660000] io scheduler deadline registered (default)
[    0.670000] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.690000] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
[    0.700000] console [ttyS0] enabled, bootconsole disabled
[    0.710000] Atheros AR71xx SPI Controller driver version 0.2.4
[    0.720000] m25p80 spi0.0: found mx25l12805d, expected m25p80
[    0.730000] m25p80 spi0.0: mx25l12805d (16384 Kbytes)
[    0.730000] m25p80 spi0.1: found mx25l12805d, expected m25p80
[    0.740000] m25p80 spi0.1: mx25l12805d (16384 Kbytes)
[    0.750000] Concatenating MTD devices:
[    0.750000] (0): "spi0.0"
[    0.750000] (1): "spi0.1"
[    0.760000] into device "flash"
[    0.760000] Creating 7 MTD partitions on "flash":
[    0.760000] 0x000000000000-0x000000040000 : "u-boot"
[    0.770000] 0x000000040000-0x000000050000 : "u-boot-env"
[    0.780000] 0x000000050000-0x000000060000 : "art"
[    0.790000] 0x000000060000-0x000000160000 : "kernel"
[    0.800000] 0x000000160000-0x000001ff0000 : "rootfs"
[    0.800000] mtd: partition "rootfs" set to be root filesystem
[    0.810000] mtd: partition "rootfs_data" created automatically, ofs=2C0000, len=1D30000 
[    0.820000] 0x0000002c0000-0x000001ff0000 : "rootfs_data"
[    0.820000] 0x000001ff0000-0x000002000000 : "user_property"
[    0.830000] 0x000000060000-0x000001ff0000 : "firmware"
[    0.990000] ag71xx_mdio: probed
[    0.990000] eth0: Atheros AG71xx at 0xb9000000, irq 4
[    1.760000] eth0: AR8316 switch driver attached.
[    1.780000] ar8316: Using port 4 as switch port
[    2.740000] eth0: connected to PHY at ag71xx-mdio.0:00 [uid=004dd041, driver=Atheros AR8216/AR8316/AR8326]
[    2.740000] Atheros AR71xx hardware watchdog driver version 0.1.0
[    2.740000] ar71xx-wdt: timeout=15 secs (max=21)
[    2.740000] TCP westwood registered
[    2.750000] NET: Registered protocol family 17
[    2.750000] 802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
[    2.760000] All bugs added by David S. Miller <davem@redhat.com>
[    2.770000] VFS: Mounted root (squashfs filesystem) readonly on device 31:6.
[    2.780000] Freeing unused kernel memory: 184k freed
[    5.310000] input: gpio-keys-polled as /devices/platform/gpio-keys-polled/input/input0
[    5.480000] Button Hotplug driver version 0.4.1
[    5.550000] Registered led device: buffalo:red:diag
[    6.780000] eth0: link up (1000Mbps/Full duplex)
[    8.860000] eth0: link down
[    9.780000] Compat-wireless backport release: compat-wireless-2011-11-29
[    9.790000] Backport based on wireless-testing.git master-2011-12-01
[    9.910000] cfg80211: Calling CRDA to update world regulatory domain
[   10.360000] usbcore: registered new interface driver usbfs
[   10.360000] usbcore: registered new interface driver hub
[   10.370000] usbcore: registered new device driver usb
[   10.950000] cfg80211: World regulatory domain updated:
[   10.950000] cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   10.960000] cfg80211:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   10.970000] cfg80211:     (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   10.980000] cfg80211:     (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   10.990000] cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   10.990000] cfg80211:     (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   11.760000] PCI: Setting latency timer of device 0000:00:00.0 to 64
[   11.770000] ath: EEPROM regdomain: 0x0
[   11.770000] ath: EEPROM indicates default country code should be used
[   11.770000] ath: doing EEPROM country->regdmn map search
[   11.770000] ath: country maps to regdmn code: 0x3a
[   11.770000] ath: Country alpha2 being used: US
[   11.770000] ath: Regpair used: 0x3a
[   11.770000] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   11.770000] Registered led device: ath9k-phy0
[   11.770000] Registered led device: buffalo:blue:usb
[   11.770000] Registered led device: buffalo:green:wireless
[   11.770000] Registered led device: buffalo:orange:security
[   11.770000] Registered led device: buffalo:green:router
[   11.770000] Registered led device: buffalo:blue:movie_engine_on
[   11.770000] Registered led device: buffalo:blue:movie_engine_off
[   11.770000] ieee80211 phy0: Atheros AR9280 Rev:2 mem=0xb0000000, irq=72
[   11.790000] cfg80211: Calling CRDA for country: US
[   12.100000] PPP generic driver version 2.4.2
[   12.110000] cfg80211: Regulatory domain changed to country: US
[   12.110000] cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   12.120000] cfg80211:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)
[   12.130000] cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1700 mBm)
[   12.140000] cfg80211:     (5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   12.150000] cfg80211:     (5490000 KHz - 5600000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   12.150000] cfg80211:     (5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   12.160000] cfg80211:     (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 3000 mBm)
[   12.280000] ip_tables: (C) 2000-2006 Netfilter Core Team
[   12.430000] NET: Registered protocol family 24
[   12.620000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[   12.630000] ar71xx-ehci ar71xx-ehci: Atheros AR91xx built-in EHCI controller
[   12.630000] ar71xx-ehci ar71xx-ehci: new USB bus registered, assigned bus number 1
[   12.670000] ar71xx-ehci ar71xx-ehci: irq 3, io mem 0x1b000000
[   12.690000] ar71xx-ehci ar71xx-ehci: USB 2.0 started, EHCI 1.00
[   12.690000] hub 1-0:1.0: USB hub found
[   12.700000] hub 1-0:1.0: 1 port detected
[   12.790000] nf_conntrack version 0.5.0 (969 buckets, 3876 max)
[   15.100000] device eth0.1 entered promiscuous mode
[   15.100000] device eth0 entered promiscuous mode
[   16.940000] eth0: link up (1000Mbps/Full duplex)
[   16.940000] br-lan: port 1(eth0.1) entering forwarding state
[   16.950000] br-lan: port 1(eth0.1) entering forwarding state
[   23.470000] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[   23.490000] jffs2_build_filesystem(): unlocking the mtd device... done.
[   23.490000] jffs2_build_filesystem(): erasing all blocks after the end marker... done.
[  242.390000] JFFS2 notice: (1173) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[  243.030000] ar71xx-wdt: enabling watchdog timer

Ебсткственнно взять два штук. Один точно рабочий, второй игровой/тестовый, ну и менять их между собой.
Вариант2 взять стабильный роутер и к нему взять малинку банананку там возможностей поиграться сильно большееее

pfg ★★★★★ ()

На поиграться лучше сразу прикупить у китайцев программатор и usb-uart адаптер

devl547 ★★★★★ ()

Купи программатор и играйся как хочешь.

anonymous ()

А вариант «не баловаться с прошивкой» рассматривается? Правда, я выбрал для роутера dd-wrt, обновляюсь раз в пару месяцев (в надежде, что дыры в безопасности таки закрывают) через веб-интерфейс, проблем не испытываю, волосы мягкие и шелковистые.

gremlin_the_red ★★★★★ ()

WZR-HP-G300NH2

Ух ты, я уже много лет мучаю WZR-HP-G300NH. Думал, что у нас любителей Buffalo почти нет.
Стоит OpenWRT.

Можно ли некорректной прошивкой так сломать tftp сервер, что не получится залить другую прошивку?

Можно, но я таких случаев не знаю.

athost ★★★★★ ()
Последнее исправление: athost (всего исправлений: 2 )

Благодарю всех за ответы! Понял, что баловаться и эксперементировать нужно с программатором, а в моём случае лучше довольствоваться рабочей прошивкой.

fingolfin ()

Для некоторых роутеров есть «загрузчики» из которых можно накатывать прошивки. Например для Xiaomi R3P есть китайский «загрузчик» не u-boot. С таким окирпичить не получится. Ну или брать UART где-то придется, а то и изучать com порт и присоединять правильно контакты для получения доступа к загргузчику.

anonymous ()
Ответ на: комментарий от athost

Думал, что у нас любителей Buffalo почти нет.

Я пока не любитель :) Только недавно БУшный взял специально для LibremCMC, да только забыл про разные модификации. Но железка приятная, характеристики достаточные, OpenWRT встала — всё что нужно для счастья :)

fingolfin ()
Последнее исправление: fingolfin (всего исправлений: 1 )
Ответ на: комментарий от gremlin_the_red

Только отрезать ногу заране! Никаких полумер.

anonymous ()
Ответ на: комментарий от fingolfin

Безотказная железяка. Покупал на eBay лет 10 назад из Сингапура потому, что он выдавал самую высокую мощность сигнала. И ни разу не пожалел. До сих пор хватает, как домашний роутер. Только в сеть какой-то дешевый Tp-Link на 5Г пришлось добавить)
Пока мне пров в мой дом больше 100Г не дает, буду сидеть на нем еще 10 лет )))
Очень высокое качество – никаких проблем с раздувшимися конденсаторами, блоком питания и т.д.

athost ★★★★★ ()
Последнее исправление: athost (всего исправлений: 4 )
Для того чтобы оставить комментарий войдите или зарегистрируйтесь.