From 0840efd64c45cb4aa7adedb08ff2a4e9ed80329d Mon Sep 17 00:00:00 2001 From: Bruno Randolf Date: Tue, 3 Oct 2017 14:55:18 +0100 Subject: [PATCH] horst: Update to version 5.1 and add init script Update to latest stable version and add init script and config file to start horst in server mode as a service. Signed-off-by: Bruno Randolf --- net/horst/Makefile | 16 +++++++++--- net/horst/horst.config | 4 +++ net/horst/horst.init | 22 ++++++++++++++++ ...-Remove-_GNU_SOURCE-from-ccan-config.patch | 26 ------------------- 4 files changed, 38 insertions(+), 30 deletions(-) create mode 100644 net/horst/horst.config create mode 100755 net/horst/horst.init delete mode 100644 net/horst/patches/0001-Remove-_GNU_SOURCE-from-ccan-config.patch diff --git a/net/horst/Makefile b/net/horst/Makefile index 381878c384..63e2f55ec6 100644 --- a/net/horst/Makefile +++ b/net/horst/Makefile @@ -8,15 +8,15 @@ include $(TOPDIR)/rules.mk PKG_NAME:=horst -PKG_VERSION:=5.0 +PKG_VERSION:=5.1 PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-git.tar.gz -PKG_MIRROR_HASH:=3a677e504e8a1f27c899dfbf39da8c94412b24b08bb2eab0de7807cef07d078b +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_URL:=git://github.com/br101/horst.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=version-$(PKG_VERSION) +PKG_SOURCE_VERSION:=v$(PKG_VERSION) +PKG_MIRROR_HASH:=22f4be94e839c58ac85ebdc2359b813fd5f68dfd71e1b0c9ed9545020d1abc7d PKG_MAINTAINER:=Bruno Randolf PKG_LICENSE:=GPL-2.0+ @@ -43,10 +43,18 @@ define Package/horst/description and especially IBSS (ad-hoc) mode and mesh networks (OLSR). endef +define Package/horst/conffiles +/etc/config/horst +endef + define Package/horst/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/horst $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/horst.sh $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./horst.init $(1)/etc/init.d/horst + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./horst.config $(1)/etc/config/horst endef $(eval $(call BuildPackage,horst)) diff --git a/net/horst/horst.config b/net/horst/horst.config new file mode 100644 index 0000000000..17c0097725 --- /dev/null +++ b/net/horst/horst.config @@ -0,0 +1,4 @@ +config init 'init' + option disabled 1 + option interface 'mon0' + option scan 1 diff --git a/net/horst/horst.init b/net/horst/horst.init new file mode 100755 index 0000000000..bba67a2f21 --- /dev/null +++ b/net/horst/horst.init @@ -0,0 +1,22 @@ +#!/bin/sh /etc/rc.common + +START=94 + +USE_PROCD=1 +PROG=/usr/sbin/horst + +start_service() { + config_load horst + config_get dis "init" 'disabled' '0' + [ "$dis" == "0" ] || exit + + config_get intf "init" 'interface' 'wlan0' + config_get scan "init" 'scan' '0' + [ "$scan" == "0" ] && scan='' || scan="-s" + + procd_open_instance + procd_set_param command $PROG -q -i $intf $scan -N + procd_set_param netdev $intf + procd_set_param respawn + procd_close_instance +} diff --git a/net/horst/patches/0001-Remove-_GNU_SOURCE-from-ccan-config.patch b/net/horst/patches/0001-Remove-_GNU_SOURCE-from-ccan-config.patch deleted file mode 100644 index eeab738bc0..0000000000 --- a/net/horst/patches/0001-Remove-_GNU_SOURCE-from-ccan-config.patch +++ /dev/null @@ -1,26 +0,0 @@ -From c91e2f6d72823938052044eef858c3c675617ae4 Mon Sep 17 00:00:00 2001 -From: Bruno Randolf -Date: Wed, 15 Mar 2017 21:22:48 +0000 -Subject: [PATCH] Remove _GNU_SOURCE from ccan config - -It creates problems with LEDEs FORTIFY and is not needed ---- - config.h | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/config.h b/config.h -index 5c398c4..7e1027a 100644 ---- a/config.h -+++ b/config.h -@@ -1,8 +1,5 @@ - /* Generated by CCAN configurator */ - #ifndef CCAN_CONFIG_H - #define CCAN_CONFIG_H --#ifndef _GNU_SOURCE --#define _GNU_SOURCE /* Always use GNU extensions. */ --#endif - #define HAVE_TYPEOF 1 - #endif /* CCAN_CONFIG_H */ --- -2.7.4 -