Skip to content
Merged
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
1 change: 1 addition & 0 deletions general/package/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ source "$BR2_EXTERNAL_GENERAL_PATH/package/mini/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/motors/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/msposd/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/mt7601u-openipc/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/n3n-openipc/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/nabto/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/node-exporter/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/novatek-osdrv-nt9856x/Config.in"
Expand Down
12 changes: 12 additions & 0 deletions general/package/n3n-openipc/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# Copyright (c) OpenIPC https://openipc.org MIT License
#
# Config.in — Buildroot package Kconfig menu
#
config BR2_PACKAGE_N3N_OPENIPC
bool "n3n-openipc"
help
n3n is a light VPN software which makes it easy to create
virtual networks bypassing intermediate firewalls

https://github.com/n42n/n3n
53 changes: 53 additions & 0 deletions general/package/n3n-openipc/files/S89edge
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/sh
#
# Copyright (c) OpenIPC https://openipc.org MIT License
#
# S89edge — SysV init script for edge
#

DAEMON="n3n-edge"
PIDFILE="/var/run/$DAEMON.pid"
DAEMON_ARGS="start"

start() {
echo -n "Starting $DAEMON: "
modprobe tun
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "$DAEMON" -- $DAEMON_ARGS
if [ $? -eq 0 ]; then
echo "OK"
else
echo "FAIL"
fi
}

stop() {
echo -n "Stopping $DAEMON: "
start-stop-daemon -K -q -p "$PIDFILE"
if [ $? -eq 0 ]; then
rm -f "$PIDFILE"
echo "OK"
else
echo "FAIL"
fi
}

case "$1" in
start|stop)
$1
;;

restart)
stop
sleep 3
start
;;

reload)
killall -1 "$DAEMON"
;;

*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
;;
esac
37 changes: 37 additions & 0 deletions general/package/n3n-openipc/n3n-openipc.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
################################################################################
#
# Copyright (c) OpenIPC https://openipc.org MIT License
#
# n3n-openipc — n3n-openipc Buildroot package
#
################################################################################

N3N_OPENIPC_SITE = $(call github,n42n,n3n,$(N3N_OPENIPC_VERSION))
N3N_OPENIPC_VERSION = 44b93f02f30a12187a6802b0268f614c08b41077
# N3N_OPENIPC_VERSION = HEAD

N3N_OPENIPC_LICENSE = GPL-2.0
N3N_OPENIPC_LICENSE_FILES = LICENSE
N3N_OPENIPC_INSTALL_STAGING = YES

N3N_OPENIPC_CFLAGS = $(TARGET_CFLAGS) -fno-strict-aliasing

define N3N_OPENIPC_RUN_AUTOGEN
cd $(@D) && PATH=$(BR_PATH) ./autogen.sh
endef

N3N_OPENIPC_PRE_CONFIGURE_HOOKS += N3N_OPENIPC_RUN_AUTOGEN

#N3N_OPENIPC_CONF_OPTS += -DCMAKE_BUILD_TYPE=Release
N3N_OPENIPC_MAKE_OPTS += VERBOSE=1

define N3N_OPENIPC_INSTALL_TARGET_CMDS
$(INSTALL) -m 755 -d $(TARGET_DIR)/etc/init.d
$(INSTALL) -m 755 -t $(TARGET_DIR)/etc/init.d $(N3N_OPENIPC_PKGDIR)/files/S89edge

$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/sbin
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/sbin $(@D)/apps/n3n-edge
# $(INSTALL) -m 755 -t $(TARGET_DIR)/usr/sbin $(@D)/apps/n3n-supernode
endef

$(eval $(autotools-package))