[package] add vblade
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 31 Jul 2010 11:39:08 +0000 (11:39 +0000)
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 31 Jul 2010 11:39:08 +0000 (11:39 +0000)
This is a package for the vblade tool, which exports disks over the
aoe protocol. We already have the aoetools for connecting to them.

Signed-off-by: Kyle Anderson <kyle@xkyle.com>
git-svn-id: svn://svn.openwrt.org/openwrt/packages@22429 3c298f89-4303-0410-b956-a3cf2f4a3e73

net/vblade/Makefile [new file with mode: 0644]
net/vblade/files/vblade.config [new file with mode: 0644]
net/vblade/files/vblade.init [new file with mode: 0644]

diff --git a/net/vblade/Makefile b/net/vblade/Makefile
new file mode 100644 (file)
index 0000000..9a8afc0
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2010 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:=vblade
+PKG_VERSION:=20
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=@SF/aoetools/vblade
+PKG_MD5SUM:=3c80e4a6bc7d66ae0c235b88cb44bd59
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/vblade
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Vblade AoE Target
+  URL:=http://aoetools.sourceforge.net/
+endef
+
+define Package/$(PKG_NAME)/conffiles
+/etc/config/vblade
+endef
+
+
+define Package/vblade/description
+       The vblade is the virtual EtherDrive (R) blade, a program that makes a
+       seekable file available over an ethernet local area network (LAN) via
+       the ATA over Ethernet (AoE) protocol.
+endef
+
+CONFIGURE_ARGS +=  NPERSHELF=16
+
+define Package/$(PKG_NAME)/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/vblade $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/vbladed $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc/init.d/
+       $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME)
+endef
+
+$(eval $(call BuildPackage,$(PKG_NAME)))
diff --git a/net/vblade/files/vblade.config b/net/vblade/files/vblade.config
new file mode 100644 (file)
index 0000000..1f35c07
--- /dev/null
@@ -0,0 +1,12 @@
+#config vblade
+#      option shelf            '1'
+#      option slot             '1'
+#      option netif            'eth0'
+#      option device           '/dev/sda'
+#
+#config vblade
+#      option shelf            '1'
+#      option slot             '2'
+#      option netif            'eth0'
+#      option device           '/dev/sdb'
+#
diff --git a/net/vblade/files/vblade.init b/net/vblade/files/vblade.init
new file mode 100644 (file)
index 0000000..bf59d58
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh /etc/rc.common
+# Startup init script for vblade for Openwrt
+START=95
+STOP=10
+
+start_service() {
+       local section="$1"
+       config_get shelf "$section" shelf
+       config_get slot "$section" slot
+       config_get netif "$section" netif
+       config_get device "$section" device
+       vbladed $shelf $slot $netif $device
+}
+
+start() {
+       config_load vblade
+       config_foreach start_service vblade
+}
+
+stop() {
+       /usr/bin/pkill -f /usr/sbin/vblade
+}
+