From 6a8600f5db7c7c93a23e4b72c5a86064f30410b6 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 21 Oct 2008 16:31:50 -0700 Subject: [PATCH] Add support for packaging openflowext. --- boot.sh | 14 +++++++++++++- debian/.gitignore | 10 ++++++++++ debian/{control => control.in} | 1 + debian/openflow-switch.default | 9 ++++++++- debian/openflow-switch.init | 9 ++++++--- 5 files changed, 38 insertions(+), 5 deletions(-) rename debian/{control => control.in} (99%) diff --git a/boot.sh b/boot.sh index 6a5ac53d..0f48d439 100755 --- a/boot.sh +++ b/boot.sh @@ -22,7 +22,7 @@ done # Generate list of files in debian/ to distribute. (echo '# Automatically generated by boot.sh (from Git tree).' && - echo 'EXTRA_DIST += \' && + printf 'EXTRA_DIST += \\\n' && git ls-files debian | grep -v '^debian/\.gitignore$' | sed -e 's/\(.*\)/ \1 \\/' -e '$s/ \\//') > debian/automake.mk @@ -31,10 +31,22 @@ if test "$have_ext" = yes; then echo 'Enabling openflowext...' echo 'include ext/automake.mk' > ext.mk echo 'm4_include([ext/configure.m4])' > ext.m4 + cat debian/control.in ext/debian/control.in > debian/control + for d in $(cd ext/debian && git ls-files --exclude-from=debian/dontlink) + do + test -e debian/$d || ln -s ../ext/debian/$d debian/$d + if ! fgrep -q $d debian/.gitignore; then + echo "Adding $d to debian/.gitignore" + (cat debian/.gitignore && printf '/%s' "$d") \ + | LC_ALL=C sort > tmp$$ \ + && mv tmp$$ debian/.gitignore + fi + done else echo 'Disabling openflowext...' echo '# This file intentionally left blank.' > ext.mk echo '# This file intentionally left blank.' > ext.m4 + cat debian/control.in > debian/control fi # Bootstrap configure system from .ac/.am files diff --git a/debian/.gitignore b/debian/.gitignore index 1e6be8eb..5d50a1d6 100644 --- a/debian/.gitignore +++ b/debian/.gitignore @@ -1,10 +1,20 @@ *.debhelper +*.debhelper.log *.substvars /automake.mk +/control /files /openflow /openflow-common +/openflow-common.copyright /openflow-controller /openflow-datapath-source /openflow-pki /openflow-switch +/openflow-switch.copyright +/openflow-switchmon +/openflow-switchmon.copyright +/openflow-switchmon.default +/openflow-switchmon.dirs +/openflow-switchmon.init +/openflow-switchmon.install diff --git a/debian/control b/debian/control.in similarity index 99% rename from debian/control rename to debian/control.in index 2e61374f..65d537f1 100644 --- a/debian/control +++ b/debian/control.in @@ -55,3 +55,4 @@ Description: OpenFlow controller implementation to act as MAC-learning Ethernet switches. . OpenFlow is a protocol for flow-based control over network switching. + diff --git a/debian/openflow-switch.default b/debian/openflow-switch.default index e4fb07bc..a2b19b2c 100644 --- a/debian/openflow-switch.default +++ b/debian/openflow-switch.default @@ -78,5 +78,12 @@ SWITCH_IP=dhcp # Required if SSL enabled. #CACERT=/etc/openflow-switch/cacert.pem -# Additional options to pass to secchan, e.g. "--fail=open" +# MGMT_VCONNS: List of vconns (space-separated) on which secchan +# should listen for management connections from dpctl, etc. +# openflow-switchmon by default connects to +# unix:/var/run/secchan.socket, so do not disable this if you want to +# use openflow-switchmon. +MGMT_VCONNS="punix:/var/run/secchan.socket" + +# DAEMON_OPTS: Additional options to pass to secchan, e.g. "--fail=open" DAEMON_OPTS="" diff --git a/debian/openflow-switch.init b/debian/openflow-switch.init index 5d658ed6..b4e39afc 100755 --- a/debian/openflow-switch.init +++ b/debian/openflow-switch.init @@ -27,7 +27,6 @@ test -x $DAEMON || exit 0 LOGDIR=/var/log/openflow PIDFILE=/var/run/$NAME.pid -MGMTSOCK=/var/run/$NAME.socket DHCLIENT_PIDFILE=/var/run/dhclient.of0.pid DODTIME=1 # Time to wait for the server to die, in seconds # If this value is set too low you might not @@ -207,11 +206,15 @@ case "$1" in must_succeed "Disabling of0" ifconfig of0 down fi + MGMT_OPTS= + for vconn in $MGMT_VCONNS; do + MGMT_OPTS="$MGMT_OPTS --listen=$vconn" + done + echo -n "Starting $DESC: " start-stop-daemon --start --quiet --pidfile $PIDFILE \ --exec $DAEMON -- nl:0 $CONTROLLER --detach --pidfile=$PIDFILE \ - --verbose=ANY:console:emer --listen=punix:$MGMTSOCK \ - $DAEMON_OPTS $SSL_OPTS + --verbose=ANY:console:emer $DAEMON_OPTS $MGMT_OPTS $SSL_OPTS if running; then echo "$NAME." else -- 2.30.2