Mikrotik Routerboard 433
Esta board vem pré-instalada com “MikroTik RouterOS v3, Level4 license”.
Para passar a correr OpenWRT, é necessário construir um kernel específico para o “Atheros AR7130”.
O kernel é carregado por tftp, e é necessário um dhcpd para configurar o acesso ao tftp pela board e indicar o kernel.
uma dhcpd.conf possível é:
subnet 10.0.1.0 netmask 255.255.255.0 { interface eth0; range 10.0.1.30 10.0.1.40; default-lease-time 6000; max-lease-time 7200; option subnet-mask 255.255.255.0; option time-offset -3600; } host routerboard { hardware ethernet 00:0c:42:FF:FF:FF; fixed-address 10.0.1.29; next-server 10.0.1.21; filename "openwrt-ar71xx-vmlinux-initramfs.elf"; default-lease-time 7200; }
Com o dhcpd configurado e o kernel certo acessível por tftp, escolhemos como “boot device” a ethernet. Boot inicial (consola 115200-8N1):
RouterBOOT booter 2.16 RouterBoard 433 CPU frequency: 300 MHz Memory size: 64 MB Press any key within 2 seconds to enter setup.. writing settings to flash... OK trying bootp protocol.... OK Got IP address: 10.0.1.29 resolved mac address 00:01:80:FF:FF:FF transfer started .............................. transfer ok, time=3.29s setting up elf image... OK jumping to kernel code Linux version 2.6.28.9 (jm@sinesis) (gcc version 4.1.2) #1 Sun Apr 12 23:10:00 WEST 2009 console [early0] enabled CPU revision is: 00019374 (MIPS 24Kc) Atheros AR7130 rev 2 (id:0xa8), CPU:300.000 MHz, AHB:150.000 MHz, DDR:300.000 MHz Determined physical RAM map: memory: 04000000 @ 00000000 (usable) Initrd not found or empty - disabling initrd Zone PFN ranges: Normal 0x00000000 -> 0x00004000 Movable zone start PFN for each node early_node_map[1] active PFN ranges 0: 0x00000000 -> 0x00004000 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256 Kernel command line: rootfstype=squashfs,yaffs,jffs2 noinitrd console=ttyS0,115200 init=/etc/preinit Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes. Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes Writing ErrCtl register=0004ff60 Readback ErrCtl register=0004ff60 PID hash table entries: 256 (order: 8, 1024 bytes) Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) Memory: 60504k/65536k available (1819k kernel code, 4960k reserved, 331k data, 1752k init, 0k highmem) SLUB: Genslabs=6, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 Calibrating delay loop... 199.88 BogoMIPS (lpj=999424) Mount-cache hash table entries: 512 net_namespace: 480 bytes NET: Registered protocol family 16 MIPS: machine is MikroTik RouterBOARD 433/AH registering PCI controller with io_map_base unset pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot pci 0000:00:00.0: PME# disabled PCI: mapping irq 33 to pin1@0000:00:13.0 NET: Registered protocol family 2 IP route cache hash table entries: 1024 (order: 0, 4096 bytes) TCP established hash table entries: 2048 (order: 2, 16384 bytes) TCP bind hash table entries: 2048 (order: 1, 8192 bytes) TCP: Hash tables configured (established 2048 bind 2048) TCP reno registered NET: Registered protocol family 1 squashfs: version 3.0 (2006/03/15) Phillip Lougher Registering mini_fo version $Id$ JFFS2 version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc. yaffs Apr 12 2009 23:07:29 Installing. msgmni has been set to 118 io scheduler noop registered io scheduler deadline registered (default) Serial: 8250/16550 driver1 ports, IRQ sharing disabled serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A console handover: boot [early0] -> real [ttyS0] ag71xx_mdio: probed eth0: Atheros AG71xx at 0xba000000, irq 5 eth1: Atheros AG71xx at 0xb9000000, irq 4 NAND flash driver for RouterBoard 4xx series version 0.1.10 NAND SPI clock 25000 kHz (AHB 150000 kHz / 6) FLASH SPI clock 25000 kHz (AHB 150000 kHz / 6) NAND device: Manufacturer ID: 0xad, Chip ID: 0x76 (Hynix NAND 64MiB 3,3V 8-bit) Scanning device for bad blocks Bad eraseblock 2169 at 0x021e4000 Bad eraseblock 3225 at 0x03264000 Creating 3 MTD partitions on "NAND 64MiB 3,3V 8-bit": 0x00000000-0x00040000 : "booter" 0x00040000-0x00400000 : "kernel" 0x00400000-0x04000000 : "rootfs" mtd: partition "rootfs" set to be root filesystem split_squashfs: error occured while reading from "NAND 64MiB 3,3V 8-bit" Atheros AR71xx SPI Controller driver version 0.2.2 Atheros AR71xx hardware watchdog driver version 0.1.0 TCP vegas registered NET: Registered protocol family 17 802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com> All bugs added by David S. Miller <davem@redhat.com> Freeing unused kernel memory: 1752k freed Algorithmics/MIPS FPU Emulator v1.5 [sighandler]: No more events to be processed, quitting. [cleanup]: Waiting for children. [cleanup]: All children terminated. - preinit - Press CTRL-C for failsafe Please press Enter to activate this console. device eth0 entered promiscuous mode eth1: link up (100Mbps/Full duplex) eth1: link down eth1: link up (100Mbps/Full duplex) PPP generic driver version 2.4.2 ip_tables: (C) 2000-2006 Netfilter Core Team nf_conntrack version 0.5.0 (1024 buckets, 4096 max) eth0: link up (100Mbps/Full duplex) br-lan: topology change detected, propagating br-lan: port 1(eth0) entering forwarding state br-lan: port 1(eth0) entering disabled state br-lan: topology change detected, propagating br-lan: port 1(eth0) entering forwarding state wlan: trunk ath_hal: module license 'Proprietary' taints kernel. ath_hal: 2008-10-02 (AR5210, AR5211, AR5212, AR5416, RF5111, RF5112, RF2413, RF5413, RF2133, RF2425, REGOPS_FUNC, DFS, XR) ath_rate_minstrel: Minstrel automatic rate control algorithm 1.2 (trunk) ath_rate_minstrel: look around rate set to 10% ath_rate_minstrel: EWMA rolloff level set to 75% ath_rate_minstrel: max segment size in the mrr set to 6000 us wlan: mac acl policy registered ath_pci: trunk PCI: Enabling device 0000:00:13.0 (0000 -> 0002) Atheros HAL provided by OpenWrt, DD-WRT and MakSat Technologies wifi0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps wifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps wifi0: turboA rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps wifi0: turboG rates: 6Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps wifi0: H/W encryption support: WEP AES AES_CCM TKIP ath_pci: wifi0: Atheros 5212: mem=0x10000000, irq=33 gpio-buttons driver version 0.1.1 input: gpio-buttons as /devices/platform/gpio-buttons/input/input0 BusyBox v1.11.3 (2009-04-12 22:20:15 WEST) 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 KAMIKAZE (bleeding edge, r15220) ------------------- * 10 oz Vodka Shake well with ice and strain * 10 oz Triple sec mixture into 10 shot glasses. * 10 oz lime juice Salute! --------------------------------------------------- root@OpenWrt:/#
Carregar OpenWRT para o NAND
cd /tftpboot wget http://sinesis.unimos.net/ipkg/routerboard/openwrt-ar71xx-rootfs.tgz wget http://sinesis.unimos.net/ipkg/routerboard/openwrt-ar71xx-vmlinux.elf
Com o kernel e o arquivo do root filesystem acessiveis por http:
root@OpenWrt:/# wget2nand http://10.0.1.21 udhcpc (v1.11.3) started Sending discover... Sending select for 10.0.1.29... Lease of 10.0.1.29 obtained, lease time 7200 Erasing filesystem... nand_erase: attempt to erase a bad block at page 0x00010f20 nand_erase: attempt to erase a bad block at page 0x00019320 Mounting /dev/mtdblock2 as new root and /dev/mtdblock1 as kernel partition yaffs: dev is 32505858 name is "mtdblock2" yaffs: passed flags "" yaffs: Attempting MTD mount on 31.2, "mtdblock2" yaffs: auto selecting yaffs1 yaffs: block 1913 is marked bad block 1914 is bad yaffs: block 2969 is marked bad block 2970 is bad yaffs_read_super: isCheckpointed 0 yaffs: dev is 32505857 name is "mtdblock1" yaffs: passed flags "" yaffs: Attempting MTD mount on 31.1, "mtdblock1" yaffs: auto selecting yaffs1 yaffs_read_super: isCheckpointed 0 Erasing existing files... rm: cannot remove '/tmp/wget2nand-rootfs/lost+found': Directory not empty Copying filesystem... Connecting to 10.0.1.21 (10.0.1.21:80) - 0% | | 0 --:--:-- ETA./ ./sys/ ./tmp/ ...<snip>... ./lib/libcrypt.so.0 ./root/ Connecting to 10.0.1.21 (10.0.1.21:80) kernel 100% |*******************************| 2289k 00:00:00 ETA save exit: isCheckpointed 0 save exit: isCheckpointed 0 kernel lost+found bin jffs mnt root tmp save exit: isCheckpointed 0 www dev lib proc sbin usr etc lost+found rom sysave exit: isCheckpointed 0 0m var Image written, you can now reboot. Remember to change the boot source to Boot from Nand root@OpenWrt:/#