Developing lightweight computation at the DSG edge

Commit 19ea4884 authored by p4u's avatar p4u
Browse files

Added packages bmx and gsf-compat

parent d5dd6782
#
# Copyright (C) 2008 Freifunk Leipzig
# Copyright (C) 2009 Agusti Moll, Simó Albert
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# $Id$
include $(TOPDIR)/rules.mk
PKG_NAME:=bmx
PKG_SOURCE_URL:=git://github.com/axn/bmxd.git
PKG_REV:=9c1d12b554dccd2efde249f5e44a7d4de59ce1a8
PKG_VERSION:=r20100415
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
include $(INCLUDE_DIR)/package.mk
define Package/bmx
$(call Package/bmx/Default)
SECTION:=net
CATEGORY:=qMp
DEPENDS:=+kmod-tun +libuci +libpthread
TITLE:=B.A.T.M.A.N. Experimental (BMX) layer 3 routing daemon
URL:=http://www.open-mesh.net/
endef
define Package/bmx/description
B.A.T.M.A.N. Experimental (BMX) layer 3 routing daemon
endef
MAKE_ARGS += \
EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
CCFLAGS="$(TARGET_CFLAGS)" \
OFLAGS="$(TARGET_CFLAGS)" \
REVISION="$(PKG_REV)" \
CC="$(TARGET_CC)" \
NODEBUG=1 \
UNAME="Linux" \
INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
STRIP="/bin/true" \
bmxd install_all
define Build/Configure
$(call Build/Configure/Default, \
CFLAGS=$(STAGING_DIR)/usr/include \
LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
)
mkdir -p $(PKG_INSTALL_DIR)/usr/sbin
mkdir -p $(PKG_INSTALL_DIR)/usr/lib
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS)
endef
define Package/bmx/install
$(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/lib $(1)/etc/config $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/bmxd $(1)/usr/sbin/bmxd
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/*.so $(1)/usr/lib/
$(INSTALL_BIN) ./files/etc/init.d/bmxd $(1)/etc/init.d
$(INSTALL_DATA) ./files/etc/config/bmx $(1)/etc/config/bmx
endef
$(eval $(call BuildPackage,bmx))
config 'bmxd' 'general'
option 'base_port' '16305'
option 'prio_rules_offset' '400'
option 'rt_table_offset' '40'
option 'ogm_interval' '500'
option 'routing_class' '3'
option 'one_way_tunnel' '4'
option 'gateway_tunnel_network' '169.254.128.0/22'
option 'http_info_port' '8099'
option 'http_info_global_access' '1'
option 'gsf_map_name' 'graciasensefils.net'
option 'gsf_map_longitude' '2.15584'
option 'gsf_map_latitude' '41.40411'
option 'gsf_map_hw' 'unknown'
option 'gsf_map_email' 'info@graciasensefils.net'
config 'plugin' 'plugin_0'
option 'plugin' 'bmx_http_info.so'
config 'plugin' 'plugin_1'
option 'plugin' 'bmx_gsf_map.so'
config 'throw_rule' 'throw_rule_0'
option 'throw_rule' '172.16.0.0/14'
config 'throw_rule' 'throw_rule_1'
option 'throw_rule' '172.24.0.0/14'
#!/bin/sh /etc/rc.common
# GSF BMXD init script
#
# Copyright (C) 2006 OpenWrt.org
# Copyright (C) 2008 graciasensefils.net - Agustí Moll, Axel Neumann, Simó Albert
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Version 0.2.2.2009.6.7.1702
START=90
STOP=90
BMXD_COMMAND="bmxd -d3"
#. /lib/config/uci.sh
#uci_load bmxd
start() {
bmx_args=""
if [ -f /etc/config/bmxd ] ; then
interface=$(uci get bmxd.general.interface)
if [ "$interface" = "" ]; then
echo $1 Error, you must specify at least a network interface
exit
fi
misc=$(uci get bmxd.general.misc)
announce=$(uci get bmxd.general.announce)
gateway_class=$(uci get bmxd.general.gateway_class)
originator_interval=$(uci get bmxd.general.originator_interval)
preferred_gateway=$(uci get bmxd.general.preferred_gateway)
routing_class=$(uci get bmxd.general.routing_class)
visualisation_srv=$(uci get bmxd.general.visualisation_srv)
if [ "$announce" != "" ]; then
for anunci in $announce; do
bmx_args=${bmx_args}'-a '$anunci' '
done
fi
if [ $gateway_class ]; then
bmx_args=${bmx_args}'-g '$gateway_class' '
fi
if [ $originator_interval ]; then
bmx_args=${bmx_args}'-o '$originator_interval' '
fi
if [ $preferred_gateway ]; then
bmx_args=${bmx_args}'-p '$preferred_gateway' '
fi
if [ $routing_class ]; then
bmx_args=${bmx_args}'-r '$routing_class' '
fi
if [ $visualisation_srv ]; then
bmx_args=${bmx_args}'-s '$visualisation_srv' '
fi
bmx_args=${misc}' '${bmx_args}$interface
fi
echo "$BMXD_COMMAND $bmx_args"
cd /tmp/
ulimit -c 20000
$BMXD_COMMAND $bmx_args >/dev/null 2>&1 &
}
stop() {
killall bmxd
echo -n "Please wait. "
while ps aux | grep -q "$BMXD_COMMAND $" ; do
echo -n .
sleep 1
done
echo " Thanks."
}
--- bmx-r1636/lib/bmx_uci_config/Makefile.orig 2010-04-26 17:49:31.000000000 +0200
+++ bmx-r1636/lib/bmx_uci_config/Makefile 2010-04-26 17:51:23.000000000 +0200
@@ -1,6 +1,14 @@
-CFLAGS += -fpic -pedantic -Wall -W -Wno-unused-parameter -Os -g3 -std=gnu99 -I../../
-LDFLAGS += -shared -luci
+#<agusti> change uci directory, now use variable </agusti>
+UCIPATH = $(shell find ../../../ -maxdepth 1 -type d -name 'uci-*')
+#<sim6> comment next line to add -I../../../uci-0.7.3/ for locate uci.h
+#CFLAGS += -fpic -pedantic -Wall -W -Wno-unused-parameter -O1 -g3 -std=gnu99 -I../../
+CFLAGS += -fpic -pedantic -Wall -W -Wno-unused-parameter -O1 -g3 -std=gnu99 -I../../ -I$(UCIPATH)
+# </sim6>
+# <sim6> comment next line to add -L../../../uci-0.7.3/ for locate libuci.so
+#LDFLAGS += -shared -luci
+LDFLAGS += -shared -luci -L$(UCIPATH)
+# </sim6>
#-Wl,-soname,bmx_config
PLUGIN_NAME = bmx_uci_config
@@ -13,7 +20,10 @@
PLUGIN_FULLNAME = $(PLUGIN_NAME).so.$(PLUGIN_VER)
PLUGIN_SHORTNAME = $(PLUGIN_NAME).so
-LIBDIR = /usr/lib
+# <sim6> comment next line to add $(INSTALL_PREFIX) for install in kamikaze root directory
+#LIBDIR = /usr/lib
+LIBDIR = $(INSTALL_PREFIX)/usr/lib
+# </sim6>
all: $(PLUGIN_FULLNAME) Makefile
--- bmx-r1636/lib/bmx_gsf_map/Makefile.orig
+++ bmx-r1636/lib/bmx_gsf_map/Makefile
@@ -13,7 +13,10 @@
PLUGIN_FULLNAME = $(PLUGIN_NAME).so.$(PLUGIN_VER)
PLUGIN_SHORTNAME = $(PLUGIN_NAME).so
-LIBDIR = /usr/lib
+# <sim6> comment next line to add $(INSTALL_PREFIX) for install in kamikaze root directory
+#LIBDIR = /usr/lib
+LIBDIR = $(INSTALL_PREFIX)/usr/lib
+# </sim6>
all: $(PLUGIN_FULLNAME) Makefile
--- bmx-r1636/lib/bmx_howto_plugin/Makefile.orig
+++ bmx-r1636/lib/bmx_howto_plugin/Makefile 2009-08-05 17:00:31.000000000 +0200
@@ -13,7 +13,10 @@
PLUGIN_FULLNAME = $(PLUGIN_NAME).so.$(PLUGIN_VER)
PLUGIN_SHORTNAME = $(PLUGIN_NAME).so
-LIBDIR = /usr/lib
+# <sim6> comment next line to add $(INSTALL_PREFIX) for install in kamikaze root directory
+#LIBDIR = /usr/lib
+LIBDIR = $(INSTALL_PREFIX)/usr/lib
+# </sim6>
all: $(PLUGIN_FULLNAME) Makefile
--- bmx-r1636/lib/bmx_http_info/Makefile.orig 2009-09-30 01:23:41.000000000 +0200
+++ bmx-r1636/lib/bmx_http_info/Makefile 2009-09-30 12:24:53.000000000 +0200
@@ -13,7 +13,10 @@
PLUGIN_FULLNAME = $(PLUGIN_NAME).so.$(PLUGIN_VER)
PLUGIN_SHORTNAME = $(PLUGIN_NAME).so
-LIBDIR = /usr/lib
+# <sim6> comment next line to add $(INSTALL_PREFIX) for install in kamikaze root directory
+#LIBDIR = /usr/lib
+LIBDIR = $(INSTALL_PREFIX)/usr/lib
+# </sim6>
all: $(PLUGIN_FULLNAME) Makefile
# Copyright (C) 2011 Fundacio Privada per a la Xarxa Oberta, Lliure i Neutral guifi.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
#
# Contributors:
# Simó Albert i Beltran
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=gsf-compat
PKG_RELEASE:=1
#PKG_SOURCE_URL:=@SF/qmp-small-node
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/gsf-compat
SECTION:=net
CATEGORY:=qMp
TITLE:= Compatiblity with GSF firmware for qMp
URL:=http://graciasensefils.net
DEPENDS:= \
+bmx
endef
define Package/gsf-compat/description
Addons for small qmp nodes (4MByte flash)
endef
define Package/gsf-compat/conffiles
/etc/config/gsf-compat
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/gsf-compat/install
$(CP) ./files/* $(1)/
chmod 755 $(1)/etc/init.d/gsf-compat
endef
$(eval $(call BuildPackage,gsf-compat))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment