Welcome! Log In Create A New Profile


Seafile on Debian Armel

Posted by davygravy 
Seafile on Debian Armel
May 07, 2015 05:08PM
While there is some chatter here and there regarding Seafile on ARM, it seems to be nearly absent when it comes to Kirkwood. So, a couple of questions:

  1. Is it any better for your particular needs, than, say BTSync or ownCloud?
  2. Does it perform better than ownCloud and other such projects?
  3. Can we help users try it out?
  4. Can we improve the experience for Debian Armel users?

For #1 & #2, its a personal question. I chose ownCloud, and I am sticking with it, because of its feature set, its performance, stability, security and strong support. Having said that, it seems that a lot of Raspian users out there do like Seafile running on their Pi's.

So, here's to moving forward with #3 and #4!
  • Note that there is some sort of alignment bug, documented at the github issues area for Seafile, regarding ARMv5/Kirkwood/Feroceon CPU alignment. Maybe someone here can get gdb going on their box and find the remaining alignment problems...
  • A premade armel tarball for Seafile version 4.1.2 (password=seafile) is available for download here via my ownCloud - you'll have to "trust" my self-signed certificate, and be patient with my DSL-router's 640kbps upload speed.
  • Directions for installing the above tarball package can be found here : Deploying Seafile on Linux with Sqlite
  • Post back with your experiences, insight and patches.

I recently followed the build/package instructions @ http://manual.seafile.com/build_seafile/rpi.html ... It is basically correct, with some deviations/updates/questions... that might arise from building on a non-Debian-esque machine.

I have it running on a Dockstar, for "fun" and challenge... and because I wanted to see what the fuss is about. There were enough "gotchas" in the Pi build instructions to make me wonder how well the instructions were actually tested, and how many people got frustrated and quit.

Below, in ugly form, is what I have cobbled together right now as a sequence of commands for anyone else who would like to build and test Seafile for one of our Armel machines.

READ THROUGH to the end, and make note of the CPU alignment bug. A workaround ( echo 2 > /proc/cpu/alignment ) is available. YMMV, proceed at your own risk.

#Seafile Build Instructions V2

# starting w/ fresh rootfs of Wheezy (or Jessie)

# most commands where executed in ~/  (in this case, /home/dev , homedir of a regular+sudoer user)

# install essential Debian packages

apt-get install libevent-dev libcurl4-openssl-dev libglib2.0-dev uuid-dev intltool \
 libsqlite3-dev libmysqlclient-dev libarchive-dev libtool libjansson-dev valac   \
 libfuse-dev re2c flex python-setuptools cmake git build-essential python-simplejson \
 python-imaging python-pip python-dev unzip
# Want postgresql support (instead of sqlite or mysql? If so...
#  sudo apt-get install postgresql postgresql-server-dev-all libpq-dev

# set up easy_install for python2.7  (I'd like to avoid this... but... had to)
#  wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python
#  ... mistake was that I forgot sudo prior to easy_install cmd
# djblets required python-imaging
# maybe better to build django 1.5.12 rather than use Debian's 1.4.x
# consider adding in postgresql support next time!
 #  install libevhtp 
cd ~/
git clone https://www.github.com/haiwen/libevhtp.git
cd libevhtp
sudo make install

# missing header to fix "/usr/local/include/evhtp.h:11:23: fatal error: onigposix.h: No such file or directory"
#  ... this error doesn't show up until much later in the build process, but this is the its origin
sudo cp oniguruma/onigposix.h /usr/local/include/

 #  install libzdb

cd ~/
git clone https://www.github.com/haiwen/libzdb.git
cd libzdb
chmod +x autogen.sh
sudo make install

# update lib
sudo ldconfig

# Download tarballs for thirdpart components

cd /tmp
wget -O Django-1.5.12.tar.gz https://www.djangoproject.com/download/1.5.12/tarball/
wget -O djblets-0.6.14.tar.gz http://downloads.reviewboard.org/releases/Djblets/0.6/Djblets-0.6.14.tar.gz
wget -O gunicorn-0.16.1.tar.gz   http://pypi.python.org/packages/source/g/gunicorn/gunicorn-0.16.1.tar.gz
wget -O flup-1.0.tar.gz  http://pypi.python.org/packages/source/f/flup/flup-1.0.tar.gz
# wget -O chardet-1.0.tar.gz   https://pypi.python.org/packages/source/c/chardet/chardet-1.0.tar.gz
#   unknown if 2.3.0 has any advantages over 1.0
wget -O chardet-2.3.0.tar.gz https://pypi.python.org/packages/source/c/chardet/chardet-2.3.0.tar.gz
wget --no-check-certificate -O python-dateutil-1.5.tar.gz  https://labix.org/download/python-dateutil/python-dateutil-1.5.tar.gz
wget -O six-1.9.0.tar.gz  https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz                                     

# make dir for thirdpart components
mkdir -p ~/seahub_thirdpart
cd ~/seahub_thirdpart/

# I ran into a problem where I didn't have adequate space for the django to be built in tmp...
#  "error: Setup script exited with error: No space left on device"
#  had to resort to fixing /usr/lib/python2.6/dist-packages/setuptools/command/easy_install.py
#  see http://stackoverflow.com/questions/7621103/easy-install-downloading-directory
#  FIX = /usr/lib/python2.6/dist-packages/setuptools/command/easy_install.py
#  find "tempfile.mkdtemp", change to something like below ... (/mnt is where I mounted sda3 ... lots of space)
#              tmpdir = tempfile.mkdtemp(prefix="easy_install-",dir="/mnt")
chmod 777 -R /mnt  # make writeable, so that python has lots of build space

easy_install -d . /tmp/Django-1.5.12.tar.gz
easy_install -d . /tmp/djblets-0.6.14.tar.gz
easy_install -d . /tmp/gunicorn-0.16.1.tar.gz
easy_install -d . /tmp/flup-1.0.tar.gz
# easy_install -d . /tmp/chardet-1.0.tar.gz
easy_install -d . /tmp/chardet-2.3.0.tar.gz
easy_install -d . /tmp/python-dateutil-1.5.tar.gz
easy_install -d . /tmp/six-1.9.0.tar.gz

# unzip 2 of the .egg files : otherwise an error was triggered during later build activity
#unzip chardet-1.0-py2.7.egg
#unzip flup-1.0-py2.7.egg
# error doesn't seem to appear any more...

cd  ~/

#  set some paths for building stuff...
export PKG_CONFIG_PATH=/home/dev/seafile/lib:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=/home/dev/libsearpc:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=/home/dev/ccnet:$PKG_CONFIG_PATH

# prep a dir for seafile-sources
mkdir ~/seafile-sources

# clone and prepare Seafile source tarballs

cd ~/
git clone https://github.com/haiwen/libsearpc.git
cd libsearpc
git reset --hard v3.0-latest
make dist
cp *.tar.gz ~/seafile-sources/

cd ~/
git clone https://github.com/haiwen/ccnet.git
cd ccnet
git reset --hard v4.1.1-server
make dist
cp *.tar.gz ~/seafile-sources/

cd ~/
git clone https://github.com/haiwen/seafile.git
cd seafile
git reset --hard v4.1.1-server
make dist
cp *.tar.gz ~/seafile-sources/

cd ~/
git clone https://github.com/haiwen/seahub.git
cd seahub
git reset --hard v4.1.1-server
sudo pip install -r requirements.txt    # did this to get around what looked like missing dependencies 
                                        #  (debs _were_ installed, but not seemingly recognized)
                                        # Pillow and Django were installed...
./tools/gen-tarball.py --version=4.1.1 --branch=HEAD
cp *.tar.gz ~/seafile-sources/

cd ~/
git clone https://github.com/haiwen/seafobj.git
cd seafobj
git reset --hard v4.1.1-server
make dist
cp *.tar.gz ~/seafile-sources/

cd ~/
git clone https://github.com/haiwen/seafdav.git
cd seafdav
git reset --hard v4.1.1-server
cp *.tar.gz ~/seafile-sources/

# Now, the seafile build system/script requires that a few of the sources are "tagged" with the same version number...
# ...so we go to ~/seafile-sources, untar some of them, change the dir names to have the same version number & retar

cd ~/seafile-sources/

tar xzvf seafile-<version>.tar.gz
mv seafile-<version> seafile-4.1.1
tar czvf seafile-4.1.1.tar.gz seafile-4.1.1

tar xzvf seahub-<version>.tar.gz
mv seahub-<version> seahub-4.1.1
tar czvf seahub-4.1.1.tar.gz seahub-4.1.1

#  STOP : If building for ARMv5 (e.g. Kirkwood, you should take notice the reports of an cpu alignment bug in some of the buffer code in
#               the ccnet package.  The ugly workaround is to execute  "sudo echo 2 > /proc/cpu/alignment" before starting
#               the seafile server.   
#               In git issues, it is mentioned here : https://github.com/haiwen/seafile/issues/306

#               Other mentions are here:
#               On googlegroups:    https://groups.google.com/forum/#!topic/seafile/XwnBqivfijg

#               I tried this patch : https://gist.github.com/Chilledheart/81bea16e007c6d426355
#               ... and although it worked for Chilledheart on his ARMv7 Chromebook, it did not work for me.
#   ---optional steps to patch ccnet:
tar xzvf ccnet-<version>.tar.gz
cd ccnet-<version>
wget https://gist.githubusercontent.com/Chilledheart/81bea16e007c6d426355/raw/13cf7b07400a19078df48e16316e691e5b361233/0001-remove-obsolete-buffer.c.patch

patch -p1 < 0001-remove-obsolete-buffer.c.patch
cd ..
tar czvf ccnet-<version>.tar.gz ccnet-<version>

#  Build the server+components and stuff in tarball 

cd ~/

/home/dev/seafile/scripts/build/build-server.py --libsearpc_version=1.2.2 --ccnet_version=1.4.2 --seafile_version=4.1.2  --thirdpartdir=/home/dev/seahub_thirdpart --srcdir=/home/dev/seafile-sources --outputdir=/home/dev/seafile-server-pkgs --version=4.1.2 --builddir=/mnt/ --keep

#The seafile-server package/tarball will be found in : /home/dev/seafile-server-pkgs

# For installing and starting/stopping the server components, read and follow the docs  : http://manual.seafile.com/deploy/index.html


Edited 14 time(s). Last edit at 05/09/2015 02:46PM by davygravy.
Re: Seafile on Debian Armel
May 07, 2015 05:46PM
Having recently installed the latest Owncloud on a Pogoplug Pro (Oxnas based), which was really easy, I would have to recommend that if one's Linux skills are basic. It's also pretty fast. I also installed OpenMediaVault which also works relatively well but is much more complicated to setup and to operate especially on armel.
Re: Seafile on Debian Armel
May 08, 2015 02:44PM
ARMv5 has no support for misaligned memory accesses. In such architecture, variable must be allocated at the address of multiple of its length. Hence narrow pointer type should not be converted to wide pointer type.

There are two ways to align the memory:

1. Allocate wide variable before the narrow one.
2. Make a copy of the variable byte-wise using memmove(3).

Re: Seafile on Debian Armel
May 09, 2015 01:16PM
Any chance that the -Wcast-align flag could detect these?

Or is it strictly gdb that is going to find them?

    packet-io.c: In function 'ccnet_packet_finish':
    packet-io.c:134:14: warning: cast increases required alignment of target type [-Wcast-align]
    packet-io.c: In function 'ccnet_packet_io_read_packet':
    packet-io.c:166:14: warning: cast increases required alignment of target type [-Wcast-align]
    packet-io.c:174:14: warning: cast increases required alignment of target type [-Wcast-align]
    packet-io.c: In function 'ccnet_packet_io_read':
    packet-io.c:215:18: warning: cast increases required alignment of target type [-Wcast-align]
    In file included from peer.c:6:0:
    peer-common.h: In function 'get_property':
    peer-common.h:35:23: warning: cast increases required alignment of target type [-Wcast-align]
    peer-common.h: In function 'set_property_common':
    peer-common.h:141:23: warning: cast increases required alignment of target type [-Wcast-align]
    peer.c: In function 'ccnet_peer_free':
    peer.c:54:23: warning: cast increases required alignment of target type [-Wcast-align]
    cevent.c: In function 'pipe_callback':
    cevent.c:36:14: warning: cast increases required alignment of target type [-Wcast-align]
    ccnet-rpc-wrapper.c: In function 'ccnet_get_peer':
    ccnet-rpc-wrapper.c:105:12: warning: cast increases required alignment of target type [-Wcast-align]
    ccnet-rpc-wrapper.c: In function 'ccnet_get_peer_by_idname':
    ccnet-rpc-wrapper.c:115:12: warning: cast increases required alignment of target type [-Wcast-align]
    bloom-filter.c: In function 'bloom_add':
    bloom-filter.c:129:24: warning: cast increases required alignment of target type [-Wcast-align]
    bloom-filter.c: In function 'bloom_remove':
    bloom-filter.c:146:24: warning: cast increases required alignment of target type [-Wcast-align]
    bloom-filter.c: In function 'bloom_test':
    bloom-filter.c:166:24: warning: cast increases required alignment of target type [-Wcast-align]
    net.c: In function 'sock_ntop':
    net.c:301:36: warning: cast increases required alignment of target type [-Wcast-align]
    net.c: In function 'sock_port':
    net.c:385:36: warning: cast increases required alignment of target type [-Wcast-align]


Edited 1 time(s). Last edit at 05/09/2015 01:30PM by davygravy.
Re: Seafile on Debian Armel
December 08, 2015 03:54AM
Hi. Did you have recent success? I am trying to run it on a QNAP TS209 (Orion), but i wonder why there is nearly no information on the web on how to do it. Is it possible?

Your Email:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.