Add New Page: You are not allowed to add pages Select section/namespace. New page title.

This page contains testing notes for installing Commotion Router on low resource devices like the TP-Link MR3020 and MR3040. Work in progress.

USB Root and/or external overlay for low resource routers

Initial test plan

  • install stock openwrt image
  • connect to a gateway to provide the node internet access
  • install required usb drivers/packages/kmods
  • mount a usb stick and see where it's mount point is
  • use extroot (pivot root) to make the USB stick the root file system
  • Either:
  • OR attempt upgrading using a compiled sysupgrade image for the mr3020

Basic Steps to get USB storage

  • Flash router using TP-Link web interface, tftp, mtd or other means with stock OpenWrt AA
  • format a USB stick with an ext4 file system on a separate computer
  • Login to the newly flashed router, set the root password, configure the ethernet port for a local area network connected to the Internet. For testing, we configured /etc/config/network to receive a DHCP lease from a switch.
config interface 'lan'
        option ifname 'eth0'
        option proto 'dhcp' 
  • ssh into the router and ensure these packages are installed: kmod-usb-storage block-mount kmod-fs-ext4
    • opkg install kmod-usbstorage block-mount kmod-fs-ext4
  • Plug in the pre-formatted USB device and find its mount point: dmesg or dmesg | grep usb
  • Create a mount point for the usb drive: mkdir /mnt/sda1
  • mount USB drive: mount /dev/sda1 /mnt/sda1

Configure the root file system to be on the USB device

  • Copy necessary files to flash to the new root partition:
mkdir -p /tmp/cproot
mount --bind / /tmp/cproot
tar -C /tmp/cproot -cvf - . | tar -C /mnt/sda1 -xf -
umount /tmp/cproot
  • Update /etc/config/fstab to mount the USB device as the root filesystem
config mount 
  option target /  
  option device /dev/sda1 
  option fstype ext4
  option options rw,sync  
  option enabled 1 
  option enabled_fsck 0
  • Reboot the router: reboot & exit
  • Once the router has rebooted, reconnect and confirm that the USB stick is mounted as the root filesystem
# df

Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                15579712    371160  14426884   3% /
/dev/root                 2048      2048         0 100% /rom
tmpfs                    14608       100     14508   1% /tmp
tmpfs                      512         0       512   0% /dev
/dev/sda1             15579712    371160  14426884   3% /
#(note that the line for rootfs and /dev/sda1 are exactly the same.)

Install Commotion packages on the router

  • Configure Commotion using setup wizard Not tested
    • the router *should* reboot with Commotion installed on the USB stick, behaving as expected by a newly flashed higher resource node

Testing Notes

  • 1-18-14: stock install of OpenWRT AA is not at a kernel version great enough to support upgrades via opkg.
    • Error messages on opkg install:
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for commotion:
 * 	luci-lib-nixio_cyassl * 	argp-standalone * 	kernel (= 3.3.8-1-ccd7796d0ebc3a2e79984d7dd2214393) * 
 * opkg_install_cmd: Cannot install package commotion.
  • 1-20-14: building an OpenWRT AA image against the Commotion build stack, using modifications to commotion-feeds (branch tp-mr3020) and
    • Kept patches, removed all commotion feeds except for cyassl and ldns, and removed default-files/* from the build. hoping this will get a standard OpenWRT image built with the compatible kernel, and include cyassl. Ideally, the resulting build will be small enough to also build a sysupgrade image.

Next steps

  • Flash with image containing kernel (= 3.3.8-1-ccd7796d0ebc3a2e79984d7dd2214393)
  • Attemting to build an image without commotion packages against our toolchain.

Future to do

* create installation scripts to automate this process

development_resources/router/usb_extroot_installation.txt · Last modified: 2014/01/20 21:16 (external edit)
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported