split gluon-radvd into gluon-radvd-babel and gluon-radvd-batman, make mkconfig for gluon-mesh-babel more flexible
This commit is contained in:
parent
6a7afebecc
commit
2a68763ad0
37
package/gluon-mesh-babel/files/etc/init.d/gluon-mesh-babel
Executable file
37
package/gluon-mesh-babel/files/etc/init.d/gluon-mesh-babel
Executable file
@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
|
||||||
|
. $IPKG_INSTROOT/lib/functions/network.sh
|
||||||
|
|
||||||
|
START=70
|
||||||
|
|
||||||
|
pidfile='/var/run/babeld.pid'
|
||||||
|
CONFIGFILE='/var/etc/gluon-babel.conf'
|
||||||
|
EXTRA_COMMANDS="status"
|
||||||
|
EXTRA_HELP=" status Dump Babel's table to the log file."
|
||||||
|
|
||||||
|
start() {
|
||||||
|
mkdir -p /var/lib
|
||||||
|
mkdir -p /var/etc
|
||||||
|
/lib/gluon/gluon-mesh-babel/mkconfig "$CONFIGFILE"
|
||||||
|
/usr/sbin/babeld -D -I "$pidfile" -c "$CONFIGFILE"
|
||||||
|
# Wait for the pidfile to appear
|
||||||
|
for i in 1 2
|
||||||
|
do
|
||||||
|
[ -f "$pidfile" ] || sleep 1
|
||||||
|
done
|
||||||
|
[ -f "$pidfile" ] || (echo "Failed to start babeld"; exit 42)
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
[ -f "$pidfile" ] && kill $(cat $pidfile)
|
||||||
|
# avoid race-condition on restart: wait for
|
||||||
|
# babeld to die for real.
|
||||||
|
[ -f "$pidfile" ] && sleep 1
|
||||||
|
[ -f "$pidfile" ] && sleep 1
|
||||||
|
[ -f "$pidfile" ] && sleep 1
|
||||||
|
[ -f "$pidfile" ] && exit 42
|
||||||
|
}
|
||||||
|
|
||||||
|
status() {
|
||||||
|
[ -f "$pidfile" ] && kill -USR1 $(cat $pidfile)
|
||||||
|
}
|
@ -1,20 +1,20 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=gluon-radvd
|
PKG_NAME:=gluon-radvd-babel
|
||||||
PKG_VERSION:=4
|
PKG_VERSION:=4
|
||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
define Package/gluon-radvd
|
define Package/gluon-radvd-babel
|
||||||
SECTION:=gluon
|
SECTION:=gluon
|
||||||
CATEGORY:=Gluon
|
CATEGORY:=Gluon
|
||||||
TITLE:=Advertise an IPv6 prefix from the node
|
TITLE:=Advertise an IPv6 prefix from the node
|
||||||
DEPENDS:=+gluon-core +uradvd
|
DEPENDS:=+gluon-core +uradvd
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/gluon-radvd/description
|
define Package/gluon-radvd-babel/description
|
||||||
Gluon community wifi mesh firmware framework: Advertise an IPv6 prefix from the node
|
Gluon community wifi mesh firmware framework: Advertise an IPv6 prefix from the node
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@ -28,8 +28,8 @@ endef
|
|||||||
define Build/Compile
|
define Build/Compile
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/gluon-radvd/install
|
define Package/gluon-radvd-babel/install
|
||||||
$(CP) ./files/* $(1)/
|
$(CP) ./files/* $(1)/
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,gluon-radvd))
|
$(eval $(call BuildPackage,gluon-radvd-babel))
|
15
package/gluon-radvd-babel/files/etc/init.d/gluon-radvd
Executable file
15
package/gluon-radvd-babel/files/etc/init.d/gluon-radvd
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
|
||||||
|
START=50
|
||||||
|
|
||||||
|
SERVICE_WRITE_PID=1
|
||||||
|
SERVICE_DAEMONIZE=1
|
||||||
|
|
||||||
|
|
||||||
|
start() {
|
||||||
|
service_start /usr/sbin/uradvd -i local-node -a $(lua -e 'print(require("gluon.site_config").prefix6)') --default-lifetime 900
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
service_stop /usr/sbin/uradvd
|
||||||
|
}
|
35
package/gluon-radvd-batman/Makefile
Normal file
35
package/gluon-radvd-batman/Makefile
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=gluon-radvd-batman
|
||||||
|
PKG_VERSION:=4
|
||||||
|
|
||||||
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
define Package/gluon-radvd-batman
|
||||||
|
SECTION:=gluon
|
||||||
|
CATEGORY:=Gluon
|
||||||
|
TITLE:=Advertise an IPv6 prefix from the node
|
||||||
|
DEPENDS:=+gluon-core +uradvd
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/gluon-radvd-batman/description
|
||||||
|
Gluon community wifi mesh firmware framework: Advertise an IPv6 prefix from the node
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Prepare
|
||||||
|
mkdir -p $(PKG_BUILD_DIR)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Configure
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Compile
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/gluon-radvd-batman/install
|
||||||
|
$(CP) ./files/* $(1)/
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,gluon-radvd-batman))
|
5
package/gluon-radvd-batman/files/lib/gluon/upgrade/500-radvd-remove-user
Executable file
5
package/gluon-radvd-batman/files/lib/gluon/upgrade/500-radvd-remove-user
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/lua
|
||||||
|
|
||||||
|
local users = require 'gluon.users'
|
||||||
|
|
||||||
|
users.remove_user('gluon-radvd')
|
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. /lib/gluon/autoupdater/lib.sh
|
||||||
|
|
||||||
|
|
||||||
|
start_enabled gluon-radvd
|
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. /lib/gluon/autoupdater/lib.sh
|
||||||
|
|
||||||
|
|
||||||
|
stop gluon-radvd
|
Loading…
Reference in New Issue
Block a user