Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--- ZeroTierOne-1.2.10/make-linux.mk 2018-05-11 22:40:22.000000000 +0200
+++ ZeroTierOne-1.2.10-oe/make-linux.mk 2018-05-26 20:54:41.091647361 +0200
@@ -63,13 +63,13 @@
# C25519 in particular is almost UNUSABLE in -O0 even on a 3ghz box!
node/Salsa20.o node/SHA512.o node/C25519.o node/Poly1305.o: CXXFLAGS=-Wall -O2 -g -pthread $(INCLUDES) $(DEFS)
else
- CFLAGS?=-O3 -fstack-protector -fPIE
+ CFLAGS?=-O3 -fstack-protector
override CFLAGS+=-Wall -Wno-deprecated -pthread $(INCLUDES) -DNDEBUG $(DEFS)
- CXXFLAGS?=-O3 -fstack-protector -fPIE
+ CXXFLAGS?=-O3 -fstack-protector
override CXXFLAGS+=-Wall -Wno-deprecated -std=c++11 -pthread $(INCLUDES) -DNDEBUG $(DEFS)
- LDFLAGS=-pie -Wl,-z,relro,-z,now
- STRIP?=strip
- STRIP+=--strip-all
+ LDFLAGS+= -Wl,-z,relro,-z,now
+ STRIP?=echo
+# STRIP+=--strip-all
endif

ifeq ($(ZT_QNAP), 1)
54 changes: 54 additions & 0 deletions meta-networking/recipes-support/zerotier-one/zerotier-one/zerotier
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/sh

DAEMON="/usr/sbin/zerotier-one"
prog=`basename $DAEMON`
MODULE="tun"
PIDFILE="/var/lib/zerotier-one/zerotier-one.pid"

test -e $DAEMON || exit 0

case "$1" in
start)
if [ -d /var/lib/samba/msg.lock ]; then
rm -rf /var/lib/samba/msg.lock
fi
echo -n "Starting $prog"

# Make sure kernel module is loaded
if ! grep -q $MODULE /proc/filesystems
then
# Try load the kernel module fail if we can't
modprobe $MODULE >/dev/null 2>&1
if [ $? -eq 1 ]
then
echo "Error: failed to load $MODULE module."
return 1
fi
fi

start-stop-daemon --start --quiet --background --exec $DAEMON
echo "."
;;
stop)
echo -n "Stopping $prog"
start-stop-daemon --stop --quiet --pidfile $PIDFILE
echo "."
;;
reload|force-reload)
start-stop-daemon --stop --quiet --signal 1 --exec $DAEMON
;;
restart)
$0 stop
echo -n "Waiting for processes to die off"
for i in 1 2 3 ;
do
sleep 1
echo -n "."
done
echo ""
$0 start
;;
*)
echo "Usage: /etc/init.d/$0 {start|stop|reload|restart|force-reload}"
exit 1
esac
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
SUMMARY = "ZeroTier creates a global provider-independent virtual private cloud network"
DESCRIPTION = "Create flat virtual Ethernet networks of almost unlimited size"
HOMEPAGE = "https://www.zerotier.com"
SECTION = "net"
LICENSE = "GPLv3"
LIC_FILES_CHKSUM = "file://COPYING;md5=886557d0c9eee76bfbb292c1e01e2f43"
DEPENDS = ""

SRC_URI = "https://github.com/zerotier/ZeroTierOne/archive/1.2.10.tar.gz \
file://0001-remove-pie-and-strip-and-allow-cflags.patch \
file://zerotier"

SRC_URI[md5sum] = "b5454b93bfc67439839c334756788357"
SRC_URI[sha256sum] = "1c79ec57e67764079a77704b336e642ae3cf221dc8088b0cf9e9c81e0a9c0c57"

S = "${WORKDIR}/ZeroTierOne-${PV}"

INSANE_SKIP_${PN} = "ldflags"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
INHIBIT_PACKAGE_STRIP = "1"

RDEPENDS_${PN} = "kernel-module-tun"

inherit update-rc.d systemd

INITSCRIPT_NAME = "zerotier"
INITSCRIPT_PARAMS = "defaults 11"

do_configure () {
}

do_compile () {
oe_runmake all
}

do_install() {
install -d ${D}${sbindir}
install -m 755 zerotier-one ${D}${sbindir}
ln zerotier-one ${D}${sbindir}/zerotier-cli
ln zerotier-one ${D}${sbindir}/zerotier-idtool
chown -R root:root ${D}${sbindir}/zerotier-cli
install -d ${D}/var/lib/zerotier-one
ln -s ../../..${sbindir}/zerotier-one ${D}/var/lib/zerotier-one/zerotier-one
ln -s ../../..${sbindir}/zerotier-one ${D}/var/lib/zerotier-one/zerotier-cli
ln -s ../../..${sbindir}/zerotier-one ${D}/var/lib/zerotier-one/zerotier-idtool
install -d ${D}${sysconfdir}/init.d/
install -m 755 ../zerotier ${D}${sysconfdir}/init.d/
}