Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| oldwiki:openwrtdocs:hardware:meraki:mini [2017/11/07 17:39] – Page title added; section heading levels corrected tmomas | toh:meraki:mini [2019/10/13 11:51] – some tags added tmomas | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Meraki mini ====== | ||
| + | {{section> | ||
| + | |||
| + | |||
| + | {{page> | ||
| + | {{page> | ||
| + | |||
| + | ===== Supported Versions ===== | ||
| + | ---- datatable ---- | ||
| + | cols : Brand, Model, Versions, Supported Current Rel, OEM device homepage URL_url, Forum Topic URL_url, Device Techdata_pageid | ||
| + | headers : Brand, Model, Version, Current Release, OEM Info, Forum Topic, Technical Data | ||
| + | align : c, | ||
| + | filter | ||
| + | filter | ||
| + | ---- | ||
| + | |||
| + | ===== Hardware Overview ===== | ||
| + | ==== Hardware Highlights ==== | ||
| + | ---- datatable ---- | ||
| + | cols : Model, Versions, CPU, CPU MHz, Flash MB_mbflashs, | ||
| + | header | ||
| + | align : c, | ||
| + | filter | ||
| + | filter | ||
| + | ---- | ||
| + | |||
| + | |||
| + | Serial port (labeled JP1, @115200bps): | ||
| + | |||
| + | < | ||
| + | VCC o-> | ||
| + | LAN | ||
| + | TX o<- | ||
| + | GND o-- | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== Opening the case ==== | ||
| + | Peel off the bottom left and top right corners of the silver label on the back of the unit, to reveal two crosspoint screws. Remove them, then prise apart the case with a screwdriver. | ||
| + | |||
| + | ==== Serial to USB adaptor ==== | ||
| + | Meraki sell a small adaptor board (18mm x 32mm) for $29 which plugs into JP1 and has a serial to USB adaptor chip and a mini USB connector; it comes with a mini USB to normal USB cable. It appears to be powered by the host side, not the Meraki side. It is available from the " | ||
| + | |||
| + | < | ||
| + | usb 2-1: new full speed USB device using address 3 | ||
| + | ftdi_sio 2-1:1.0: FTDI FT232BM Compatible converter detected | ||
| + | usb 2-1: FTDI FT232BM Compatible converter now attached to ttyUSB0 | ||
| + | usbcore: registered new driver ftdi_sio | ||
| + | drivers/ | ||
| + | </ | ||
| + | |||
| + | It is not polarised, but the correct way round is so that it overhangs the RF module, and doesn' | ||
| + | |||
| + | I found the USB adaptor was somewhat unreliable under Linux; power-cycling the Meraki made it freeze, so I had to unplug and reconnect the USB connection to the host as well. This was both with CentOS 4.3 (2.6.9) and Ubuntu 6.06 (2.6.15). A more reliable sequence was: | ||
| + | |||
| + | * Unplug JP1 | ||
| + | * Remove power from Meraki | ||
| + | * Re-apply power to Meraki | ||
| + | * Reconnect JP1 | ||
| + | on ubuntu efty kernel 2.6.19.1 same behavior with pl2303 from siemens datacable and la_fonera FON2100 (nearly identical hw,but 8/16 MB Flash) | ||
| + | |||
| + | Here are the drivers needed by Microsoft Windows: http:// | ||
| + | |||
| + | Meraki have in the past withdrawn the serial adaptor from sale (it's back in the store as of June 2007). A suitable replacement is the Fox console board. It is available here: http:// | ||
| + | |||
| + | Another choice of cable is for sale pre-assembled from the FTDI Chip Shop: http:// | ||
| + | |||
| + | It plugs directly into a USB host port on one end, and the Meraki on the other end, and includes all the connectors cables | ||
| + | |||
| + | < | ||
| + | o NC | ||
| + | | ||
| + | o orange | ||
| + | o black </ | ||
| + | |||
| + | ===== Standard Meraki firmware ===== | ||
| + | ==== Startup messages ==== | ||
| + | [captured from serial port, with ethernet port not connected] | ||
| + | |||
| + | <WRAP bootlog> | ||
| + | < | ||
| + | IP: 192.168.84.1/ | ||
| + | Default server: 192.168.84.9 | ||
| + | RedBoot(tm) bootstrap and debug environment [ROMRAM] | ||
| + | Release, version V1.04 - built 12:24:00, Apr 17 2006 | ||
| + | Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc. | ||
| + | Board: Meraki Mini | ||
| + | RAM: 0x80000000-0x82000000, | ||
| + | FLASH: 0xa8000000 - 0xa87e0000, 128 blocks of 0x00010000 bytes each. | ||
| + | == Executing boot script in 2.000 seconds - enter ^C to abort | ||
| + | RedBoot> check_mac | ||
| + | Lan Mac address is : 00: | ||
| + | Wlan Mac address is : 00: | ||
| + | Serial Number is : XXX-XXX-XXX | ||
| + | RedBoot> load art_ap51.elf | ||
| + | Using default protocol (TFTP) | ||
| + | __udp_sendto: | ||
| + | Can't load ' | ||
| + | RedBoot> go | ||
| + | No entry point known - aborted | ||
| + | RedBoot> load -h 192.168.84.9 -p 80 -m http / | ||
| + | Unable to reach host 192.168.84.9 (192.168.84.9) | ||
| + | RedBoot> exec | ||
| + | Can't execute Linux - invalid entry address | ||
| + | RedBoot> fis load stage2 | ||
| + | RedBoot> exec | ||
| + | Now booting linux kernel: | ||
| + | Base address 0x80030000 Entry 0x80100000 | ||
| + | | ||
| + | starting stage2 | ||
| + | reading flash at 0xa8150000 - 0xa8452927... done | ||
| + | Calculating CRC... 0x727b3da7 - matches | ||
| + | decompressing... done | ||
| + | starting linux | ||
| + | Linux version 2.6.16.16-meraki-mini (jbicket@high.meraki.net) (gcc version 3.4.6 (OpenWrt-2.0)) #8 Fri Nov 3 11:36:22 PST 2006 | ||
| + | CPU revision is: 00019064 | ||
| + | Determined physical RAM map: | ||
| + | | ||
| + | Built 1 zonelists | ||
| + | Kernel command line: | ||
| + | Primary instruction cache 16kB, physically tagged, 4-way, linesize 16 bytes. | ||
| + | Primary data cache 16kB, 4-way, linesize 16 bytes. | ||
| + | Synthesized TLB refill handler (20 instructions). | ||
| + | Synthesized TLB load handler fastpath (32 instructions). | ||
| + | Synthesized TLB store handler fastpath (32 instructions). | ||
| + | Synthesized TLB modify handler fastpath (31 instructions). | ||
| + | PID hash table entries: 256 (order: 8, 4096 bytes) | ||
| + | Using 92.000 MHz high precision timer. | ||
| + | Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) | ||
| + | Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) | ||
| + | Memory: 19940k/ | ||
| + | Mount-cache hash table entries: 512 | ||
| + | Checking for ' | ||
| + | unpacking initramfs....done | ||
| + | NET: Registered protocol family 16 | ||
| + | Algorithmics/ | ||
| + | JFFS2 version 2.2. (NAND) (C) 2001-2003 Red Hat, Inc. | ||
| + | Initializing Cryptographic API | ||
| + | io scheduler noop registered | ||
| + | io scheduler anticipatory registered (default) | ||
| + | io scheduler deadline registered | ||
| + | io scheduler cfq registered | ||
| + | faulty_init | ||
| + | watchdog hb: 90 ISR: 0x21 IMR: 0x8 WD : 0x86b43edd | ||
| + | ar2315_wdt_init using heartbeat 90 s cycles 3600000000 | ||
| + | watchdog hb: 90 ISR: 0x21 IMR: 0x88 WD : 0xd68e68bd | ||
| + | Serial: 8250/16550 driver $Revision: 1.90 $ 1 ports, IRQ sharing disabled | ||
| + | serial8250: ttyS0 at MMIO 0xb1100003 (irq = 37) is a 16550A | ||
| + | tun: Universal TUN/TAP device driver, 1.6 | ||
| + | tun: (C) 1999-2004 Max Krasnyansky | ||
| + | setting one ethernet device to null... | ||
| + | MTD driver for SPI flash. | ||
| + | spiflash: Probing for Serial flash ... | ||
| + | spiflash: Found SPI serial Flash. | ||
| + | 8388608: size | ||
| + | RedBoot partition parsing not available | ||
| + | Creating 7 MTD partitions on " | ||
| + | 0x00000000-0x00030000 : " | ||
| + | 0x00030000-0x00050000 : " | ||
| + | 0x00050000-0x00150000 : "/ | ||
| + | 0x00150000-0x00490000 : " | ||
| + | 0x00490000-0x007d0000 : " | ||
| + | 0x007d0000-0x007e0000 : " | ||
| + | 0x007e0000-0x00800000 : "board config" | ||
| + | oprofile: using timer interrupt. | ||
| + | NET: Registered protocol family 2 | ||
| + | IP route cache hash table entries: 512 (order: -1, 2048 bytes) | ||
| + | TCP established hash table entries: 2048 (order: 2, 16384 bytes) | ||
| + | TCP bind hash table entries: 2048 (order: 2, 16384 bytes) | ||
| + | TCP: Hash tables configured (established 2048 bind 2048) | ||
| + | TCP reno registered | ||
| + | ip_conntrack version 2.4 (256 buckets, 2048 max) - 232 bytes per conntrack | ||
| + | ip_conntrack_pptp version 3.1 loaded | ||
| + | ip_nat_pptp version 3.0 loaded | ||
| + | ip_tables: (C) 2000-2006 Netfilter Core Team | ||
| + | ClusterIP Version 0.8 loaded successfully | ||
| + | TCP bic registered | ||
| + | NET: Registered protocol family 1 | ||
| + | NET: Registered protocol family 17 | ||
| + | Freeing unused kernel memory: 9592k freed | ||
| + | init started: | ||
| + | Please press Enter to activate this console. ar2315_wdt: starting watchdog w/timeout 90 seconds | ||
| + | watchdog hb: 90 ISR: 0x20 IMR: 0x89 WD : 0xd6918293 | ||
| + | ath_hal: module license ' | ||
| + | ath_hal: 0.9.17.2 (AR5212, AR5312, RF2316, TX_DESC_SWAP) | ||
| + | wlan: 0.8.4.2 (svn 2943) | ||
| + | ath_rate_sample: | ||
| + | ath_ahb: 0.9.4.5 (svn 2943) | ||
| + | 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: H/W encryption support: WEP AES AES_CCM TKIP | ||
| + | wifi0: mac 11.0 phy 4.8 radio 7.0 | ||
| + | wifi0: Use hw queue 1 for WME_AC_BE traffic | ||
| + | wifi0: Use hw queue 0 for WME_AC_BK traffic | ||
| + | wifi0: Use hw queue 2 for WME_AC_VI traffic | ||
| + | wifi0: Use hw queue 3 for WME_AC_VO traffic | ||
| + | wifi0: Use hw queue 8 for CAB traffic | ||
| + | wifi0: Use hw queue 9 for beacons | ||
| + | couldn' | ||
| + | unable to load wlan_scan_sta | ||
| + | wifi0: Atheros 2315 WiSoC: mem=0xb0000000, | ||
| + | click: starting router thread pid 394 (802ecb00) | ||
| + | wlan: mac acl policy registered | ||
| + | realtek setup | ||
| + | couldn' | ||
| + | unable to load wlan_scan_monitor | ||
| + | ath0: start running | ||
| + | ath0: __ieee80211_newstate: | ||
| + | ath0: __ieee80211_newstate: | ||
| + | ath0: stop running | ||
| + | ath0: __ieee80211_newstate: | ||
| + | ath0: __ieee80211_newstate: | ||
| + | ath0: __ieee80211_newstate: | ||
| + | ath0: start running | ||
| + | ath0: __ieee80211_newstate: | ||
| + | ath0: __ieee80211_newstate: | ||
| + | ath0: __ieee80211_newstate: | ||
| + | ath0: stop running | ||
| + | ath0: __ieee80211_newstate: | ||
| + | ath0: __ieee80211_newstate: | ||
| + | ath0: __ieee80211_newstate: | ||
| + | ...etc</ | ||
| + | </ | ||
| + | |||
| + | ===== Network activity ===== | ||
| + | Plugging in the ethernet port to another host and running tcpdump there while the unit is booting up shows: | ||
| + | |||
| + | - Unit ARPs for 192.168.84.1 eight times (checking its address is not in use by anyone else) | ||
| + | - Unit ARPs for 192.168.84.9. If successful: | ||
| + | - Unit attempts to make TFTP (UDP) request to 192.168.84.9 to get **art_ap51.elf** | ||
| + | - Unit attempts to make HTTP request to 192.168.84.9 to **GET / | ||
| + | - Picks up new IP address via DHCP | ||
| + | - Sends UDP packet to 64.62.142.12: | ||
| + | - Makes DNS lookups for config.meraki.net. and db.meraki.net. | ||
| + | So it looks like there are at least two different ways to download new firmware at power-up. | ||
| + | |||
| + | ===== ssh access ===== | ||
| + | Once the unit has picked up an IP address via DHCP, and you've found it (e.g. using nmap or looking at the upstream router' | ||
| + | |||
| + | < | ||
| + | # ssh meraki@x.x.x.x | ||
| + | meraki@x.x.x.x' | ||
| + | BusyBox v1.1.0 (2006.09.29-21: | ||
| + | Enter ' | ||
| + | http:// | ||
| + | Welcome to your meraki mini. Please look for developer information at | ||
| + | http:// | ||
| + | platform and add your own features to it. However, our lawyers | ||
| + | require us to tell you that much of the software on this device is | ||
| + | protected by copyrights, and may not be redistributed or sold. | ||
| + | Happy Hacking! | ||
| + | root@meraki-node: | ||
| + | uid=0(root) gid=0(root) | ||
| + | root@meraki-node: | ||
| + | none on /proc type proc (rw) | ||
| + | / | ||
| + | none on /tmp type tmpfs (rw, | ||
| + | none on /dev/pts type devpts (rw) | ||
| + | none on /sys type sysfs (rw) | ||
| + | none on /click type click (rw) | ||
| + | root@meraki-node: | ||
| + | Filesystem | ||
| + | / | ||
| + | none | ||
| + | df: /click: Function not implemented | ||
| + | root@meraki-node: | ||
| + | dev: size | ||
| + | mtd0: 00030000 00010000 " | ||
| + | mtd1: 00020000 00010000 " | ||
| + | mtd2: 00100000 00010000 "/ | ||
| + | mtd3: 00340000 00010000 " | ||
| + | mtd4: 00340000 00010000 " | ||
| + | mtd5: 00010000 00010000 " | ||
| + | mtd6: 00020000 00010000 "board config" | ||
| + | mtd7: 00800000 00010000 " | ||
| + | </ | ||
| + | |||
| + | The root filesystem is not listed as a mount. It's writeable, but changes are lost on reboot, so presumably it's a ramdisk. | ||
| + | |||
| + | The installed software is quite comprehensive, | ||
| + | |||
| + | ===== Backing up existing firmware ===== | ||
| + | If you rebuild Meraki' | ||
| + | |||
| + | So logically you should be able to restore the device to its original state by backing these up: | ||
| + | |||
| + | < | ||
| + | ssh meraki@x.x.x.x 'dd if=/ | ||
| + | ssh meraki@x.x.x.x 'dd if=/ | ||
| + | ssh meraki@x.x.x.x 'dd if=/ | ||
| + | ssh meraki@x.x.x.x 'dd if=/ | ||
| + | </ | ||
| + | |||
| + | In practice you'll probably find that part1.bak and part2.bak are identical. If you dd /dev/mtd7, you'll get an 8MB file which is the same as the first 7 partitions concatenated together. | ||
| + | |||
| + | Note1: the "board config" | ||
| + | |||
| + | Note2: when comparing two different Meraki Minis, the stage2, part1 and redboot-config partitions are identical between them. | ||
| + | |||
| + | ===== Restoring flash using serial console ===== | ||
| + | About 13 seconds after applying power, there is a two-second window when you can press ctrl-C to get into the boot loader. | ||
| + | |||
| + | < | ||
| + | == Executing boot script in 2.000 seconds - enter ^C to abort | ||
| + | ^C | ||
| + | RedBoot> | ||
| + | </ | ||
| + | |||
| + | The [[http:// | ||
| + | |||
| + | Now, looking at the partition info above gives the following partition offsets and sizes: | ||
| + | |||
| + | < | ||
| + | | ||
| + | mtd0 RedBoot | ||
| + | mtd1 stage2 | ||
| + | mtd2 / | ||
| + | mtd3 part1 | ||
| + | mtd4 part2 | ||
| + | mtd5 redboot conf 7d0000 | ||
| + | mtd6 board conf 7e0000 | ||
| + | </ | ||
| + | |||
| + | Unfortunately, | ||
| + | |||
| + | < | ||
| + | RedBoot> version | ||
| + | RedBoot(tm) bootstrap and debug environment [ROMRAM] | ||
| + | Release, version V1.04 - built 12:24:00, Apr 17 2006 | ||
| + | Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc. | ||
| + | Board: Meraki Mini | ||
| + | RAM: 0x80000000-0x82000000, | ||
| + | FLASH: 0xa8000000 - 0xa87e0000, 128 blocks of 0x00010000 bytes each. | ||
| + | RedBoot> load -r -b 0x80150000 -m tftp -h 192.168.84.9 part1.bak | ||
| + | Raw file loaded 0x80150000-0x8048ffff, | ||
| + | RedBoot> fis write -b 0x80150000 -l 0x340000 -f 0xa8150000 | ||
| + | * CAUTION * about to program FLASH | ||
| + | at 0xa8150000..0xa848ffff from 0x80150000 - continue (y/n)? y | ||
| + | ... Erase from 0xa8150000-0xa8490000: | ||
| + | ... Program from 0x80150000-0x80490000 at 0xa8150000: .......................... | ||
| + | RedBoot> reset | ||
| + | ... Resetting. | ||
| + | </ | ||
| + | |||
| + | You can repeat this for the other partitions backed up. (However, after I broke my Meraki by installing firmware built from Meraki' | ||
| + | |||
| + | ===== RedBoot configuration ===== | ||
| + | The default RedBoot config does the following: | ||
| + | |||
| + | < | ||
| + | RedBoot> fconfig -l | ||
| + | Run script at boot: true | ||
| + | Boot script: | ||
| + | .. check_mac | ||
| + | .. load art_ap51.elf | ||
| + | .. go | ||
| + | .. load -h 192.168.84.9 -p 80 -m http / | ||
| + | .. exec | ||
| + | .. fis load stage2 | ||
| + | .. exec | ||
| + | Boot script timeout (1000ms resolution): | ||
| + | Use BOOTP for network configuration: | ||
| + | Gateway IP address: 0.0.0.0 | ||
| + | Local IP address: 192.168.84.1 | ||
| + | Local IP address mask: 255.255.255.0 | ||
| + | Default server IP address: 192.168.84.9 | ||
| + | Console baud rate: 115200 | ||
| + | GDB connection port: 9000 | ||
| + | Force console for special debug messages: false | ||
| + | Network debug at boot time: false | ||
| + | RedBoot> | ||
| + | </ | ||
| + | |||
| + | If you want to change this, you can use ' | ||
| + | |||
| + | This information is stored in the ' | ||
| + | |||
| + | ===== Stage 2 boot loader ===== | ||
| + | Meraki' | ||
| + | |||
| + | It reads " | ||
| + | |||
| + | < | ||
| + | #define PART1_ADDR | ||
| + | #define PART2_ADDR | ||
| + | </ | ||
| + | |||
| + | This means that if you want to use Meraki' | ||
| + | |||
| + | - You must use the same partitioning arrangement as Meraki | ||
| + | - The kernel must be LZMA compressed | ||
| + | - The kernel must be prepended with an 8-byte header (4 bytes length, 4 bytes bastardised CRC32 - see below) | ||
| + | It would be useful to retain Meraki' | ||
| + | |||
| + | ===== Building OpenWrt ===== | ||
| + | Support for the Atheros System-on-Chip used by the Meraki Mini was [[https:// | ||
| + | |||
| + | Check out SVN trunk, use 'make menuconfig', | ||
| + | |||
| + | < | ||
| + | openwrt-atheros-2.6-root.jffs2-128k | ||
| + | openwrt-atheros-2.6-root.jffs2-64k | ||
| + | openwrt-atheros-2.6-vmlinux.elf | ||
| + | openwrt-atheros-2.6-vmlinux.gz | ||
| + | openwrt-atheros-2.6-vmlinux.lzma | ||
| + | </ | ||
| + | |||
| + | ===== Kernel parameters ===== | ||
| + | Even though RedBoot can pass a command line to the kernel, currently any user-provided value is overridden by a hardcoded string - see target/ | ||
| + | |||
| + | < | ||
| + | + strcpy(arcs_cmdline, | ||
| + | </ | ||
| + | |||
| + | If you wish, you can change the console speed to 115200 here to match the value used by RedBoot. Alternatively you can reconfigure RedBoot to use 9600bps (see below). Apparently it's also possible to comment this line out to allow the kernel command line provided by RedBoot to be used. | ||
| + | |||
| + | Also hardcoded is the FIS partition name of the root filesystem which is " | ||
| + | |||
| + | < | ||
| + | +#define ROOTFS_NAME | ||
| + | </ | ||
| + | |||
| + | ===== Using a ramdisk root ===== | ||
| + | If you select " | ||
| + | |||
| + | < | ||
| + | openwrt-atheros-2.6-vmlinux.elf | ||
| + | openwrt-atheros-2.6-vmlinux.gz | ||
| + | openwrt-atheros-2.6-vmlinux.lzma | ||
| + | </ | ||
| + | |||
| + | This gives a single image which contains both the kernel and the root filesystem which runs from ramdisk. This is useful when trying to install on a machine where you don't have a serial console (see later) | ||
| + | |||
| + | ===== Using a squashfs root ===== | ||
| + | TBD (it would be very nice if a single flash partition could contain a kernel + fixed squashfs filesystem, with the remaining space as a writable jffs2 filesystem, as you get on Broadcom devices) | ||
| + | |||
| + | ===== Installing OpenWrt using serial console ===== | ||
| + | Connect a serial port (115200 8N1, no flow control) to the Meraki and power up. Keep hitting ctrl-C until you get to the RedBoot> prompt; this takes about 13 seconds. | ||
| + | |||
| + | < | ||
| + | Board: Meraki Mini | ||
| + | RAM: 0x80000000-0x82000000, | ||
| + | FLASH: 0xa8000000 - 0xa87e0000, 128 blocks of 0x00010000 bytes each. | ||
| + | == Executing boot script in 2.000 seconds - enter ^C to abort | ||
| + | ^C | ||
| + | RedBoot> | ||
| + | </ | ||
| + | |||
| + | At this point, it's a good idea to change the serial port speed to 9600 bps, since this is the speed at which the kernel will use (unless you've modified the source) | ||
| + | |||
| + | < | ||
| + | RedBoot> baudrate -b 9600 | ||
| + | Baud rate will be changed to 9600 - update your settings | ||
| + | </ | ||
| + | |||
| + | Change your terminal' | ||
| + | |||
| + | Configure your PC as 192.168.84.9 and configure it with either a tftp server or http server containing the files from the bin/ directory. | ||
| + | |||
| + | ===== Testing kernel via tftp or http ===== | ||
| + | This lets you test your new kernel without touching the flash at all, by loading the kernel directly over the network: | ||
| + | |||
| + | < | ||
| + | RedBoot> load -r -d -b 0x80041000 -m tftp -h 192.168.84.9 openwrt-atheros-2.6-vmlinux.gz | ||
| + | Raw file loaded 0x80041000-0x8028e085, | ||
| + | RedBoot> exec | ||
| + | Now booting linux kernel: | ||
| + | Base address 0x80030000 Entry 0x80041000 | ||
| + | | ||
| + | Linux version 2.6.19.1 (candlerb@candlerb-desktop) (gcc version 3.4.6 (OpenWrt-7CPU revision is: 00019064 | ||
| + | ... etc | ||
| + | Please append a correct " | ||
| + | Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1, | ||
| + | </ | ||
| + | |||
| + | This problem will go away when you have a FIS partition called " | ||
| + | |||
| + | ===== Create flash partitions ===== | ||
| + | Now, the first thing to notice is that the Meraki' | ||
| + | |||
| + | < | ||
| + | RedBoot> fis load -d part1 | ||
| + | No image ' | ||
| + | RedBoot> fis list | ||
| + | Name FLASH addr Mem addr Length | ||
| + | RedBoot | ||
| + | stage2 | ||
| + | FIS directory | ||
| + | RedBoot config | ||
| + | RedBoot> | ||
| + | </ | ||
| + | |||
| + | So let's create them. The name of the kernel partition doesn' | ||
| + | |||
| + | < | ||
| + | RedBoot> fis create -b 0x80041000 -l 0x340000 -f 0xa8150000 -e 0x80041000 -r 0x80041000 -n linux | ||
| + | ... Erase from 0xa87d0000-0xa87e0000: | ||
| + | ... Program from 0x80ff0000-0x81000000 at 0xa87d0000: . | ||
| + | RedBoot> fis create -b 0x80041000 -l 0x340000 -f 0xa8490000 -e 0x80041000 -r 0x80041000 -n rootfs | ||
| + | ... Erase from 0xa87d0000-0xa87e0000: | ||
| + | ... Program from 0x80ff0000-0x81000000 at 0xa87d0000: . | ||
| + | RedBoot> fis list | ||
| + | Name FLASH addr Mem addr Length | ||
| + | RedBoot | ||
| + | stage2 | ||
| + | linux | ||
| + | rootfs | ||
| + | FIS directory | ||
| + | RedBoot config | ||
| + | RedBoot> | ||
| + | </ | ||
| + | |||
| + | ===== Booting directly from RedBoot ===== | ||
| + | In this configuration, | ||
| + | |||
| + | Here we assume you've built a kernel plus jffs2 root filesystem (the default). We'll put these in Meraki' | ||
| + | |||
| + | ==== Flash the kernel and root filesystem ==== | ||
| + | Now we fetch the files and write them to flash (it seems 0x80041000 is the magic kernel entry point for Linux; the jffs2 partition doesn' | ||
| + | |||
| + | < | ||
| + | RedBoot> load -r -b 0x80041000 -m tftp -h 192.168.84.9 openwrt-atheros-2.6-vmlinux.gz | ||
| + | Raw file loaded 0x80041000-0x80140fff, | ||
| + | RedBoot> fis create -r 0x80041000 -e 0x80041000 linux | ||
| + | An image named ' | ||
| + | ... Erase from 0xa8150000-0xa8490000: | ||
| + | ... Program from 0x80041000-0x80141000 at 0xa8150000: ................ | ||
| + | ... Erase from 0xa87d0000-0xa87e0000: | ||
| + | ... Program from 0x80ff0000-0x81000000 at 0xa87d0000: . | ||
| + | RedBoot> load -r -b 0x80041000 -m tftp -h 192.168.84.9 openwrt-atheros-2.6-root.jffs2-64k | ||
| + | Raw file loaded 0x80041000-0x801c0fff, | ||
| + | RedBoot> fis create -r 0x80041000 -e 0x80041000 rootfs | ||
| + | An image named ' | ||
| + | ... Erase from 0xa8490000-0xa87d0000: | ||
| + | ... Program from 0x80041000-0x801c1000 at 0xa8490000: ................ | ||
| + | ... Erase from 0xa87d0000-0xa87e0000: | ||
| + | ... Program from 0x80ff0000-0x81000000 at 0xa87d0000: . | ||
| + | RedBoot> | ||
| + | </ | ||
| + | |||
| + | You can now try to boot directly from the RedBoot command line: | ||
| + | |||
| + | < | ||
| + | RedBoot> fis load -d linux | ||
| + | [This takes about 40 seconds; RedBoot is slow to decompress!] | ||
| + | Image loaded from 0x80041000-0x8028e086 | ||
| + | RedBoot> exec | ||
| + | Now booting linux kernel: | ||
| + | Base address 0x80030000 Entry 0x80041000 | ||
| + | | ||
| + | Linux version 2.6.19.1 (candlerb@candlerb-desktop) (gcc version 3.4.6 (OpenWrt-2.0)) #1 Tue Jan 2 14:07:20 GMT 2007 | ||
| + | ... | ||
| + | Jan 1 00:00:43 (none) user.info kernel: Time: MIPS clocksource has been installed. | ||
| + | Jan 1 00:00:43 (none) user.warn kernel: jffs2_scan_eraseblock(): | ||
| + | Jan 1 00:00:43 (none) user.warn kernel: jffs2_build_filesystem(): | ||
| + | Jan 1 00:00:43 (none) user.warn kernel: jffs2_build_filesystem(): | ||
| + | Jan 1 00:00:43 (none) user.warn kernel: VFS: Mounted root (jffs2 filesystem) readonly. | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | Now hit Enter for a shell: | ||
| + | |||
| + | < | ||
| + | Jan 1 00:01:28 (none) daemon.info init: Starting pid 67, console /dev/tts/0: '/ | ||
| + | BusyBox v1.3.1 (2007-01-02 13:55:25 GMT) Built-in shell (ash) | ||
| + | Enter ' | ||
| + | _______ | ||
| + | | ||
| + | | ||
| + | |_ ^ |_____|__| ^ ^ | |____| | ||
| + | |__| W I R E L E S S F R E E D O M | ||
| + | | ||
| + | * 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:/# | ||
| + | /dev/root on / type jffs2 (rw) | ||
| + | none on /dev type devfs (rw) | ||
| + | none on /proc type proc (rw) | ||
| + | none on /tmp type tmpfs (rw, | ||
| + | none on /dev/pts type devpts (rw) | ||
| + | none on /sys type sysfs (rw) | ||
| + | root@OpenWrt:/# | ||
| + | Filesystem | ||
| + | / | ||
| + | root@OpenWrt:/# | ||
| + | </ | ||
| + | |||
| + | ==== Use fconfig to change bootup parameters ==== | ||
| + | Now you will need to change the boot script so that your new kernel is booted automatically at power-up. You can also use this as an opportunity to change the default RedBoot serial port speed from 115200 to 9600 bps. | ||
| + | |||
| + | < | ||
| + | RedBoot> fconfig | ||
| + | Run script at boot: true | ||
| + | Boot script: | ||
| + | .. check_mac | ||
| + | .. load art_ap51.elf | ||
| + | .. go | ||
| + | .. load -h 192.168.84.9 -p 80 -m http / | ||
| + | .. exec | ||
| + | .. fis load stage2 | ||
| + | .. exec | ||
| + | Enter script, terminate with empty line | ||
| + | >> fis load -d linux | ||
| + | >> exec | ||
| + | >> | ||
| + | Boot script timeout (1000ms resolution): | ||
| + | Use BOOTP for network configuration: | ||
| + | Gateway IP address: | ||
| + | Local IP address: 192.168.84.1 | ||
| + | Local IP address mask: 255.255.255.0 | ||
| + | Default server IP address: 192.168.84.9 | ||
| + | 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 0xa87d0000-0xa87e0000: | ||
| + | ... Program from 0x80ff0000-0x81000000 at 0xa87d0000: . | ||
| + | RedBoot> | ||
| + | </ | ||
| + | |||
| + | ===== Booting using Meraki stage2 loader ===== | ||
| + | Alternatively, | ||
| + | |||
| + | * It does LZMA decompression, | ||
| + | * It doesn' | ||
| + | * Potentially it allows you to have two images, and boot the second if the first is corrupt (i.e. making it harder to brick the unit) | ||
| + | To do this, you need to prepend an 8-byte header to the kernel image, containing a length and bastardised CRC. The following Perl program does this. (Meraki' | ||
| + | |||
| + | < | ||
| + | # | ||
| + | # This script takes an LZMA kernel image, prepends the header expected | ||
| + | # by the Meraki stage2 bootloader, and pads to 64K | ||
| + | # Typical usage: | ||
| + | # ./ | ||
| + | use Digest:: | ||
| + | open(F, $ARGV[0]) or die " | ||
| + | $size = -s F; | ||
| + | # Meraki' | ||
| + | $ctx = Digest:: | ||
| + | | ||
| + | $ctx-> | ||
| + | print pack ' | ||
| + | seek(F, | ||
| + | print ; | ||
| + | close(F); | ||
| + | $size += 8; | ||
| + | print " | ||
| + | </ | ||
| + | |||
| + | Now you have a kernel which stage2 will happily decompress and run: | ||
| + | |||
| + | < | ||
| + | RedBoot> load -r -b 0x80041000 -m tftp -h 192.168.84.9 part | ||
| + | Raw file loaded 0x80041000-0x800f0fff, | ||
| + | RedBoot> fis create linux | ||
| + | An image named ' | ||
| + | ... Erase from 0xa8150000-0xa8490000: | ||
| + | ... Program from 0x80041000-0x800f1000 at 0xa8150000: ........... | ||
| + | ... Erase from 0xa87d0000-0xa87e0000: | ||
| + | ... Program from 0x80ff0000-0x81000000 at 0xa87d0000: . | ||
| + | RedBoot> load -r -b 0x80041000 -m tftp -h 192.168.84.9 openwrt-atheros-2.6-root.jffs2-64k | ||
| + | Raw file loaded 0x80041000-0x801c0fff, | ||
| + | RedBoot> fis create -r 0x80041000 -e 0x80041000 rootfs | ||
| + | An image named ' | ||
| + | ... Erase from 0xa8490000-0xa87d0000: | ||
| + | ... Program from 0x80041000-0x801c1000 at 0xa8490000: ................ | ||
| + | ... Erase from 0xa87d0000-0xa87e0000: | ||
| + | ... Program from 0x80ff0000-0x81000000 at 0xa87d0000: . | ||
| + | RedBoot> fis load stage2 | ||
| + | RedBoot> exec | ||
| + | Now booting linux kernel: | ||
| + | Base address 0x80030000 Entry 0x80100000 | ||
| + | | ||
| + | starting stage2 | ||
| + | reading flash at 0xa8150000 - 0xa81fdc8e... done | ||
| + | Calculating CRC... 0xf87cb83e - matches | ||
| + | decompressing... done | ||
| + | starting linux | ||
| + | Linux version 2.6.19.1 (candlerb@candlerb-desktop) (gcc version 3.4.6 (OpenWrt-2.0)) #1 Tue Jan 2 14:07:20 GMT 2007 | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | The flash load and decompress now takes only about 7 seconds, and you can reboot without changing the RedBoot config. | ||
| + | |||
| + | ===== Options for installing without a serial console ===== | ||
| + | /!\ **WARNING: | ||
| + | |||
| + | ==== RedBoot over telnet ==== | ||
| + | It's possible to get a RedBoot> command line over the network. There is a two-second window (!) in which you can do so. Configure your PC as 192.168.84.9 and repeatedly try to connect to port 9000 on 192.168.84.1 (just keep hitting ctrl-C, up-arrow, enter) and you should be able to manage it. If your PC is running Linux you might want to rm / | ||
| + | |||
| + | < | ||
| + | # arp -d 192.168.84.1; | ||
| + | 192.168.84.1 (192.168.84.1) deleted | ||
| + | Trying 192.168.84.1... | ||
| + | ^C | ||
| + | # arp -d 192.168.84.1; | ||
| + | 192.168.84.1 (192.168.84.1) deleted | ||
| + | Trying 192.168.84.1... | ||
| + | ^C | ||
| + | # arp -d 192.168.84.1; | ||
| + | 192.168.84.1 (192.168.84.1) deleted | ||
| + | Trying 192.168.84.1... | ||
| + | Connected to 192.168.84.1. | ||
| + | Escape character is ' | ||
| + | == Executing boot script in 1.980 seconds - enter ^C to abort | ||
| + | ^C^C | ||
| + | RedBoot> | ||
| + | </ | ||
| + | |||
| + | Once you've done this, you can use fconfig to set a longer timeout (say 10 seconds) to make this easier in future - ignore any "AHB ERROR" messages you may see. | ||
| + | |||
| + | < | ||
| + | RedBoot> fconfig | ||
| + | Run script at boot: true | ||
| + | Boot script: | ||
| + | .. check_mac | ||
| + | .. load art_ap51.elf | ||
| + | .. go | ||
| + | .. load -h 192.168.84.9 -p 80 -m http / | ||
| + | .. exec | ||
| + | .. fis load stage2 | ||
| + | .. exec | ||
| + | Enter script, terminate with empty line | ||
| + | >> check_mac | ||
| + | >> load art_ap51.elf | ||
| + | >> go | ||
| + | >> load -h 192.168.84.9 -p 80 -m http / | ||
| + | >> exec | ||
| + | >> fis load stage2 | ||
| + | >> exec | ||
| + | >> | ||
| + | Boot script timeout (1000ms resolution): | ||
| + | Use BOOTP for network configuration: | ||
| + | Gateway IP address: | ||
| + | Local IP address: 192.168.84.1 | ||
| + | Local IP address mask: 255.255.255.0 | ||
| + | Default server IP address: 192.168.84.9 | ||
| + | Console baud rate: 115200^H^H^H^H^H^H9600 | ||
| + | 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 0xa87d0000-0xa87e0000: | ||
| + | ... Program from 0x80ff0000-0x81000000 at 0xa87d0000: . | ||
| + | RedBoot> | ||
| + | </ | ||
| + | |||
| + | You can then continue as above; in particular you should create the " | ||
| + | |||
| + | < | ||
| + | RedBoot> fis create -b 0x80041000 -l 0x100000 -f 0xa8050000 -e 0x80041000 -r 0x80041000 -n /storage | ||
| + | RedBoot> fis create -b 0x80041000 -l 0x340000 -f 0xa8150000 -e 0x80041000 -r 0x80041000 -n linux | ||
| + | RedBoot> fis create -b 0x80041000 -l 0x340000 -f 0xa8490000 -e 0x80041000 -r 0x80041000 -n rootfs | ||
| + | </ | ||
| + | |||
| + | ==== Erasing the Meraki Partitioning system ==== | ||
| + | If you think the Meraki Vendor firmware' | ||
| + | |||
| + | Install a TFTP server on your PC and set your PC's IP address to 192.168.84.9. | ||
| + | |||
| + | Telnet into RedBoot (see the Helpful Hints below) and issue these commands: | ||
| + | |||
| + | < | ||
| + | RedBoot> fis init | ||
| + | RedBoot> load -r -b 0x80041000 -m tftp -h 192.168.84.9 openwrt-atheros-2.6-vmlinux.gz | ||
| + | RedBoot> fis create -r 0x80041000 -l 0x180000 -e 0x80041000 linux | ||
| + | RedBoot> load -r -b 0x80041000 -m tftp -h 192.168.84.9 openwrt-atheros-2.6-root.squashfs | ||
| + | RedBoot> fis create -r 0x80041000 -l 0x620000 rootfs | ||
| + | </ | ||
| + | |||
| + | Change squashfs to jffs2-64k if you want a completely jffs2 (writable) root filesystem. | ||
| + | |||
| + | Be patient. | ||
| + | |||
| + | When the last //fis create// command completes, change the boot script thusly: | ||
| + | |||
| + | < | ||
| + | RedBoot> fconfig -d boot_script_data | ||
| + | boot_script_data: | ||
| + | .. whatever it currently is | ||
| + | Enter script, terminate with empty line | ||
| + | >> fis load -d linux | ||
| + | >> exec | ||
| + | >> | ||
| + | Update RedBoot non-volatile configuration - continue (y/n)? y | ||
| + | ... Erase from 0xa87d0000-0xa87e0000: | ||
| + | ... Program from 0x80ff0000-0x81000000 at 0xa87d0000: . | ||
| + | </ | ||
| + | |||
| + | Some explantion of this flashing method: //fis init// erases all the partitions except for the Redboot partitions, and seems to create a new "FIS directory" | ||
| + | |||
| + | The second partition is allocated the rest of the free space and the squashfs image fills just the beginning. | ||
| + | |||
| + | An OpenWRT squashfs installation done this way has this partition layout: | ||
| + | |||
| + | < | ||
| + | root@OpenWrt: | ||
| + | dev: size | ||
| + | mtd0: 00030000 00010000 " | ||
| + | mtd1: 00200000 00010000 " | ||
| + | mtd2: 005a0000 00010000 " | ||
| + | mtd3: 004a0000 00010000 " | ||
| + | mtd4: 0000f000 00010000 "FIS directory" | ||
| + | mtd5: 00001000 00010000 " | ||
| + | root@OpenWrt: | ||
| + | rootfs on / type rootfs (rw) | ||
| + | /dev/root on /rom type squashfs (ro) | ||
| + | none on /proc type proc (rw) | ||
| + | none on /sys type sysfs (rw) | ||
| + | none on /tmp type tmpfs (rw, | ||
| + | tmpfs on /dev type tmpfs (rw) | ||
| + | none on /dev/pts type devpts (rw) | ||
| + | / | ||
| + | /jffs on / type mini_fo (rw) | ||
| + | </ | ||
| + | |||
| + | Note that we now no longer have a " | ||
| + | |||
| + | Now for upgrading OpenWRT all you have to do is scp the kernel and new squashfs image to the /tmp directory and run the following command: | ||
| + | |||
| + | < | ||
| + | root@OpenWrt:/# | ||
| + | </ | ||
| + | |||
| + | Again be very patient as the flash is much slower than on any other hardware that I've run OpenWRT. | ||
| + | |||
| + | **Helpful Hints** | ||
| + | |||
| + | Some people have reported problems sending ctrl-C to the Meraki from their telnet client. Also, it can be tricky to hit the 2 second window to get into redboot via telent. There are several great solutions to automating this on the NSLU2-linux site: http:// | ||
| + | |||
| + | < | ||
| + | echo off | ||
| + | echo Set objShell = WScript.CreateObject(" | ||
| + | echo Set objExecObject = objShell.Exec(" | ||
| + | echo Wscript.Echo "Start router after first ping timeout..." | ||
| + | echo Do While Not objExecObject.StdOut.AtEndOfStream >> redboot.vbs | ||
| + | echo | ||
| + | echo | ||
| + | echo If Instr(strText, | ||
| + | echo Exit Do >> redboot.vbs | ||
| + | echo End If >> redboot.vbs | ||
| + | echo Loop >> redboot.vbs | ||
| + | echo objShell.Run(" | ||
| + | echo Do Until Success = True >> redboot.vbs | ||
| + | echo | ||
| + | echo Loop >> redboot.vbs | ||
| + | echo Wscript.Sleep 500 >> redboot.vbs | ||
| + | echo objShell.SendKeys " | ||
| + | echo Wscript.Echo " | ||
| + | echo Wscript.Quit >> redboot.vbs | ||
| + | CALL CScript redboot.vbs | ||
| + | del redboot.vbs | ||
| + | </ | ||
| + | |||
| + | ===== Installing over ssh from existing firmware ===== | ||
| + | In theory it should be possible to overwrite just two partitions if your kernel is stage2-compatible: | ||
| + | |||
| + | * /dev/mtd/3 with the CRC-prefixed kernel | ||
| + | * /dev/mtd/4 with the rootfs | ||
| + | Or three partitions with a standard kernel | ||
| + | |||
| + | * /dev/mtd/3 with the kernel | ||
| + | * /dev/mtd/4 with the rootfs | ||
| + | * /dev/mtd/6 with a new RedBoot config (fis load -d linux; exec) | ||
| + | Unfortunately, | ||
| + | |||
| + | However, instead you can use a kernel with a ramdisk root. | ||
| + | |||
| + | 'make menuconfig', | ||
| + | |||
| + | ==== Risk-free test using tftp ==== | ||
| + | Configure a PC as 192.168.84.9 with a tftp server. | ||
| + | |||
| + | Copy bin/ | ||
| + | |||
| + | Plug in your Meraki. Run tcpdump on the tftp server if you want to see what's happening. | ||
| + | |||
| + | The Meraki should fetch your kernel+ramdisk and run it. After a minute or two you should be able to telnet to 192.168.1.1. If it fails, then you just power-cycle the unit and no harm is done. | ||
| + | |||
| + | ==== Install stage2 image ==== | ||
| + | If you're happy with this and want to make it permanent, first you'll want to make a stage2-compatible kernel image using the Perl script given above: | ||
| + | |||
| + | < | ||
| + | $ scripts/ | ||
| + | $ ls -l bin/part-rd | ||
| + | -rw-r--r-- 1 candlerb candlerb 1966080 2007-01-04 10:35 bin/part-rd | ||
| + | </ | ||
| + | |||
| + | (Make sure this is smaller than 3.25MB) | ||
| + | |||
| + | Now you'll need to overwrite the ' | ||
| + | |||
| + | < | ||
| + | root@OpenWrt: | ||
| + | dev: size | ||
| + | mtd0: 00030000 00010000 " | ||
| + | mtd1: 00020000 00010000 " | ||
| + | mtd2: 0000f000 00010000 "FIS directory" | ||
| + | mtd3: 00001000 00010000 " | ||
| + | mtd4: 00010000 00010000 " | ||
| + | </ | ||
| + | |||
| + | So you need to: | ||
| + | |||
| + | * set up a DHCP server | ||
| + | * make sure the art_ap51.elf file is no longer on your tftp server (or the tftp server is no longer on 192.168.84.9) | ||
| + | * power-cycle the Meraki | ||
| + | * watch DHCP to see what IP address it picks up | ||
| + | Now you're running the old Meraki firmware, which has the flash partitions hard-coded into it. Now you can copy the new image file, login, and write it to flash: | ||
| + | |||
| + | < | ||
| + | $ scp part-rd meraki@x.x.x.x: | ||
| + | $ ssh meraki@x.x.x.x | ||
| + | ... | ||
| + | root@meraki-node: | ||
| + | mtd3: 00340000 00010000 " | ||
| + | root@meraki-node: | ||
| + | Unlocking mtd3 ... | ||
| + | Erasing mtd3 ... | ||
| + | root@meraki-node: | ||
| + | 1920+0 records in | ||
| + | 1920+0 records out | ||
| + | root@meraki-node: | ||
| + | </ | ||
| + | |||
| + | Now cross your fingers and hope that the unit comes back up on 192.168.1.1. (However, if you uploaded a broken image with a bad CRC, the Meraki stage2 bootloader should revert to the firmware in part2) | ||
| + | |||
| + | **NOTE:** Once you're running OpenWrt, there' | ||
| + | |||
| + | **FIXME:** Running from a ramdisk root is very limited. For example, if you use ' | ||
| + | |||
| + | ===== OpenWrt configuration ===== | ||
| + | ==== IP ==== | ||
| + | By default, eth0 is configured as 192.168.1.1. Change in / | ||
| + | |||
| + | ==== Storage ==== | ||
| + | Note that there' | ||
| + | |||
| + | It's not accessible until you create a FIS partition entry for it: | ||
| + | |||
| + | < | ||
| + | RedBoot> fis create -b 0x80041000 -l 0x100000 -f 0xa8050000 -e 0x80041000 -r 0x80041000 -n /storage | ||
| + | ... Erase from 0xa87d0000-0xa87e0000: | ||
| + | ... Program from 0x80ff0000-0x81000000 at 0xa87d0000: . | ||
| + | RedBoot> | ||
| + | </ | ||
| + | |||
| + | After this: | ||
| + | |||
| + | < | ||
| + | root@OpenWrt:/# | ||
| + | dev: size | ||
| + | mtd0: 00030000 00010000 " | ||
| + | mtd1: 00020000 00010000 " | ||
| + | mtd2: 00100000 00010000 "/ | ||
| + | mtd3: 00340000 00010000 " | ||
| + | mtd4: 00330000 00010000 " | ||
| + | mtd5: 0000f000 00010000 "FIS directory" | ||
| + | mtd6: 00001000 00010000 " | ||
| + | mtd7: 00010000 00010000 " | ||
| + | root@OpenWrt:/# | ||
| + | root@OpenWrt:/# | ||
| + | root@OpenWrt:/# | ||
| + | BOOT_COUNT | ||
| + | config | ||
| + | config.local | ||
| + | </ | ||
| + | |||
| + | ===== Meraki-released source ===== | ||
| + | /!\ Now that Atheros SoC support is in the main OpenWrt tree, the rest of this page is probably not of interest to most people. However it does include the source code to build the stage 2 loader, and to build the RedBoot config partition. It also serves as documentation of some of the changes Meraki had to make. | ||
| + | |||
| + | Meraki distribute their own tarball at http:// | ||
| + | |||
| + | < | ||
| + | openwrt-meraki.tar.gz | ||
| + | size: 63072791 | ||
| + | md5sum: da71bbdd97b33bbf7dbb17c819a6c636 | ||
| + | </ | ||
| + | |||
| + | This contains: | ||
| + | |||
| + | * openwrt kamikaze forked from SVN r3586 (2006-04-02) | ||
| + | * madwifi-ng forked from SVN r1486 (2006-03-28) | ||
| + | * an entire linux kernel forked from 2.6.16.16 | ||
| + | * Meraki' | ||
| + | * Meraki' | ||
| + | Some of the changes made by Meraki are described at http:// | ||
| + | |||
| + | To build this software, follow the instructions in Meraki.README. Note that you will need to install the ' | ||
| + | |||
| + | Sit back and expect to wait an hour or more for the build to complete. | ||
| + | |||
| + | ===== Risk-free test ===== | ||
| + | Set up a host system on 192.168.84.9, | ||
| + | |||
| + | copy build_ar531x/ | ||
| + | |||
| + | Boot the Meraki. It should pick up this firmware and run it, without changing what's in the flash. | ||
| + | |||
| + | (The webserver approach doesn' | ||
| + | |||
| + | ===== Install procedure ===== | ||
| + | < | ||
| + | $ scp build_ar531x/ | ||
| + | $ ssh meraki@x.x.x.x | ||
| + | ... | ||
| + | root@meraki-node: | ||
| + | upgrading stage2 | ||
| + | Unlocking /dev/mtd1 ... | ||
| + | Erasing /dev/mtd1 ... | ||
| + | 7+1 records in | ||
| + | 7+1 records out | ||
| + | checksumming part1 | ||
| + | upgrade.sh: upgrade.sh: 80: / | ||
| + | part1 was invalid!, upgrading it first | ||
| + | Unlocking /dev/mtd3 ... | ||
| + | Erasing /dev/mtd3 ... | ||
| + | writing part1.. | ||
| + | 2568+1 records in | ||
| + | 2568+1 records out | ||
| + | upgrading part2 | ||
| + | Unlocking /dev/mtd4 ... | ||
| + | Erasing /dev/mtd4 ... | ||
| + | writing part2.. | ||
| + | 2568+1 records in | ||
| + | 2568+1 records out | ||
| + | done | ||
| + | root@meraki-node: | ||
| + | </ | ||
| + | |||
| + | [note the bug in the upgrade script! It should say / | ||
| + | |||
| + | Unfortunately, | ||
| + | |||
| + | ===== On first boot ===== | ||
| + | I found the machine got as far as picking up an IP address via DHCP but shortly afterwards crashed, going into a reboot loop. On the serial port: | ||
| + | |||
| + | < | ||
| + | ... | ||
| + | wifi0: Use hw queue 8 for CAB traffic | ||
| + | wifi0: Use hw queue 9 for beacons | ||
| + | couldn' | ||
| + | unable to load wlan_scan_sta | ||
| + | wifi0: Atheros 2315 WiSoC: mem=0xb0000000, | ||
| + | wlan: mac acl policy registered | ||
| + | realtek setup | ||
| + | ethmac0 link up | ||
| + | eth0: up | ||
| + | bss channel not setupBreak instruction in kernel code[#1]: | ||
| + | Cpu 0 | ||
| + | $ 0 : 00000000 10009c00 00000018 80289e6c | ||
| + | $ 4 : 80289e6c 81ef9ee4 00000001 80973bac | ||
| + | $ 8 : 81ede518 00001103 80970000 80980000 | ||
| + | $12 : 80970000 00000591 00000002 2ab3be34 | ||
| + | $16 : 81902000 0000ffff 81800280 81e26280 | ||
| + | $20 : 81800280 803c3076 803c3020 81839ab0 | ||
| + | $24 : 00000003 c005d310 | ||
| + | $28 : 81838000 81839a20 81800280 c00f5898 | ||
| + | Hi : 00000240 | ||
| + | Lo : 000001f8 | ||
| + | epc : c00f5898 ieee80211_dup_bss+0xa4/ | ||
| + | ra : c00f5898 ieee80211_dup_bss+0xa4/ | ||
| + | Status: 10009c03 | ||
| + | Cause : 10800024 | ||
| + | PrId : 00019064 | ||
| + | Modules linked in: wlan_xauth wlan_wep wlan_tkip wlan_scan_sta wlan_scan_ap wlalProcess ruby (pid: 529, threadinfo=81838000, | ||
| + | Stack : 00050006 81e96180 00000000 81902000 803c3076 81e26280 81839ab0 803c3020 | ||
| + | c00f5d0c 002a002f 803c3076 81e26280 00000050 80938640 803c3076 81e26280 | ||
| + | 00000050 80938640 81e96000 c00ef798 81839af0 803872a8 803c3020 00000050 | ||
| + | 0000000f 00003f1d 0000000a 80980000 2aaae000 8006d080 2aaae000 803872a8 | ||
| + | 000c000d 000f0011 00130014 00160018 00220000 0b0b0000 64000000 00000000 | ||
| + | *.. | ||
| + | Call Trace: | ||
| + | [] ieee80211_add_neighbor+0x38/ | ||
| + | [] ieee80211_recv_mgmt+0xec0/ | ||
| + | [] __do_softirq+0x70/ | ||
| + | [] init_module+0xddc0/ | ||
| + | [] ieee80211_input+0x1908/ | ||
| + | [] do_gettimeofday+0x30/ | ||
| + | [] __handle_mm_fault+0xab0/ | ||
| + | [] getnstimeofday+0x18/ | ||
| + | [] do_gettimeofday+0x30/ | ||
| + | [] __alloc_pages+0x60/ | ||
| + | [] getnstimeofday+0x18/ | ||
| + | [] do_gettimeofday+0x30/ | ||
| + | [] ieee80211_input_all+0x11c/ | ||
| + | [] ktime_get+0x20/ | ||
| + | [] ath_suspend+0x38ec/ | ||
| + | [] dev_watchdog+0xc0/ | ||
| + | [] tasklet_action+0x114/ | ||
| + | [] handle_IRQ_event+0x68/ | ||
| + | [] __do_softirq+0x70/ | ||
| + | [] do_softirq+0x5c/ | ||
| + | [] do_IRQ+0x24/ | ||
| + | [] ar531x_interrupt_receive+0xf8/ | ||
| + | [] ar531x_interrupt_receive+0xf8/ | ||
| + | [] r4k_flush_icache_page+0x2a8/ | ||
| + | [] do_wp_page+0x520/ | ||
| + | [] blast_icache16+0x48/ | ||
| + | [] __handle_mm_fault+0x50c/ | ||
| + | [] __handle_mm_fault+0x3c8/ | ||
| + | [] __group_send_sig_info+0x28/ | ||
| + | [] unmap_vmas+0x410/ | ||
| + | [] __fput+0x1f4/ | ||
| + | [] __fput+0x44/ | ||
| + | [] do_page_fault+0x104/ | ||
| + | [] filp_close+0x6c/ | ||
| + | [] exit_mmap+0x70/ | ||
| + | [] do_exit+0x9b0/ | ||
| + | [] put_files_struct+0x19c/ | ||
| + | [] do_exit+0x9b0/ | ||
| + | [] tlb_do_page_fault_0+0x104/ | ||
| + | [] syscall_exit+0x0/ | ||
| + | Code: 244272a0 | ||
| + | Kernel panic - not syncing: Aiee, killing interrupt handler! | ||
| + | | ||
| + | watchdog hb: 20 ISR: 0xa1 IMR: 0x9 WD : 0x0 WDC: 0x0 | ||
| + | </ | ||
| + | |||
| + | Unfortunately, | ||
| + | |||
| + | ===== Automated Firmware Install ===== | ||
| + | ==== EasyFlash utility ==== | ||
| + | The Expect script below is now redundant. | ||
| + | |||
| + | Get it here: http:// | ||
| + | |||
| + | Under Windows you need to install WinPcap: http:// | ||
| + | |||
| + | It's cool because it has an internal TFTP server and with WinPcap it configures the selected network interface transparently. | ||
| + | |||
| + | To use it, plug in your Meraki to your PC's ethernet jack. Run the EasyFlash util, select the correct ethernet interface, select your rootfs file (*root.squashfs or *root.jffs2-64k), | ||
| + | |||
| + | The complete quick how-to (from downloading OpenWRT sources to longing in) is collected here: http:// | ||
| + | |||
| + | ===== Expect Script ===== | ||
| + | This is an Expect script for Windows XP - it shouldn' | ||
| + | |||
| + | You need to install Expect for Windows XP: http:// | ||
| + | |||
| + | and Solarwinds TFTP Server 6.0 (hard to get now - version 8.0 doesn' | ||
| + | |||
| + | These scripts have been packaged and the necessary applications included here: http:// | ||
| + | |||
| + | Extract it wherever you want and run **install-apps.bat** to install everything you need. | ||
| + | |||
| + | Set up your network card with the IP 192.168.84.9, | ||
| + | |||
| + | Copy openwrt-atheros-2.6-vmlinux.gz and openwrt-atheros-2.6-root.squashfs into the same directory as **meraki-flash.bat**. | ||
| + | |||
| + | Plug your Meraki' | ||
| + | |||
| + | This method follows the philosophy of the **Erasing the Meraki Partitioning System** method listed above. | ||
| + | |||
| + | You just put your linux kernel and rootfs image files in the same directory as the meraki-flash.bat batch file and it does the rest. Expect even runs the TFTP server for you. You just need to make sure the TFTP server is set to " | ||
| + | |||
| + | I've opted for a 1.0MB linux kernel partition instead of 1.5MB. | ||
| + | |||
| + | The script pauses 3 minutes while the Linux image is written to flash, and 5 minutes while the rootfs is written to flash. | ||
| + | |||
| + | I execute the expect script via a batch file: | ||
| + | |||
| + | **meraki-flash.bat** | ||
| + | |||
| + | < | ||
| + | @ECHO OFF | ||
| + | CLS | ||
| + | SET linux_file=openwrt-atheros-2.6-vmlinux.gz | ||
| + | SET rootfs_file=openwrt-atheros-2.6-root.squashfs | ||
| + | REM The above files are copied to the tftp server root directory so the meraki can load them | ||
| + | ECHO . | ||
| + | ECHO . | ||
| + | ECHO About to erase the Meraki' | ||
| + | ECHO and flash %linux_file% and %rootfs_file% | ||
| + | ECHO . | ||
| + | ECHO The Meraki should be turned off now | ||
| + | ECHO Power it after the first ping timeout... | ||
| + | ECHO . | ||
| + | ECHO Press Ctrl-C to abort... or... | ||
| + | PAUSE | ||
| + | ECHO . | ||
| + | ECHO . | ||
| + | ECHO Confirm - Ctrl-C to abort... or... | ||
| + | PAUSE | ||
| + | COPY " | ||
| + | COPY " | ||
| + | " | ||
| + | REM Clean up TFTP-Root directory | ||
| + | DEL " | ||
| + | DEL " | ||
| + | ECHO meraki-flash.bat ends here | ||
| + | PAUSE | ||
| + | </ | ||
| + | |||
| + | Here is the Expect script - which I put in a subdirectory called data | ||
| + | |||
| + | **data/ | ||
| + | |||
| + | < | ||
| + | # start TFTP server | ||
| + | spawn " | ||
| + | # ping meraki, make 20 telnet attempts upon ping reply | ||
| + | spawn ping -t -w 5 192.168.84.1 | ||
| + | set timeout 30 | ||
| + | expect { | ||
| + | " | ||
| + | timeout | ||
| + | } | ||
| + | set timeout 1 | ||
| + | for {set i 0} {$i<20} {incr i 1} { | ||
| + | spawn " | ||
| + | expect { | ||
| + | " | ||
| + | timeout | ||
| + | } | ||
| + | } | ||
| + | # erase/ | ||
| + | set timeout 20 | ||
| + | expect " | ||
| + | send "fis init\n" | ||
| + | expect " | ||
| + | send " | ||
| + | expect { | ||
| + | " | ||
| + | # timeout | ||
| + | } | ||
| + | # TFTP upload linux kernel image | ||
| + | expect " | ||
| + | send "load -r -b 0x80041000 -m tftp -h 192.168.84.9 [lindex $argv 0]\n" | ||
| + | set timeout 5 | ||
| + | expect { | ||
| + | "Raw file loaded" | ||
| + | timeout | ||
| + | } | ||
| + | # flash linux kernel image | ||
| + | expect " | ||
| + | send "fis create -r 0x80041000 -l 0x100000 -e 0x80041000 linux\n" | ||
| + | set timeout 10 | ||
| + | expect | ||
| + | # Close telnet session - it takes a long time to flash and telnet times out anyway | ||
| + | close | ||
| + | spawn cmd | ||
| + | expect " | ||
| + | send_user " | ||
| + | send_user " | ||
| + | send_user " | ||
| + | # Countdown 180 seconds | ||
| + | set timeout 1 | ||
| + | for {set i 180} {$i>0} {incr i -1} { | ||
| + | send_user " | ||
| + | expect | ||
| + | } | ||
| + | close | ||
| + | # Re-open telnet session | ||
| + | set timeout 2 | ||
| + | for {set i 0} {$i<20} {incr i 1} { | ||
| + | spawn " | ||
| + | expect { | ||
| + | " | ||
| + | timeout | ||
| + | } | ||
| + | } | ||
| + | # Check that linux kernel flashed correctly | ||
| + | set timeout 5 | ||
| + | send "fis list\n" | ||
| + | expect { | ||
| + | " | ||
| + | # timeout | ||
| + | } | ||
| + | # TFTP upload rootfs image | ||
| + | expect " | ||
| + | send "load -r -b 0x80041000 -m tftp -h 192.168.84.9 [lindex $argv 1]\n" | ||
| + | set timeout 20 | ||
| + | expect { | ||
| + | "Raw file loaded" | ||
| + | timeout | ||
| + | } | ||
| + | # Flash rootfs image | ||
| + | expect " | ||
| + | send "fis create -r 0x80041000 -l 0x6A0000 rootfs\n" | ||
| + | set timeout 10 | ||
| + | expect | ||
| + | # Close telnet session - it takes a long time to flash and telnet times out anyway | ||
| + | close | ||
| + | spawn cmd | ||
| + | expect " | ||
| + | send_user " | ||
| + | send_user " | ||
| + | send_user " | ||
| + | # Countdown 300 seconds | ||
| + | set timeout 1 | ||
| + | for {set i 300} {$i>0} {incr i -1} { | ||
| + | send_user " | ||
| + | expect | ||
| + | } | ||
| + | close | ||
| + | # Re-open telnet session | ||
| + | set timeout 2 | ||
| + | for {set i 0} {$i<20} {incr i 1} { | ||
| + | spawn " | ||
| + | expect { | ||
| + | " | ||
| + | timeout | ||
| + | } | ||
| + | } | ||
| + | # Check that rootfs image flashed correctly | ||
| + | set timeout 5 | ||
| + | send "fis list\n" | ||
| + | expect { | ||
| + | " | ||
| + | timeout | ||
| + | } | ||
| + | # change boot script | ||
| + | expect " | ||
| + | send " | ||
| + | set timeout 5 | ||
| + | expect ">>" | ||
| + | send "fis load -d linux\n" | ||
| + | expect ">>" | ||
| + | send " | ||
| + | expect ">>" | ||
| + | send " | ||
| + | expect " | ||
| + | send " | ||
| + | # Check that boot script change ocurred | ||
| + | expect " | ||
| + | send " | ||
| + | set timeout 30 | ||
| + | expect { | ||
| + | "fis load -d linux" | ||
| + | timeout | ||
| + | } | ||
| + | # Reset (reboot) Meraki | ||
| + | expect " | ||
| + | send " | ||
| + | send_user " | ||
| + | send_user " | ||
| + | send_user "You sould be able to connect to OpenWRT via Telnet on 192.168.1.1 in about 90 seconds from now\n\n" | ||
| + | send_user "The firstboot operation will take about 3.5 minutes, starting now\n" | ||
| + | send_user " | ||
| + | </ | ||
| + | |||
| + | Here's a Windows registry file that makes the appropriate config changes to the Solarwinds TFTP server to make sure it works with the above script **chng-tftpserver.reg** | ||
| + | |||
| + | < | ||
| + | Windows Registry Editor Version 5.00 | ||
| + | [HKEY_LOCAL_MACHINE\SOFTWARE\SolarWinds.Net\TFTP Server\Config] | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | </ | ||
| + | |||
| + | ===== Tags ===== | ||
| + | [[meta: | ||
| + | {{tag> | ||