From 4988cbc735131ea90af79019190cd1f9b5ee2db2 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Fri, 28 Feb 2014 18:09:15 +0100 Subject: [PATCH 1/4] hnetd: add hnetd package --- hnetd/Makefile | 80 ++++++++++++++++++++++++++++++++++++++ hnetd/files/hnetd.defaults | 6 +++ hnetd/files/hnetd.init | 42 ++++++++++++++++++++ hnetd/files/ohp-script | 48 +++++++++++++++++++++++ 4 files changed, 176 insertions(+) create mode 100644 hnetd/Makefile create mode 100644 hnetd/files/hnetd.defaults create mode 100644 hnetd/files/hnetd.init create mode 100644 hnetd/files/ohp-script diff --git a/hnetd/Makefile b/hnetd/Makefile new file mode 100644 index 0000000..0e89a25 --- /dev/null +++ b/hnetd/Makefile @@ -0,0 +1,80 @@ +# +# Copyright (C) 2012-2013 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. + +include $(TOPDIR)/rules.mk + +PKG_NAME:=hnetd +PKG_SOURCE_VERSION:=f733b81679ac3d0fb8157a9056afe55854a1c956 +PKG_VERSION:=2014-02-28-$(PKG_SOURCE_VERSION) +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://github.com/sbyx/hnetd.git +PKG_MAINTAINER:=Steven Barth + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +# Spammy debug builds for now +CMAKE_OPTIONS += -DL_LEVEL=7 + +# OpenWRT target +CMAKE_OPTIONS += -DBACKEND=openwrt + +define Package/hnetd + SECTION:=net + CATEGORY:=Network + TITLE:=HNCP Homenet daemon + URL:=https://github.com/sbyx/hnetd + DEPENDS:=+odhcpd +odhcp6c +netifd + DEPENDS+=+@IPV6 +endef + +define Package/hnet-full + SECTION:=net + CATEGORY:=Network + TITLE:=HNCP Homenet metapackage (hnetd + ohybridproxy + babels) + URL:=https://github.com/sbyx/hnetd + DEPENDS:=+odhcpd +odhcp6c +netifd +hnetd +ohybridproxy +babels + DEPENDS+=+@IPV6 +endef + +define Package/hnetd/description +This package provides a daemon which implementats distributed prefix assignment +and service discovery for a home network consisting of multiple routers +connected to multiple service providers. It provides a netifd protocol "hnet" +for use in /etc/config/network. +endef + +define Package/hnetd/install + $(INSTALL_DIR) $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/hnetd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/lib/netifd/proto + $(INSTALL_BIN) $(PKG_BUILD_DIR)/openwrt/hnet.sh $(1)/lib/netifd/proto + ln -s hnetd $(1)/usr/sbin/hnet-call + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/hnetd.init $(1)/etc/init.d/hnetd + $(INSTALL_BIN) ./files/ohp-script $(1)/usr/sbin/hnetd-ohp-script + $(INSTALL_BIN) $(PKG_BUILD_DIR)/generic/hnetd-routing $(1)/usr/sbin/hnetd-routing + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_BIN) ./files/hnetd.defaults $(1)/etc/uci-defaults/x-hnetd.defaults +endef + +define Package/hnet-full/install + true +endef + +define Package/hnetd/postinst +#!/bin/sh +[ -n "$${IPKG_INSTROOT}" ] || (. /etc/uci-defaults/x-hnetd.defaults) && rm -f /etc/uci-defaults/x-hnetd.defaults +exit 0 +endef + +$(eval $(call BuildPackage,hnetd)) +$(eval $(call BuildPackage,hnet-full)) diff --git a/hnetd/files/hnetd.defaults b/hnetd/files/hnetd.defaults new file mode 100644 index 0000000..85c8cb2 --- /dev/null +++ b/hnetd/files/hnetd.defaults @@ -0,0 +1,6 @@ +#!/bin/sh + +uci batch < +# +# Copyright (c) 2014 cisco Systems, Inc. +# +# Created: Fri Jan 17 11:46:30 2014 mstenber +# Last modified: Mon Feb 3 14:39:15 2014 mstenber +# Edit time: 15 min +# + +# This is minimalist init.d-like start/stop script for +# ohybridproxy. However, as ohybridproxy receives it's configuration +# via command line, the 'start' command is also equivalent to +# 'restart', and has bunch of extra arguments.. + +OHP=ohybridproxy + +start() { + $OHP $* & +} + +stop() { + killall -9 $OHP +} + + +CMD=$1 +# For debugging purposes +LOGNAME=`basename $0` +echo "$*" | logger -t "$LOGNAME" +case $CMD in + start) + shift + stop + start $* + ;; + stop) + stop + ;; + *) + echo "Only start [config]/stop supported" + exit 1 + ;; +esac From 41ed16b7ad3bd3411b4cbc955447833c3763df83 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Fri, 28 Feb 2014 18:12:15 +0100 Subject: [PATCH 2/4] hnetd: remove some debug flags --- hnetd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hnetd/Makefile b/hnetd/Makefile index 0e89a25..500cbb3 100644 --- a/hnetd/Makefile +++ b/hnetd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hnetd -PKG_SOURCE_VERSION:=f733b81679ac3d0fb8157a9056afe55854a1c956 +PKG_SOURCE_VERSION:=1031619a9319baeee68ddd2bcb76c8d74089ba27 PKG_VERSION:=2014-02-28-$(PKG_SOURCE_VERSION) PKG_RELEASE:=1 From b0d5ed7368fbf06a44aea78ff1fed07ca1afb366 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Sat, 1 Mar 2014 16:04:34 +0100 Subject: [PATCH 3/4] hnetd: improve postinst logic --- hnetd/Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hnetd/Makefile b/hnetd/Makefile index 500cbb3..5120d6f 100644 --- a/hnetd/Makefile +++ b/hnetd/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hnetd PKG_SOURCE_VERSION:=1031619a9319baeee68ddd2bcb76c8d74089ba27 -PKG_VERSION:=2014-02-28-$(PKG_SOURCE_VERSION) +PKG_VERSION:=2014-03-01-$(PKG_SOURCE_VERSION) PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git @@ -72,7 +72,12 @@ endef define Package/hnetd/postinst #!/bin/sh -[ -n "$${IPKG_INSTROOT}" ] || (. /etc/uci-defaults/x-hnetd.defaults) && rm -f /etc/uci-defaults/x-hnetd.defaults +[ -n "$${IPKG_INSTROOT}" ] || { + (. /etc/uci-defaults/x-hnetd.defaults) && rm -f /etc/uci-defaults/x-hnetd.defaults + [ -x /etc/init.d/dnsmasq ] && /etc/init.d/dnsmasq restart + /etc/init.d/hnetd enable + /etc/init.d/hnetd start +} exit 0 endef From 7919e15eabb9b0e0b1b79397d7e01d21af97fc18 Mon Sep 17 00:00:00 2001 From: Axel Neumann Date: Sat, 1 Mar 2014 21:32:42 +0100 Subject: [PATCH 4/4] [bmx6] update --- bmx6/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bmx6/Makefile b/bmx6/Makefile index e75bac3..afb7216 100644 --- a/bmx6/Makefile +++ b/bmx6/Makefile @@ -31,8 +31,8 @@ PKG_SOURCE_PROTO:=git #PKG_SOURCE_URL:=git://bmx6.net/bmx6.git PKG_SOURCE_URL:=git://github.com/axn/bmx6.git -PKG_REV:=66338bf2be0b081ef4a6ed4d75e4d8b8f13a4d9c -PKG_VERSION:=r2014022501 +PKG_REV:=4d3819b255540915408b827ae03fd92cbd7b4bdd +PKG_VERSION:=r2014030101 PKG_RELEASE:=4 PKG_SOURCE_VERSION:=$(PKG_REV)