The ailing Routerboard 411 in one of my previous posts has been sitting in a plastic tub under my bed awaiting replacement capacitors, a sudden level-up in my soldering ability, and a dramatic increase in my level of confidence in not destroying things by jabbing at them with a giant heating element. I still have none of the three; however, one of my friends donated his time and effort and replaced the four dead capacitors for me. (Thanks, Will! I owe you a gift card.)
Now that the capacitors have been replaced, I’ve put OpenWRT on the device for good. The instructions here are dubious. I did things the manual way according to this blog post, starting from the point after I had booted into OpenWRT’s ramdisk image as detailed in my previous post about this router.
First, I formatted the NAND flash partitions. You can do that from the bootloader or via the following commands from within the ramdisk image:
mtd erase kernel mtd erase rootfs
You can also view the current partition layout using the following command:
cat /proc/mtd
Note down the rootfs and kernel partitions.
Next, I copied the OpenWRT kernel (openwrt-ar71xx-mikrotik-vmlinux.elf) and rootfs (openwrt-ar71xx-mikrotik-Ath5k-rootfs.tar.gz) to the router. You could use scp for this, or wget the files from a webserver. On the router:
scp user@yourhost:path/to/openwrt-ar71xx-mikrotik-vmlinux.elf /tmp scp user@yourhost:path/to/openwrt-ar71xx-mikrotik-Ath5k-rootfs.tar.gz /tmp
Then, mount the rootfs and kernel partitions using the partition layout you observed. (Yes, these are the partitions you just erased. It works. It’s automagical!)
mkdir /mnt/kernel mkdir /mnt/rootfs mount -t yaffs2 /dev/mtdblock5 /mnt/kernel mount -t yaffs2 /dev/mtdblock6 /mnt/rootfs
Finally, copy and extract the files to their new homes.
mv /tmp/openwrt-ar71xx-mikrotik-vmlinux.elf /mnt/kernel/kernel chmod +x /mnt/kernel/kernel cd /mnt/rootfs tar -xzf /tmp/openwrt-ar71xx-mikrotik-Ath5k-rootfs.tar.gz cd / umount /mnt/kernel umount /mnt/rootfs
Reboot the board. You should have life at 192.168.1.1 after things settle down. Don’t forget to reconfigure the bootloader if necessary to boot from NAND instead of from the network.