[arch-commits] Commit in (12 files)

Tobias Powalowski tpowa at archlinux.org
Tue Jan 5 18:39:02 UTC 2010


    Date: Tuesday, January 5, 2010 @ 13:39:02
  Author: tpowa
Revision: 62245

new depend for qemu/qemu-kvm

Added:
  vde2/
  vde2/repos/
  vde2/trunk/
  vde2/trunk/PKGBUILD
  vde2/trunk/dhcpd.conf.sample
  vde2/trunk/iptables.rules.sample
  vde2/trunk/vde-config.sample
  vde2/trunk/vde-connection.sample
  vde2/trunk/vde-path_max.patch
  vde2/trunk/vde.conf
  vde2/trunk/vde.rc
  vde2/trunk/vde2.install

-----------------------+
 PKGBUILD              |   47 ++++++++++++++++++++
 dhcpd.conf.sample     |   12 +++++
 iptables.rules.sample |    5 ++
 vde-config.sample     |   35 +++++++++++++++
 vde-connection.sample |    6 ++
 vde-path_max.patch    |   77 +++++++++++++++++++++++++++++++++
 vde.conf              |   11 ++++
 vde.rc                |  112 ++++++++++++++++++++++++++++++++++++++++++++++++
 vde2.install          |   14 ++++++
 9 files changed, 319 insertions(+)

Added: vde2/trunk/PKGBUILD
===================================================================
--- vde2/trunk/PKGBUILD	                        (rev 0)
+++ vde2/trunk/PKGBUILD	2010-01-05 18:39:02 UTC (rev 62245)
@@ -0,0 +1,47 @@
+# $Id$
+# Contributor: Sergej Pupykin
+# Maintainer: Tobias Powalowski <tpowa at archlinux.org>
+pkgname=vde2
+pkgver=2.2.2
+pkgrel=4
+pkgdesc="Virtual Distributed Ethernet for emulators like qemu"
+url="http://sourceforge.net/projects/vde/"
+license=("GPL" "LGPL" "CUSTOM")
+arch=('i686' 'x86_64')
+depends=('bash' 'libpcap' 'openssl')
+backup=(etc/conf.d/vde)
+source=(http://downloads.sourceforge.net/vde/$pkgname-$pkgver.tar.bz2
+        vde-path_max.patch
+        dhcpd.conf.sample
+        iptables.rules.sample
+        vde-config.sample
+        vde-connection.sample
+        vde.conf
+        vde.rc)
+install=vde2.install
+options=(!libtool)
+
+build() {
+  cd $srcdir/$pkgname-$pkgver
+  patch -Np1 -i ../vde-path_max.patch || return 1
+  ./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib/vde2 \
+             --enable-experimental --enable-profile
+  make || return 1
+  make prefix=$pkgdir/usr sysconfdir=$pkgdir/etc libexecdir=$pkgdir/usr/lib/vde2 install || return 1
+  install -D -m 755 ../vde.rc $pkgdir/etc/rc.d/vde || return 1
+  install -D -m 644 ../vde.conf $pkgdir/etc/conf.d/vde || return 1
+  install -D -m 644 ../vde-config.sample $pkgdir/etc/vde/vde-config.sample || return 1
+  install -D -m 644 ../vde-connection.sample $pkgdir/etc/vde/vde-connection.sample || return 1
+  install -D -m 644 ../dhcpd.conf.sample $pkgdir/usr/share/vde2/dhcpd.conf.sample || return 1
+  install -D -m 644 ../iptables.rules.sample $pkgdir/usr/share/vde2/iptables.rules.sample || return 1
+  # install slirp license
+  install -D -m 644 COPYING.slirpvde $pkgdir/usr/share/licenses/vde2/COPYING.slirpvde
+}
+md5sums=('b198b92d511e4a6276b3bc87dfebe5d7'
+         '93ad951e2f94ae7f50ff9535638127e5'
+         '7d9bc56d2e561d849e915000d1c0f269'
+         'a920123fc620bcedbccb703a8d1bdc55'
+         'cb8ace28e8efd4dad128be4be71b3b07'
+         '63033c33565e2030541c5e05e9d9b063'
+         'a22730f051f4840da4a3162a88ff8156'
+         '6033d9ad0fef546d766bacac47318af6')


Property changes on: vde2/trunk/PKGBUILD
___________________________________________________________________
Added: svn:keywords
   + Id

Added: vde2/trunk/dhcpd.conf.sample
===================================================================
--- vde2/trunk/dhcpd.conf.sample	                        (rev 0)
+++ vde2/trunk/dhcpd.conf.sample	2010-01-05 18:39:02 UTC (rev 62245)
@@ -0,0 +1,12 @@
+ddns-update-style none;
+
+subnet 192.168.254.0 netmask 255.255.255.0 {
+    range 192.168.254.1 192.168.254.253;
+    option routers 192.168.254.254;
+    option domain-name "virtual.example.com";
+    # find your DNS servers from /etc/resolv.conf
+    # otherwise only pure IP addresses will work
+    option domain-name-servers 192.168.254.254;
+    option broadcast-address 192.168.254.255;
+    default-lease-time 86400;
+}

Added: vde2/trunk/iptables.rules.sample
===================================================================
--- vde2/trunk/iptables.rules.sample	                        (rev 0)
+++ vde2/trunk/iptables.rules.sample	2010-01-05 18:39:02 UTC (rev 62245)
@@ -0,0 +1,5 @@
+*filter
+-A INPUT -i tun -j ACCEPT
+-A FORWARD -s 192.168.254.0/255.255.255.0 -j ACCEPT
+*nat
+-A POSTROUTING -s 192.168.254.0/24 -j MASQUERADE

Added: vde2/trunk/vde-config.sample
===================================================================
--- vde2/trunk/vde-config.sample	                        (rev 0)
+++ vde2/trunk/vde-config.sample	2010-01-05 18:39:02 UTC (rev 62245)
@@ -0,0 +1,35 @@
+# Set options vde_switch program
+# To activate this vde profile add it to /etc/conf.d/vde
+
+# Global options
+VDE_NUMPORTS="32"  # Number of ports (default 32)
+VDE_HUB="no"       # [yes|no] Make the switch act as a hub
+VDE_FSTP="no"      # [yes|no] Activate the fast spanning tree protocol
+VDE_MAC=""         # Set the Switch MAC address
+VDE_PRIOTIRY=""    # Set the priority for FST (MAC extension)
+VDE_HASHSIZE=""    # Hash table size
+
+# Options from datasock module
+VDE_SOCK="/var/run/vde/sample.sock"  # control directory pathname
+VDE_SOCK_MODE="660"                  # Standard access mode for comm sockets (octal)
+VDE_SOCK_GROUP="root"                # Group owner for comm sockets
+
+# Options from consmgmt module
+VDE_MANAGEMENT_SOCK="/var/run/vde/sample.mgmt"  # path of the management UNIX socket
+VDE_MANAGEMENT_SOCK_MODE="660"                  # management UNIX socket access mode (octal)
+
+# Other options to parse to vde_switch
+VDE_OPTIONS=""
+
+# VDE with internet support
+# You can use either tuntap method or slirpvde method.
+
+# Options from tuntap module
+VDE_TAP=""  # Enable routing through TAP tap interface (comma separated array eg.:"tap0,tap1").
+
+# slirpvde daemon support
+SLIRP="no"         # [yes|no] enable/disable SLIRP daemon support
+SLIRP_DHCP="no"    # [yes|no] turn on the DHCP server for the network autoconfiguration of all the units connected to the VDE
+SLIRP_NETWORK="" # specify the network address (default 10.0.2.0)
+# other options to parse to slirpvde
+SLIRP_OPTIONS=""
\ No newline at end of file

Added: vde2/trunk/vde-connection.sample
===================================================================
--- vde2/trunk/vde-connection.sample	                        (rev 0)
+++ vde2/trunk/vde-connection.sample	2010-01-05 18:39:02 UTC (rev 62245)
@@ -0,0 +1,6 @@
+# You can add vde switch connections below
+# just without the # at the beginning:
+# vde_plug /var/run/vde/sample.sock = vde_plug /var/run/vde/sample2.sock
+# or if hosts are different use this syntax:
+# vde_plug /var/run/vde/sample.sock = ssh host2 vde_plug /var/run/vde/sample.sock
+

Added: vde2/trunk/vde-path_max.patch
===================================================================
--- vde2/trunk/vde-path_max.patch	                        (rev 0)
+++ vde2/trunk/vde-path_max.patch	2010-01-05 18:39:02 UTC (rev 62245)
@@ -0,0 +1,77 @@
+diff -aur vde2-2.2.2-orig/src/kvde_switch/consmgmt.c vde2-2.2.2/src/kvde_switch/consmgmt.c
+--- vde2-2.2.2-orig/src/kvde_switch/consmgmt.c	2008-06-15 13:49:19.000000000 -0300
++++ vde2-2.2.2/src/kvde_switch/consmgmt.c	2008-09-12 18:19:00.935408481 -0300
+@@ -13,6 +13,7 @@
+ #include <syslog.h>
+ #include <stdlib.h>
+ #include <libgen.h>
++#include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/ioctl.h>
+diff -aur vde2-2.2.2-orig/src/kvde_switch/datasock.c vde2-2.2.2/src/kvde_switch/datasock.c
+--- vde2-2.2.2-orig/src/kvde_switch/datasock.c	2008-06-15 13:49:19.000000000 -0300
++++ vde2-2.2.2/src/kvde_switch/datasock.c	2008-09-12 18:17:36.727494138 -0300
+@@ -15,6 +15,7 @@
+ #include <stdlib.h>
+ #include <stdint.h>
+ #include <libgen.h>
++#include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/ioctl.h>
+diff -aur vde2-2.2.2-orig/src/slirpvde/slirpvde.c vde2-2.2.2/src/slirpvde/slirpvde.c
+--- vde2-2.2.2-orig/src/slirpvde/slirpvde.c	2008-06-15 13:49:15.000000000 -0300
++++ vde2-2.2.2/src/slirpvde/slirpvde.c	2008-09-12 18:21:50.872173559 -0300
+@@ -12,6 +12,7 @@
+ #include <unistd.h>
+ #include <stdint.h>
+ #include <libgen.h>
++#include <sys/param.h>
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
+diff -aur vde2-2.2.2-orig/src/vde_autolink.c vde2-2.2.2/src/vde_autolink.c
+--- vde2-2.2.2-orig/src/vde_autolink.c	2008-03-10 06:10:34.000000000 -0300
++++ vde2-2.2.2/src/vde_autolink.c	2008-09-12 18:21:19.982059871 -0300
+@@ -26,6 +26,7 @@
+ #include <limits.h>
+ #include <string.h>
+ #include <time.h>
++#include <sys/param.h>
+ #include <sys/wait.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
+diff -aur vde2-2.2.2-orig/src/vde_plug2tap.c vde2-2.2.2/src/vde_plug2tap.c
+--- vde2-2.2.2-orig/src/vde_plug2tap.c	2008-03-10 06:10:46.000000000 -0300
++++ vde2-2.2.2/src/vde_plug2tap.c	2008-09-12 18:20:08.629583649 -0300
+@@ -10,6 +10,7 @@
+ #include <syslog.h>
+ #include <errno.h>
+ #include <string.h>
++#include <sys/param.h>
+ #include <sys/ioctl.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+diff -aur vde2-2.2.2-orig/src/vdetaplib/libvdetap.c vde2-2.2.2/src/vdetaplib/libvdetap.c
+--- vde2-2.2.2-orig/src/vdetaplib/libvdetap.c	2008-03-10 06:10:43.000000000 -0300
++++ vde2-2.2.2/src/vdetaplib/libvdetap.c	2008-09-12 18:21:03.755406693 -0300
+@@ -4,6 +4,7 @@
+ #define _GNU_SOURCE
+ #include <dlfcn.h>
+ #include <stdio.h>
++#include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/syscall.h>
+diff -aur vde2-2.2.2-orig/src/wirefilter.c vde2-2.2.2/src/wirefilter.c
+--- vde2-2.2.2-orig/src/wirefilter.c	2008-07-07 02:56:22.000000000 -0300
++++ vde2-2.2.2/src/wirefilter.c	2008-09-12 18:21:36.019384936 -0300
+@@ -26,6 +26,7 @@
+ #include <signal.h>
+ #include <math.h>
+ #include <stdarg.h>
++#include <sys/param.h>
+ #include <sys/time.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>

Added: vde2/trunk/vde.conf
===================================================================
--- vde2/trunk/vde.conf	                        (rev 0)
+++ vde2/trunk/vde.conf	2010-01-05 18:39:02 UTC (rev 62245)
@@ -0,0 +1,11 @@
+# Set options for a vde daemon script
+#
+# Array for your vde config files, eg.: "internal-net external-net"
+# You need a config file in /etc/vde/ with the same name.
+# Sample config file provided: /etc/vde/vde-config.sample
+VDE_CONFIG="" 
+
+# Array for your dpipe connections, eg.: "connect-switches"
+# You need a config file in /etc/vde/ with the same name.
+# Sample config file provided: /etc/vde/vde-connection.sample
+VDE_CONNECTION=""
\ No newline at end of file

Added: vde2/trunk/vde.rc
===================================================================
--- vde2/trunk/vde.rc	                        (rev 0)
+++ vde2/trunk/vde.rc	2010-01-05 18:39:02 UTC (rev 62245)
@@ -0,0 +1,112 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/vde
+
+case "$1" in
+  start)
+    # bring up all defined profiles
+    for i in $VDE_CONFIG; do
+      [ -e /etc/vde/$i ] && . /etc/vde/$i
+      stat_busy "Starting vde_switch $i"
+      # get options from profile
+      [ -n "$VDE_NUMPORTS" ] && OPTIONS="-n $VDE_NUMPORTS"
+      [ "$VDE_HUB" = "yes" ] && OPTIONS="$OPTIONS -x"
+      [ "$VDE_FSTP" = "yes" ] && OPTIONS="$OPTIONS -F"
+      [ -n "$VDE_MAC" ] && OPTIONS="$OPTIONS --macaddr $VDE_MAC"
+      [ -n "$VDE_PRIORITY" ] && OPTIONS="$OPTIONS --priority $VDE_PRIORITY"
+      [ -n "$VDE_HASH" ] && OPTIONS="$OPTIONS --hashsize $VDE_HASH"
+      [ -n "$VDE_SOCK" ] && OPTIONS="$OPTIONS -s $VDE_SOCK"
+      [ -n "$VDE_SOCK_MODE" ] && OPTIONS="$OPTIONS -m $VDE_SOCK_MODE"
+      [ -n "$VDE_SOCK_GROUP" ] && OPTIONS="$OPTIONS -g $VDE_SOCK_GROUP"
+      [ -n "$VDE_MANAGEMENT_SOCK" ] && OPTIONS="$OPTIONS -M $VDE_MANAGEMENT_SOCK"
+      [ -n "$VDE_MANAGEMENT_SOCK_MODE" ] && OPTIONS="$OPTIONS --mgmtmode $VDE_MANAGEMENT_SOCK_MODE"
+      [ -n "$VDE_TAP" ] && OPTIONS="$OPTIONS -t $VDE_TAP"
+      [ -n "$VDE_OPTIONS" ] && OPTIONS="$OPTIONS $VDE_OPTIONS"
+      vde_switch $OPTIONS -p /var/run/vde-$i.pid -daemon &>/dev/null
+      if [ $? -gt 0 ]; then
+        stat_fail
+      else
+        stat_done
+      fi
+      if [ "$SLIRP" = "yes" ]; then
+        stat_busy "Starting slirpvde for $i"
+        [ "$SLIRP_DHCP" = "yes" ] && SP_OPTIONS="-D"
+        [ -n "$SLIRP_NETWORK" ] && SP_OPTIONS="$SP_OPTIONS -n"
+        [ -n "$SLIRP_OPTIONS" ] && SP_OPTIONS="$SP_OPTIONS $SLIRP_OPTIONS"
+        [ -n "$VDE_SOCK" ] && SP_OPTIONS="$SP_OPTIONS -s $VDE_SOCK"
+        [ -n "$VDE_SOCK_MODE" ] && SP_OPTIONS="$SP_OPTIONS -m $VDE_SOCK_MODE"
+        [ -n "$VDE_SOCK_GROUP" ] && SP_OPTIONS="$SP_OPTIONS -g $VDE_SOCK_GROUP"
+        slirpvde $SP_OPTIONS -p /var/run/slirpvde-$i.pid -daemon &>/dev/null
+        if [ $? -gt 0 ]; then
+          stat_fail
+        else
+          stat_done
+        fi
+        unset OPTIONS
+        unset SP_OPTIONS
+      fi
+    done
+    for i in $VDE_CONNECTION; do
+      # connect specified vde_switches
+      if [ "$(grep ^vde_plug /etc/vde/$i)" ]; then
+        stat_busy "Connecting VDE switches $i together..."
+        while read j; do
+          switch="$(echo $j | grep ^vde_plug)"
+          [ -n "$switch" ] && (dpipe $switch &)
+        done </etc/vde/$i
+        if [ $? -gt 0 ]; then
+          stat_fail
+        else
+          stat_done
+        fi
+      fi
+    done
+    add_daemon vde
+    ;;
+  stop)
+    # kill vde_plug if switches are connected
+    [ -n "$VDE_CONNECTION" ] && killall vde_plug >/dev/null 2>&1
+    for i in $VDE_CONFIG; do
+      [ -e /etc/vde/$i ] && . /etc/vde/$i
+      if [ "$SLIRP" = "yes" ]; then
+        stat_busy "Stopping slirpvde for $i"
+        kill $(cat /var/run/slirpvde-$i.pid) &> /dev/null
+        if [ $? -gt 0 ]; then
+          stat_fail
+        else
+          stat_done
+        fi
+        rm /var/run/slirpvde-$i.pid &> /dev/null
+      fi
+      stat_busy "Stopping vde_switch $i"
+      kill $(cat /var/run/vde-$i.pid) &> /dev/null
+        if [ $? -gt 0 ]; then
+          stat_fail
+        else
+          stat_done
+        fi
+      rm /var/run/vde-$i.pid &> /dev/null
+      stat_busy "Removing $i vde sockets"
+      rm -rf $VDE_SOCK $VDE_MANAGEMENT_SOCK
+      if [ $? -gt 0 ]; then
+        stat_fail
+      else
+        stat_done
+      fi
+    done
+      unset OPTIONS
+      unset SP_OPTIONS
+      [ -e /var/run/vde/gmon.out ] && rm /var/run/vde/gmon.out
+      rm_daemon vde 
+    ;;
+  restart)
+    $0 stop
+    sleep 3
+    $0 start
+    ;;
+    *)
+    echo "usage: $0 {start|stop|restart}"
+esac
+exit 0


Property changes on: vde2/trunk/vde.rc
___________________________________________________________________
Added: svn:executable
   + *

Added: vde2/trunk/vde2.install
===================================================================
--- vde2/trunk/vde2.install	                        (rev 0)
+++ vde2/trunk/vde2.install	2010-01-05 18:39:02 UTC (rev 62245)
@@ -0,0 +1,14 @@
+post_install() {
+  echo "Change /etc/conf.d/vde to your needs."
+  echo "vde config files should be placed in /etc/vde, sample files are provided."
+  echo "iptables and dhcpd sample files have been installed to '/usr/share/vde2'."
+  echo "Merge those examples if needed to the according config files."
+}
+
+post_upgrade() {
+  post_install $1
+}
+
+op=$1
+shift
+$op $*




More information about the arch-commits mailing list