Sign in to follow this  
udif

Resilio sync on Linksys wrt1900ACS and other OpenWRT boxes

Recommended Posts

I wanted to share a method I usccessfully used to run Resilio sync without any modifications on my Linksys OpenWRT1900ACS running OpenWRT (with a USB3 attached disk).

Since OpenWRT uses different libraries than what resilio sync usually requires, my solution was to create a chroot environment on the external USB disk attached to the router.

I had to use a different armhf system already running debian (in my case it was a pcduino3nano board running armbian).

debootstrap --arch armhf jessie /mnt/disk1/armbian http://httpredir.debian.org/debian
tar cpjf /mnr/disk1/armbian-rootfs.tar.bz2 -C /mnt/disk1/armbian .

I then copied this tree using tar and SSH into my LInksys router (to the USB3 disk).

scp /mnt/disk1/armbian-rootfs.tar.bz root@linksys:/mnt/sda1

I then SSH'ed into the linksys, extracted the tree and shelled into the chroot'ed environment.

ssh linksys -l root
...
cd /mnt/sda1/armbian
# we need a /proc filesystem, use the existing one
mkdir /proc
mount --bind -t proc /proc /mnt/disk1/armbian/proc
# This is necessary because the chroot expects /bin/ash to be found
ln -s /bin/bash bin/ash
# extract the tree
bzcat /mnt/sda1/armbian-rootfs.tar.bz | tar xvf -
# start it
chroot /mnt/sda1/armbian

You can now install Resilio sync as explained here:

https://help.resilio.com/hc/en-us/articles/206178924-Installing-Sync-package-on-Linux

I also added a firewall rule in the OpenWRT GUI to enable port 8888 access from my LAN, not sure this is 100% necessary.

The method above works but you should be aware of 2 drawbacks:

  1. The chroot'ed environment takes about 250MB before trimming
  2. You cannot normally access any storage area outside your chroot.

In my case I didn't care about either of these, but you may try trimming the chroot environment by removing some of the default packages installed by the debian debootstrap script.

You can also overcome the disk access limit by using a bind mount (before running chroot)

mount --bind /mnt/disk1/storage /mnt/disk1/armbian/storage

I hope other people find this useful!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this