OpenELEC / unofficial-addons

OpenELEC unofficial addons
79 stars 125 forks source link

rsync for OpenELEC 8 #169

Open machour opened 6 years ago

machour commented 6 years ago

I have the unofficial-addons enabled, but I can't seem to find rsync, or chromium on OpenElec. I also noticed that there is no git tag in this repo for openelec-8.

Is there a new project superseding this one?

me-kell commented 6 years ago

Why has rsync been removed from unofficial-addons version 8?

MichaelThessel commented 6 years ago

OpenElec 8 has been out for a year. I would assume at this point that there won't be any support for it in the future.

I managed to get rsync working though. I will outline this here, it might come in handy for someone else. I cross compiled rsync for armv7 on my regular Linux machine and then copied the binary to my OpenElec box. This workflow is specific for ARMv7 but should be easily adapted for any other architecture.

Fetch and unpack the rsync sources:

# wget https://download.samba.org/pub/rsync/src/rsync-3.1.3.tar.gz
# tar -xzvf rsync-3.1.3.tar.gz 
# cd rsync-3.1.3

I installed the ARM GNU Compiler Collection. I'm on Arch and the package is in the AUR:

aur/arm-linux-gnueabihf-gcc

Initially I had installed:

community/aarch64-linux-gnu-gcc

This only works for ARMv8 though. If you wan't to compile for a RaspberryPIv3 this might be the way to go as this is available as pre-compiled binary while you have to compile the ARM GNU Compiler Collection which took several hours on my machine.

Next generate the Makefile:

./configure --disable-acl-support --disable-xattr-support --with-included-popt

Then edit the Makefile and replace:

CC=gcc   
CC=arm-linux-gnueabihf-gcc -march=armv7

If you want to compile for a different architecture or use another compiler adjust accordingly. To see the architecture you want to compile against, run this on your OpenElec box

# uname -a
Linux Projector 4.9.30 #1 SMP Mon May 29 09:51:09 CEST 2017 armv7l GNU/Linux

Next compile rsync:

# make

Once its done you can check if it compiled for the correct architecture with:

# file rsync
rsync: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=5129f7b08ff6d57de2e32b7e43de782a887aa06f, with debug_info, not stripped

Then create the directory structure and copy over the binary to the OpenElec box:

# mkdir -p /storage/.kodi/addons/network.backup.rsync/bin

...

#  scp ./rsync openelecbox:/storage/.kodi/addons/network.backup.rsync/bin/

I then use rsync like this to sync data to the OpenElec box:

rsync --bwlimit=1000 --progress -av --delete -e ssh --rsync-path=/storage/.kodi/addons/network.backup.rs
ync/bin/rsync /mnt/usb/backup/musi/ root@openelecbox:/var/media/sda2-ata-WDC_WD7500BPKT-0/music/