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

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

development_resources:router:usb_extroot_installation [2014/01/20 21:16] (current)
Line 1: Line 1:
 +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 ======
 +  * http://​wiki.openwrt.org/​doc/​howto/​extroot#​openwrt.attitude.adjustment.12.09
 +  * "For pivot root (only possible as of r26109!) you must make sure to have a complete root filesystem on the external rootfs device. One possible way to get such a system (assuming the filesystem for the new external rootfs is mounted on /mnt/sda1) is to issue"
 +
 +
 +===== 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:
 +    * point /​etc/​opkg.conf to http://​downloads.commotionwireless.net/​router/​1.0/​ar71xx/​generic/​packages/​
 +    * opkg install commotion meta packages
 +  * OR attempt upgrading using a compiled sysupgrade image for the mr3020
 +
 +===== Instructions for TP-Link TL-MR3020 =====
 +
 +==== Basic Steps to get USB storage ====
 +  * Flash router using TP-Link web interface, tftp, [[mtd http://​wiki.openwrt.org/​doc/​howto/​generic.sysupgrade#​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.
 +<​code>​config interface '​lan'​
 +        option ifname '​eth0'​
 +        option proto '​dhcp'​ </​code>​
 +  * 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:
 +<​code>​
 +mkdir -p /tmp/cproot
 +mount --bind / /tmp/cproot
 +tar -C /tmp/cproot -cvf - . | tar -C /mnt/sda1 -xf -
 +umount /tmp/cproot
 +</​code>​
 +  * Update ''/​etc/​config/​fstab''​ to mount the USB device as the root filesystem
 +<​code>​
 +config mount 
 +  option target /  ​
 +  option device /​dev/​sda1 ​
 +  option fstype ext4
 +  option options rw,​sync  ​
 +  option enabled 1 
 +  option enabled_fsck 0
 +</​code>​
 +  * Reboot the router: ''​reboot & exit''​
 +  * Once the router has rebooted, reconnect and confirm that the USB stick is mounted as the root filesystem
 +<​code>​
 +# 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.)
 +</​code>​
 +
 +==== Install Commotion packages on the router ====
 +  * Update ''/​etc/​opkg.conf''​ to point at http://​downloads.commotionwireless.net/​router/​1.0/​ar71xx/​generic/​packages
 +    * Change the first line from:
 +      * ''​src/​gz attitude_adjustment http://​downloads.openwrt.org/​attitude_adjustment/​12.09/​ar71xx/​generic/​packages
 +''​
 +      * TO: ''​src/​gz attitude_adjustment http://​downloads.commotionwireless.net/​router/​1.0/​ar71xx/​generic/​packages
 +''​
 +  * Run: ''​opkg update''​
 +  * Install Commotion packages: ''​opkg install commotion''​ **Not yet fully tested! See testing notes, 1-18-14**
 +  * Run: ''​reboot & exit''​
 +
 +  * 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:
 +<​code>​
 +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.
 +</​code>​
 +  * **1-20-14:​** building an OpenWRT AA image against the Commotion build stack, using modifications to commotion-feeds (branch tp-mr3020) and setup.sh.
 +    * 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