--- vblade-16.orig/vbladed +++ vblade-16/vbladed @@ -3,4 +3,14 @@ # output is directed to syslogd # +# Although logging goes to syslog, let's going to +# protect ourselves against the most common way or +# calling vbladed: without arguments. While at it, we guard +# ourselves against wrong number of parameters. +if [ $# -lt 4 ] +then + echo "usage: ./vblade " >&2 + exit 1 +fi + sh -c "`dirname $0`/vblade $* < /dev/null 2>&1 | logger -t vbladed" & --- vblade-16.orig/makefile +++ vblade-16/makefile @@ -33,8 +33,11 @@ clean : rm -f $O vblade + rm -f config.h install : vblade vbladed + install -d ${sbindir}/ install vblade ${sbindir}/ install vbladed ${sbindir}/ + install -d ${mandir}/man8/ install vblade.8 ${mandir}/man8/ --- vblade-16.orig/vblade.8 +++ vblade-16/vblade.8 @@ -35,7 +35,7 @@ .SS Options .TP \fB-m\fP -The -m flag takes an argument, a comma separated list of MAC addresses +The \-m flag takes an argument, a comma separated list of MAC addresses permitted access to the vblade. A MAC address can be specified in upper or lower case, with or without colons. .SH EXAMPLE --- vblade-16.orig/debian/vblade.links +++ vblade-16/debian/vblade.links @@ -0,0 +1 @@ +/usr/share/man/man8/vblade.8 /usr/share/man/man8/vbladed.8 --- vblade-16.orig/debian/vblade.manpages +++ vblade-16/debian/vblade.manpages @@ -0,0 +1 @@ +vblade.8 --- vblade-16.orig/debian/vblade.docs +++ vblade-16/debian/vblade.docs @@ -0,0 +1 @@ +README --- vblade-16.orig/debian/vblade.conf +++ vblade-16/debian/vblade.conf @@ -0,0 +1,3 @@ +# example configuration file +# network_device shelf slot file/disk/partition mac[,mac[,mac]] +#eth0 0 0 /dev/sdb 00:11:22:33:44:55 --- vblade-16.orig/debian/vblade.dirs +++ vblade-16/debian/vblade.dirs @@ -0,0 +1,2 @@ +usr/sbin +etc --- vblade-16.orig/debian/changelog +++ vblade-16/debian/changelog @@ -0,0 +1,94 @@ +vblade (16-1ubuntu1) intrepid; urgency=low + + * Merge from debian unstable, remaining changes: + - Update maintainer no longer in universe. + - Added init script. + - Added example configuration file. + + -- Chuck Short Mon, 16 Jun 2008 09:00:58 -0500 + +vblade (16-1) unstable; urgency=low + + * New upstream release (closes: #484176). Main changes are: + - Size checks are now more robust (closes: #423408). + - Added AIO (async I/O) and BSF (Berkeley Socket Filter) contrib patches + (not applied). + * vbladed: check for 4 or more arguments rather than exactly 4, so that -m + switches are now accepted. Thank you very much, Pierre! (closes: + #436481). + * debian/rules: Added patch by Aurelien Jarno to support FreeBSD platforms + (closes: #461930). + * debian/control: + - Added Recommends: vblade-persist, a nice tool by Daniel Kahn Gillmor + that support persistent vblades across reboots and also exports vblades + to localhost as a bonus! Closes: #336772, #402026, #451883. + - Bumped Standards-Version to 3.8.0 (but I'll use 3.7.3 if I want lintian + silent!). + - Added Homepage field. + * debian/copyright: + - Added some copyright text to make it GPLv2 explicit. + - Added copyright years to shut up lintian. + + -- David Martínez Moreno Mon, 09 Jun 2008 04:21:38 +0200 + +vblade (14-1ubuntu1) hardy; urgency=low + + * Added init script. + * Added example configuration file. + + -- Chuck Short Fri, 08 Feb 2008 11:08:54 -0500 + +vblade (14-1) unstable; urgency=low + + * New upstream release. Main changes are: + - -m allows a comma-separated list of MAC addresses with permitted access + to the vblade. + - Jumbo frames are now supported. Please read README for details. + - Bugfixes. + * Fixed a hyphen in vblade.8. + + -- David Martínez Moreno Sun, 8 Apr 2007 06:06:19 +0200 + +vblade (11-2) unstable; urgency=low + + * The upstream vblade.8 file contains more information than the + vblade.8 and vbladed.8 files in the debian/ directory, so I removed them + and linked vbladed.8 with it (closes: #410832). Thanks, Uwe Hermann. + * Added removal of config.h to makefile 'clean' target. + * Rewrote several files under debian/. + * Added to local patch prevention for running vbladed with wrong number of + parameters. + + -- David Martínez Moreno Sun, 8 Apr 2007 05:51:04 +0200 + +vblade (11-1) unstable; urgency=low + + * New upstream release: + - Add install target for makefile and update documentation. + * debian/control: Bumped policy version to 3.7.2.1 and replaced AOE with + AoE in Description. + * Added a TODO.Debian. + + -- David Martínez Moreno Tue, 3 Oct 2006 04:23:57 +0200 + +vblade (10-1) unstable; urgency=low + + * New upstream release (closes: #369151). + * debian/control: + - Bump Standards-Version to 3.7.2.0. + - Bump dependency on debhelper to >= 5. + * debian/compat: Bump compatibility to 5. + + -- David Martínez Moreno Tue, 30 May 2006 03:38:03 +0200 + +vblade (6-1) unstable; urgency=low + + * First upload to the Debian archive. + * Imported lots of bits from the Ubuntu packaging. + * debian/control: Bumped Standards-Version to 3.6.2. + * debian/rules: Add NEWS as the upstream changelog. + * Added vbladed script to the package, and modified it a bit. + * Added a manpage for vbladed. + + -- David Martínez Moreno Fri, 28 Oct 2005 01:23:59 +0200 + --- vblade-16.orig/debian/TODO +++ vblade-16/debian/TODO @@ -0,0 +1,2 @@ +- Make some init script for launching several vbladed's during boot and + in this way automate the vblade maintainance. --- vblade-16.orig/debian/control +++ vblade-16/debian/control @@ -0,0 +1,18 @@ +Source: vblade +Section: admin +Priority: optional +Maintainer: Ubuntu Core Developers +XSBC-Original-Maintainer: David Martínez Moreno +Homepage: http://aoetools.sf.net +Standards-Version: 3.7.3 +Build-Depends: debhelper (>= 5) + +Package: vblade +Architecture: any +Section: admin +Priority: optional +Depends: ${shlibs:Depends} +Recommends: vblade-persist +Description: virtual AoE blade emulator + The vblade tool will allow an admin to export a local disk using the AoE + protocol, without the need of a real AoE-capable device. --- vblade-16.orig/debian/vblade.install +++ vblade-16/debian/vblade.install @@ -0,0 +1,2 @@ +vblade /usr/sbin +vbladed /usr/sbin --- vblade-16.orig/debian/rules +++ vblade-16/debian/rules @@ -0,0 +1,58 @@ +#!/usr/bin/make -f +# Copyright 2005, 2006, 2007 David Martínez Moreno. +# Under GPL v2. + +# Uncomment this to turn on verbose mode. +# export DH_VERBOSE=1 + +DEB_BUILD_ARCH_OS ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS) + +ifeq ($(DEB_HOST_ARCH_OS),kfreebsd) + PLATFORM=freebsd +else + PLATFORM=linux +endif + +build: build-stamp +build-stamp: + $(MAKE) PLATFORM=$(PLATFORM) + touch build-stamp + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + install -m 644 $(CURDIR)/debian/vblade.conf $(CURDIR)/debian/vblade/etc + + dh_install + dh_installdocs + dh_installinit --name vblade -- defaults 20 21 + dh_installman + dh_installchangelogs NEWS + dh_link + +binary-arch: build install + dh_testdir + dh_testroot + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary-indep: + # do nothing + +binary: binary-arch binary-indep + +clean: + dh_testdir + dh_testroot + $(MAKE) clean + rm -f *-stamp + dh_clean --- vblade-16.orig/debian/compat +++ vblade-16/debian/compat @@ -0,0 +1 @@ +5 --- vblade-16.orig/debian/copyright +++ vblade-16/debian/copyright @@ -0,0 +1,23 @@ +This package was debianized by David Martínez Moreno . + +It was downloaded from: http://sourceforge.net/projects/aoetools/ + +Copyright: 2005-2008 Ed L. Cashin + +License: +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; version 2 dated June, 1991. + +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 St, Fifth Floor, Boston, MA +02110-1301, USA. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License v2 can be found in `/usr/share/common-licenses/GPL-2'. --- vblade-16.orig/debian/vblade.init +++ vblade-16/debian/vblade.init @@ -0,0 +1,83 @@ +#!/bin/bash + +### BEGIN INIT INFO +# Provides: vblade +# Required-Start: $network $local_fs $remote_fs +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: virtual AoE blade emulator +### END INIT INFO + +set -e + +# /etc/init.d/vblade start and stop the vblade daemon + +test -x /usr/sbin/vblade || exit 0 + +. /lib/lsb/init-functions + +RETVAL=0 +prog=vblade + +start_vblade() { + ALLOWMACS="" + [ -n "$5" ] && ALLOWMACS="-m $5" + ID="$1-e$2.$3" + PID_FILE=/var/run/$prog/${ID}.pid + $prog $ALLOWMACS $2 $3 $1 $4 >> /var/log/$prog.log 2>&1 & + pid=$i + echo $pid > $PID_FILE + echo -n $"$4 (e$2.$3@$1) [pid $pid]" + [ "$RETVAL" = 0 ] && log_end_msg 0 || log_end_msg 1 + echo +} + +start() { + log_daemon_msg "Starting vblade deaemons" "vblade" + if [ `grep -vc '^#\|^$' /etc/$prog.conf` ] + then + grep -v '^#' /etc/$prog.conf | sed -e 's/ / /g' -e 's/ / /g' | while read line + do + start_vblade $line + done + else + echo -n "empty $prog.conf?" + echo + fi +} + +stop() { + log_daemon_msg "Stopping vblade daemons" "vblade" + log_progress_msg "vblade" + for pidfile in `ls /var/run/$prog/*.pid` + do + kill -9 `cat $pidfile` + rm -f $pidfile + done + echo +} + + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|force-reload) + stop + start + ;; + reload) + stop + start + ;; + *) + echo $"Usage: $0 {start|stop|restart|reload|restart|force-reload}" + RETVAL=1 +esac + +exit 0 +