From patchwork Wed Dec 16 22:47:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurucharan Shetty X-Patchwork-Id: 557812 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id 7C80E1402C9 for ; Thu, 17 Dec 2015 09:56:00 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id AA1DE10617; Wed, 16 Dec 2015 14:55:48 -0800 (PST) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v3.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id DD2D0105FF for ; Wed, 16 Dec 2015 14:55:46 -0800 (PST) Received: from bar3.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id 0EDE0162494 for ; Wed, 16 Dec 2015 15:55:46 -0700 (MST) X-ASG-Debug-ID: 1450306545-03dd7b55d1e5a00001-byXFYA Received: from mx3-pf2.cudamail.com ([192.168.14.1]) by bar3.cudamail.com with ESMTP id Bzh02s6gNQWelBgt (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 16 Dec 2015 15:55:45 -0700 (MST) X-Barracuda-Envelope-From: guru.ovn@gmail.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.1 Received: from unknown (HELO mail-pa0-f42.google.com) (209.85.220.42) by mx3-pf2.cudamail.com with ESMTPS (RC4-SHA encrypted); 16 Dec 2015 22:55:45 -0000 Received-SPF: pass (mx3-pf2.cudamail.com: SPF record at _netblocks.google.com designates 209.85.220.42 as permitted sender) X-Barracuda-RBL-Trusted-Forwarder: 209.85.220.42 Received: by mail-pa0-f42.google.com with SMTP id ur14so30772977pab.0 for ; Wed, 16 Dec 2015 14:55:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AnkrXEaXiRUsWh16dck4u472KeZkXAdZ/Jr2vhiGFOE=; b=VC1MX+6NsNe9n63lnxiZHtQhb/wyPDglm//j0KU1Qlw7qhX5+XhuQI6FlMRObxPt1o rOhNBJbL8BT0EOqcOCc8zR4BA8yrBrpHKyLhUGfhtt1EGgxAudZ0nSAEEo4Uas4xQ1O/ oFFcj85CibJj4iC2E530gdA0MNe/boqmcm8s/xEGYG+u53oI44RXVDCiFFh3raFetCbb gwCdWIBi80gDJ4n/yTuAVyXknguKy4svQEYuDp/7Pss3oM3YGEcQUN6X6ht9lg16mlXY TncfB8qerBL/lhv/l2oIDgOpf1SvTBGCfCP1v+x2yXPfBDkj8E7jtUbpuYcmcoSBlne+ Rpyg== X-Received: by 10.66.227.1 with SMTP id rw1mr68445958pac.35.1450306544375; Wed, 16 Dec 2015 14:55:44 -0800 (PST) Received: from ubuntu-test.eng.vmware.com ([208.91.1.34]) by smtp.gmail.com with ESMTPSA id 84sm6977671pfn.83.2015.12.16.14.55.43 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 16 Dec 2015 14:55:43 -0800 (PST) X-CudaMail-Envelope-Sender: guru.ovn@gmail.com X-Barracuda-Apparent-Source-IP: 208.91.1.34 From: Gurucharan Shetty To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V2-1215061273 X-CudaMail-DTE: 121615 X-CudaMail-Originating-IP: 209.85.220.42 Date: Wed, 16 Dec 2015 14:47:09 -0800 X-ASG-Orig-Subj: [##CM-V2-1215061273##][PATCH v2 3/5] debian: Add a package for host components. Message-Id: <1450306031-17238-3-git-send-email-guru@ovn.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1450306031-17238-1-git-send-email-guru@ovn.org> References: <1450306031-17238-1-git-send-email-guru@ovn.org> X-Barracuda-Connect: UNKNOWN[192.168.14.1] X-Barracuda-Start-Time: 1450306545 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [PATCH v2 3/5] debian: Add a package for host components. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" Signed-off-by: Gurucharan Shetty Acked-by: Ben Pfaff --- v1-v2: change the name of package from openvswitch-ovn-controller to ovn-host --- debian/.gitignore | 1 + debian/automake.mk | 7 ++++++ debian/control | 16 ++++++++++++++ debian/ovn-host.dirs | 1 + debian/ovn-host.init | 53 ++++++++++++++++++++++++++++++++++++++++++++++ debian/ovn-host.install | 1 + debian/ovn-host.manpages | 1 + debian/ovn-host.postinst | 49 ++++++++++++++++++++++++++++++++++++++++++ debian/ovn-host.postrm | 44 ++++++++++++++++++++++++++++++++++++++ debian/ovn-host.template | 5 +++++ debian/rules | 3 +++ 11 files changed, 181 insertions(+) create mode 100644 debian/ovn-host.dirs create mode 100755 debian/ovn-host.init create mode 100644 debian/ovn-host.install create mode 100644 debian/ovn-host.manpages create mode 100755 debian/ovn-host.postinst create mode 100755 debian/ovn-host.postrm create mode 100644 debian/ovn-host.template diff --git a/debian/.gitignore b/debian/.gitignore index fdcf9b3..a7a2be8 100644 --- a/debian/.gitignore +++ b/debian/.gitignore @@ -19,5 +19,6 @@ /openvswitch-testcontroller /openvswitch-vtep /ovn-common +/ovn-host /python-openvswitch /tmp diff --git a/debian/automake.mk b/debian/automake.mk index 2b6f098..422cdc9 100644 --- a/debian/automake.mk +++ b/debian/automake.mk @@ -52,6 +52,13 @@ EXTRA_DIST += \ debian/openvswitch-vtep.manpages \ debian/ovn-common.install \ debian/ovn-common.manpages \ + debian/ovn-host.dirs \ + debian/ovn-host.init \ + debian/ovn-host.install \ + debian/ovn-host.manpages \ + debian/ovn-host.postinst \ + debian/ovn-host.postrm \ + debian/ovn-host.template \ debian/ovs-monitor-ipsec \ debian/python-openvswitch.dirs \ debian/python-openvswitch.install \ diff --git a/debian/control b/debian/control index 57285f1..725f552 100644 --- a/debian/control +++ b/debian/control @@ -112,6 +112,22 @@ Description: OVN common components . ovn-common provides components required by other OVN packages. +Package: ovn-host +Architecture: linux-any +Depends: openvswitch-switch (= ${binary:Version}), + openvswitch-common (= ${binary:Version}), + ovn-common (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Description: OVN host components + OVN, the Open Virtual Network, is a system to support virtual network + abstraction. OVN complements the existing capabilities of OVS to add + native support for virtual network abstractions, such as virtual L2 and L3 + overlays and security groups. + . + ovn-host provides the userspace components and utilities for + OVN that can be run on every host/hypervisor. + Package: openvswitch-ipsec Architecture: linux-any Depends: ipsec-tools (>=0.8~alpha20101208), diff --git a/debian/ovn-host.dirs b/debian/ovn-host.dirs new file mode 100644 index 0000000..7d3c761 --- /dev/null +++ b/debian/ovn-host.dirs @@ -0,0 +1 @@ +/usr/share/ovn/host diff --git a/debian/ovn-host.init b/debian/ovn-host.init new file mode 100755 index 0000000..bddf628 --- /dev/null +++ b/debian/ovn-host.init @@ -0,0 +1,53 @@ +#! /bin/sh +# +### BEGIN INIT INFO +# Provides: ovn-host +# Required-Start: openvswitch-switch $remote_fs $syslog +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OVN host components +# Description: ovn-host provides the userspace +# components and utilities for OVN that can be run on +# every host/hypervisor. +### END INIT INFO + +test -x /usr/bin/ovn-controller || exit 0 +test -x /usr/share/openvswitch/scripts/ovn-ctl || exit 0 + +_SYSTEMCTL_SKIP_REDIRECT=yes + +. /usr/share/openvswitch/scripts/ovs-lib +if [ -e /etc/default/ovn-host ]; then + . /etc/default/ovn-host +fi + +start () { + set /usr/share/openvswitch/scripts/ovn-ctl ${1-start_controller} + set "$@" $OVN_CTL_OPTS + "$@" || exit $? +} + +case $1 in + start) + start + ;; + stop | force-stop) + /usr/share/openvswitch/scripts/ovn-ctl stop_controller + ;; + restart) + start restart_controller + ;; + status) + /usr/share/openvswitch/scripts/ovn-ctl status_controller + exit $? + ;; + reload | force-reload) + ;; + *) + echo "Usage: $0 {start|stop|reload|force-reload|restart|status}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/debian/ovn-host.install b/debian/ovn-host.install new file mode 100644 index 0000000..d2de82f --- /dev/null +++ b/debian/ovn-host.install @@ -0,0 +1 @@ +usr/bin/ovn-controller diff --git a/debian/ovn-host.manpages b/debian/ovn-host.manpages new file mode 100644 index 0000000..4f9e7bc --- /dev/null +++ b/debian/ovn-host.manpages @@ -0,0 +1 @@ +ovn/controller/ovn-controller.8 diff --git a/debian/ovn-host.postinst b/debian/ovn-host.postinst new file mode 100755 index 0000000..05e80ad --- /dev/null +++ b/debian/ovn-host.postinst @@ -0,0 +1,49 @@ +#!/bin/sh +# postinst script for ovn-host +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + DEFAULT=/etc/default/ovn-host + TEMPLATE=/usr/share/ovn/host/default.template + if ! test -e $DEFAULT; then + cp $TEMPLATE $DEFAULT + else + for var in $(awk -F'[ :]' '/^# [_A-Z0-9]+:/{print $2}' $TEMPLATE) + do + if ! grep $var $DEFAULT >/dev/null 2>&1; then + echo >> $DEFAULT + sed -n "/$var:/,/$var=/p" $TEMPLATE >> $DEFAULT + fi + done + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/ovn-host.postrm b/debian/ovn-host.postrm new file mode 100755 index 0000000..4cceb90 --- /dev/null +++ b/debian/ovn-host.postrm @@ -0,0 +1,44 @@ +#!/bin/sh +# postrm script for ovn-host +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge) + rm -f /etc/default/ovn-host + rm -f /var/log/openvswitch/ovn-controller.log* || true + ;; + + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/debian/ovn-host.template b/debian/ovn-host.template new file mode 100644 index 0000000..7fd54ef --- /dev/null +++ b/debian/ovn-host.template @@ -0,0 +1,5 @@ +# This is a POSIX shell fragment -*- sh -*- + +# OVN_CTL_OPTS: Extra options to pass to ovs-ctl. This is, for example, +# a suitable place to specify --ovn-controller-wrapper=valgrind. +# OVN_CTL_OPTS= diff --git a/debian/rules b/debian/rules index d8e90c7..f95f509 100755 --- a/debian/rules +++ b/debian/rules @@ -54,6 +54,9 @@ override_dh_install: # openvswitch-switch cp debian/openvswitch-switch.template debian/openvswitch-switch/usr/share/openvswitch/switch/default.template + # ovn-host + cp debian/ovn-host.template debian/ovn-host/usr/share/ovn/host/default.template + # openvswitch-datapath-source cp debian/rules.modules debian/openvswitch-datapath-source/usr/src/modules/openvswitch-datapath/debian/rules chmod 755 debian/openvswitch-datapath-source/usr/src/modules/openvswitch-datapath/debian/rules