Author: baggins Date: Mon Mar 19 20:58:30 2012 GMT Module: packages Tag: HEAD ---- Log message: - new, half-raw
---- Files affected: packages/openvswitch: README.PLD (NONE -> 1.1) (NEW), ifdown-ovs (NONE -> 1.1) (NEW), ifup-ovs (NONE -> 1.1) (NEW), openvswitch.init (NONE -> 1.1) (NEW), openvswitch.logrotate (NONE -> 1.1) (NEW), openvswitch.service (NONE -> 1.1) (NEW), openvswitch.spec (NONE -> 1.1) (NEW), openvswitch.sysconfig (NONE -> 1.1) (NEW), openvswitch.tmpfiles (NONE -> 1.1) (NEW) ---- Diffs: ================================================================ Index: packages/openvswitch/README.PLD diff -u /dev/null packages/openvswitch/README.PLD:1.1 --- /dev/null Mon Mar 19 21:58:30 2012 +++ packages/openvswitch/README.PLD Mon Mar 19 21:58:25 2012 @@ -0,0 +1,103 @@ + +To use the integration for a Open vSwitch bridge or interface named +<name>, create or edit /etc/sysconfig/interfaces/ifcfg-<name>. +This is a shell script that consists of a series of VARIABLE=VALUE +assignments. The following OVS-specific variable names are supported: + + - DEVICETYPE: Always set to "ovs". + + - TYPE: If this is "OVSBridge", then this file represents an OVS + bridge named <name>. Otherwise, it represents a port on an OVS + bridge and TYPE must have one of the following values: + + * "OVSPort", if <name> is a physical port (e.g. eth0) or + virtual port (e.g. vif1.0). + + * "OVSIntPort", if <name> is an internal port (e.g. a tagged + VLAN). + + * "OVSBond", if <name> is an OVS bond. + + - OVS_BRIDGE: If TYPE is anything other than "OVSBridge", set to + the name of the OVS bridge to which the port should be attached. + + - OVS_OPTIONS: Optionally, extra options to set in the "Port" + table when adding the port to the bridge, as a sequence of + column[:key]=value options. For example, "tag=100" to make the + port an access port for VLAN 100. See the documentation of + "add-port" in ovs-vsctl(8) for syntax and the section on the + Port table in ovs-vswitchd.conf.db(5) for available options. + + - OVS_EXTRA: Optionally, additional ovs-vsctl commands, separated + by "--" (double dash). + + - BOND_IFACES: For "OVSBond" interfaces, a list of physical + interfaces to bond together. + +Note +---- + +"ifdown" on a bridge will not bring individual ports on the bridge +down. "ifup" on a bridge will not add ports to the bridge. This +behavior should be compatible with standard bridges (with +TYPE=Bridge). + +Examples +-------- + +Standalone bridge: + +==> ifcfg-ovsbridge0 <== +DEVICE=ovsbridge0 +ONBOOT=yes +DEVICETYPE=ovs +TYPE=OVSBridge +BOOTPROTO=static +IPADDR=A.B.C.D/XX +HOTPLUG=no + + +Adding physical eth0 to ovsbridge0 described above: + +==> ifcfg-eth0 <== +DEVICE=eth0 +ONBOOT=yes +DEVICETYPE=ovs +TYPE=OVSPort +OVS_BRIDGE=ovsbridge0 +BOOTPROTO=none +HOTPLUG=no + + +Tagged VLAN interface on top of ovsbridge0: + +==> ifcfg-vlan100 <== +DEVICE=vlan100 +ONBOOT=yes +DEVICETYPE=ovs +TYPE=OVSIntPort +BOOTPROTO=static +IPADDR=A.B.C.D/XX +OVS_BRIDGE=ovsbridge0 +OVS_OPTIONS="tag=100" +OVS_EXTRA="set Interface $DEVICE external-ids:iface-id=$(hostname -s)-$DEVICE-vif" +HOTPLUG=no + + +Bonding: + +==> ifcfg-bond0 <== +DEVICE=bond0 +ONBOOT=yes +DEVICETYPE=ovs +TYPE=OVSBond +OVS_BRIDGE=ovsbridge0 +BOOTPROTO=none +BOND_IFACES="gige-1b-0 gige-1b-1 gige-21-0 gige-21-1" +OVS_OPTIONS="bond_mode=balance-tcp lacp=active" +HOTPLUG=no + +==> ifcfg-gige-* <== +DEVICE=gige-* +ONBOOT=yes +HOTPLUG=no ================================================================ Index: packages/openvswitch/ifdown-ovs diff -u /dev/null packages/openvswitch/ifdown-ovs:1.1 --- /dev/null Mon Mar 19 21:58:30 2012 +++ packages/openvswitch/ifdown-ovs Mon Mar 19 21:58:25 2012 @@ -0,0 +1,42 @@ +#!/bin/sh + +# Copyright (c) 2011 Alexey I. Froloff. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +PATH=/sbin:/usr/sbin:/bin:/usr/bin + +. /etc/sysconfig/network +. /etc/rc.d/init.d/functions +. /lib/rc-scripts/functions.network + +CONFIG=$1 +source_config + +if [ "foo$2" = "fooboot" ] && is_no "${ONBOOT}"; then + exit +fi + +case "$TYPE" in + OVSBridge) + ovs-vsctl -- --if-exists del-br "$DEVICE" + ;; + OVSPort|OVSIntPort|OVSBond) + ovs-vsctl -- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" + ;; + *) + echo "Invalid OVS interface type $TYPE" + exit 1 + ;; +esac + +exit 0 ================================================================ Index: packages/openvswitch/ifup-ovs diff -u /dev/null packages/openvswitch/ifup-ovs:1.1 --- /dev/null Mon Mar 19 21:58:30 2012 +++ packages/openvswitch/ifup-ovs Mon Mar 19 21:58:25 2012 @@ -0,0 +1,54 @@ +#!/bin/sh + +# Copyright (c) 2011 Alexey I. Froloff. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +PATH=/sbin:/usr/sbin:/bin:/usr/bin + +. /etc/sysconfig/network +. /etc/rc.d/init.d/functions +. /lib/rc-scripts/functions.network + +CONFIG=$1 +source_config + +if [ "foo$2" = "fooboot" ] && is_no "${ONBOOT}"; then + exit +fi + +case "$TYPE" in + OVSBridge) + ovs-vsctl -- --may-exist add-br "$DEVICE" $OVS_OPTIONS ${OVS_EXTRA:+-- $OVS_EXTRA} + ;; + OVSPort) + ovs-vsctl br-exists "$OVS_BRIDGE" || /sbin/ifup "$OVS_BRIDGE" + ovs-vsctl -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS ${OVS_EXTRA:+-- $OVS_EXTRA} + ;; + OVSIntPort) + ovs-vsctl br-exists "$OVS_BRIDGE" || /sbin/ifup "$OVS_BRIDGE" + ovs-vsctl -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS -- set Interface "$DEVICE" type=internal ${OVS_EXTRA:+-- $OVS_EXTRA} + ;; + OVSBond) + ovs-vsctl br-exists "$OVS_BRIDGE" || /sbin/ifup "$OVS_BRIDGE" + for _iface in $BOND_IFACES; do + /sbin/ifup ${_iface} + done + ovs-vsctl -- --fake-iface add-bond "$OVS_BRIDGE" "$DEVICE" ${BOND_IFACES} $OVS_OPTIONS ${OVS_EXTRA:+-- $OVS_EXTRA} + ;; + *) + echo "Invalid OVS interface type $TYPE" + exit 1 + ;; +esac + +exit 0 ================================================================ Index: packages/openvswitch/openvswitch.init diff -u /dev/null packages/openvswitch/openvswitch.init:1.1 --- /dev/null Mon Mar 19 21:58:31 2012 +++ packages/openvswitch/openvswitch.init Mon Mar 19 21:58:25 2012 @@ -0,0 +1,96 @@ +#!/bin/sh +# +# openvswitch Open vSwitch switch +# +# chkconfig: 2345 09 91 +# description: Manage Open vSwitch kernel modules and user-space daemons + +### BEGIN INIT INFO +# Provides: openvswitch-switch +# Required-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Open vSwitch switch +### END INIT INFO + +# Source function library +. /etc/rc.d/init.d/functions + +# Get network config +. /etc/sysconfig/network + +. /usr/share/openvswitch/scripts/ovs-lib || exit 1 + +FORCE_COREFILES="yes" +OVSDB_SERVER_PRIORITY="-10" +VSWITCHD_PRIORITY="-10" +BRCOMPATD_PRIORITY="-10" +VSWITCHD_MLOCKALL="yes" +[ -f /etc/sysconfig/openvswitch ] && . /etc/sysconfig/openvswitch + +ovs_ctl=/usr/share/openvswitch/scripts/ovs-ctl + +# Check that networking is up. +if is_yes "${NETWORKING}"; then + if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status -a "$1" != init ]; then + msg_network_down "Open vSwitch switch" + exit 1 + fi +else + exit 0 +fi + +start () { + if ! $ovs_ctl load-kmod; then + return 1 + fi + $ovs_ctl ${1:-start} \ + --system-id=random \ + --force-corefiles=$FORCE_COREFILES \ + --ovsdb-server-priority=$OVSDB_SERVER_PRIORITY \ + --ovs-vswitchd-priority=$VSWITCHD_PRIORITY \ + --mlockall=$VSWITCHD_MLOCKALL \ + $OPENVSWITCH_OPTIONS + + $ovs_ctl --protocol=gre enable-protocol + + touch /var/lock/subsys/openvswitch +} + +stop () { + $ovs_ctl stop + rm -f /var/lock/subsys/openvswitch +} + +case $1 in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + reload|force-reload) + # Nothing to do. + ;; + status) + $ovs_ctl status + ;; + version) + $ovs_ctl version + ;; + force-reload-kmod) + start force-reload-kmod + ;; + help) + printf "$0 [start|stop|restart|reload|force-reload|status|version|force-reload-kmod]\n" + ;; + *) + printf "Unknown command: $1\n" + exit 1 + ;; +esac ================================================================ Index: packages/openvswitch/openvswitch.logrotate diff -u /dev/null packages/openvswitch/openvswitch.logrotate:1.1 --- /dev/null Mon Mar 19 21:58:31 2012 +++ packages/openvswitch/openvswitch.logrotate Mon Mar 19 21:58:25 2012 @@ -0,0 +1,20 @@ +# Copyright (C) 2009, 2010, 2011 Nicira Networks, Inc. +# +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. This file is offered as-is, +# without warranty of any kind. + +/var/log/openvswitch/*.log { + sharedscripts + missingok + postrotate + # Tell Open vSwitch daemons to reopen their log files + if [ -e /var/run/openvswitch/ovs-vswitchd.pid ]; then + /usr/bin/ovs-appctl -t ovs-vswitchd vlog/reopen + fi + if [ -e /var/run/openvswitch/ovsdb-server.pid ]; then + /usr/bin/ovs-appctl -t ovsdb-server vlog/reopen + fi + endscript +} ================================================================ Index: packages/openvswitch/openvswitch.service diff -u /dev/null packages/openvswitch/openvswitch.service:1.1 --- /dev/null Mon Mar 19 21:58:31 2012 +++ packages/openvswitch/openvswitch.service Mon Mar 19 21:58:25 2012 @@ -0,0 +1,18 @@ +[Unit] +Description= +After=network.target named.service remote-fs.target syslog.target + +[Service] +Type=forking +Environment=FORCE_COREFILES="yes" +Environment=OVSDB_SERVER_PRIORITY="-10" +Environment=VSWITCHD_PRIORITY="-10" +Environment=BRCOMPATD_PRIORITY="-10" +Environment=VSWITCHD_MLOCKALL="yes" +EnvironmentFile=-/etc/sysconfig/openvswitch +ExecStart=/usr/share/openvswitch/scripts/ovs-ctl start --system-id=random --force-corefiles=$FORCE_COREFILES --ovsdb-server-priority=$OVSDB_SERVER_PRIORITY --ovs-vswitchd-priority=$VSWITCHD_PRIORITY --mlockall=$VSWITCHD_MLOCKALL $OPENVSWITCH_OPTIONS +ExecStartPost=/usr/share/openvswitch/scripts/ovs-ctl --protocol=gre enable-protocol +ExecStop=/usr/share/openvswitch/scripts/ovs-ctl stop + +[Install] +WantedBy=multi-user.target ================================================================ Index: packages/openvswitch/openvswitch.spec diff -u /dev/null packages/openvswitch/openvswitch.spec:1.1 --- /dev/null Mon Mar 19 21:58:31 2012 +++ packages/openvswitch/openvswitch.spec Mon Mar 19 21:58:25 2012 @@ -0,0 +1,249 @@ +# $Revision$, $Date$ +# +# Conditional build: +%bcond_without dist_kernel # allow non-distribution kernel +%bcond_without kernel # don't build kernel modules +%bcond_without userspace # don't build userspace programs +%bcond_with verbose # verbose build (V=1) + +# set kernel_builtin to true for kernels with openvswitch module (>= 3.3) +%define kernel_builtin %(echo %{_kernel_ver} | awk '{ split($0, v, "."); vv=v[1]*1000+v[2]; if (vv >= 3003) print 1; else print 0 }') +#' +%if %{kernel_builtin} == 1 +%undefine with_kernel +%endif + +%if %{without kernel} +%undefine with_dist_kernel +%endif +%if "%{_alt_kernel}" != "%{nil}" +%undefine with_userspace +%endif +%if %{without userspace} +# nothing to be placed to debuginfo package +%define _enable_debug_packages 0 +%endif + +%define rel 0.1 +Summary: Production Quality, Multilayer Open Virtual Switch +#Summary(pl.UTF-8): - +Name: openvswitch +Version: 1.4.0 +Release: %{rel} +License: Apache v2.0 +Group: Applications +Source0: http://openvswitch.org/releases/%{name}-%{version}.tar.gz +# Source0-md5: 3847c60af329bfe81ff7220b9f489fa5 +Source1: ifdown-ovs +Source2: ifup-ovs +Source3: README.PLD +Source4: %{name}.logrotate +Source5: %{name}.tmpfiles +Source6: %{name}.sysconfig +Source7: %{name}.init +#Source8: openvswitch-controller.init +#Source9: openvswitch-ipsec.init +Source10: %{name}.service +URL: http://openvswitch.org/ +BuildRequires: python-distribute +BuildRequires: rpm-pythonprov +BuildRequires: rpmbuild(macros) >= 1.647 +%if %{with kernel} +%{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20.2} +%endif +Requires(post,preun): /sbin/chkconfig +#BuildRequires: - +Requires: python-modules +Requires: rc-scripts +#Requires(postun): - +#Requires(pre,post): - +#Requires(preun): - +#Requires: - +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) + +%description +Open vSwitch is a production quality, multilayer virtual switch +licensed under the open source Apache 2.0 license. It is designed to +enable massive network automation through programmatic extension, +while still supporting standard management interfaces and protocols +(e.g. NetFlow, sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In addition, +it is designed to support distribution across multiple physical +servers similar to VMware's vNetwork distributed vswitch or Cisco's +Nexus 1000V. + +#%description -l pl.UTF-8 + +%package test +###### Unknown group! +Summary: Open vSwitch test package +Group: - +Requires: python-modules + +%description test +This package contains utilities that are useful to diagnose +performance and connectivity issues in Open vSwitch setup. + +%package -n kernel%{_alt_kernel}-net-openvswitch +Summary: Linux driver for openvswitch +Summary(pl.UTF-8): Sterownik dla Linuksa do openvswitch +Release: %{rel}@%{_kernel_ver_str} +Group: Base/Kernel +Requires(post,postun): /sbin/depmod +%if %{with dist_kernel} +%requires_releq_kernel +Requires(postun): %releq_kernel +%endif + +%description -n kernel%{_alt_kernel}-net-openvswitch +This is driver for openvswitch for Linux. + +This package contains Linux module. + +%description -n kernel%{_alt_kernel}-net-openvswitch -l pl.UTF-8 +Sterownik dla Linuksa do openvswitch. + +Ten pakiet zawiera moduł jądra Linuksa. + +%prep +%setup -q +cp %{SOURCE3} . + +%build +%configure \ + --with-linux=%{_kernelsrcdir} \ + --with-linux-source=%{_kernelsrcdir} + +%{__make} + +%if %{with kernel} +%endif +%if %{with userspace} +%endif +%install +rm -rf $RPM_BUILD_ROOT + +%if %{with userspace} +install -d $RPM_BUILD_ROOT{%{py_sitescriptdir},%{systemdunitdir},%{systemdtmpfilesdir}} \ + $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d,logrotate.d},/lib/rc-scripts} + +%{__make} install \ + DESTDIR=$RPM_BUILD_ROOT + +install -p %{SOURCE1} $RPM_BUILD_ROOT/lib/rc-scripts/ifdown-ovs +install -p %{SOURCE2} $RPM_BUILD_ROOT/lib/rc-scripts/ifup-ovs +install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/openvswitch +install -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/openvswitch.conf +install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/openvswitch +install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/openvswitch +install -p %{SOURCE10} $RPM_BUILD_ROOT%{systemdunitdir}/openvswitch.service + +%{__mv} $RPM_BUILD_ROOT%{_datadir}/%{name}/python/{ovs,ovstest} $RPM_BUILD_ROOT%{py_sitescriptdir} +%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/%{name}/python + +%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir} +%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir} +%endif + +%if %{with kernel} +cd datapath/linux +%install_kernel_modules -m brcompat_mod -d kernel/net/openvswitch +%install_kernel_modules -m openvswitch_mod -d kernel/net/openvswitch +%endif + +%clean +rm -rf $RPM_BUILD_ROOT + +%post +/sbin/chkconfig --add openvswitch +%service openvswitch restart +%systemd_post openvswitch.service + +%preun +if [ "$1" = "0" ]; then + %service -q openvswitch stop + /sbin/chkconfig --del openvswitch +fi +%systemd_preun openvswitch.service + +%postun +%systemd_reload + +%if %{with userspace} +%files +%defattr(644,root,root,755) +%doc README.PLD +%attr(755,root,root) /lib/rc-scripts/ifdown-ovs +%attr(755,root,root) /lib/rc-scripts/ifup-ovs +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/openvswitch +%{systemdtmpfilesdir}/openvswitch.conf +%{systemdunitdir}/openvswitch.service +%{_datadir}/%{name} + +%attr(754,root,root) /etc/rc.d/init.d/openvswitch +%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/openvswitch + +%attr(755,root,root) %{_bindir}/ovs-appctl +%attr(755,root,root) %{_bindir}/ovs-benchmark +%attr(755,root,root) %{_bindir}/ovs-controller +%attr(755,root,root) %{_bindir}/ovs-dpctl +%attr(755,root,root) %{_bindir}/ovs-ofctl +%attr(755,root,root) %{_bindir}/ovs-parse-leaks +%attr(755,root,root) %{_bindir}/ovs-pcap +%attr(755,root,root) %{_bindir}/ovs-pki +%attr(755,root,root) %{_bindir}/ovs-tcpundump +%attr(755,root,root) %{_bindir}/ovs-vlan-test +%attr(755,root,root) %{_bindir}/ovs-vsctl +%attr(755,root,root) %{_bindir}/ovsdb-client +%attr(755,root,root) %{_bindir}/ovsdb-tool +%attr(755,root,root) %{_sbindir}/ovs-brcompatd +%attr(755,root,root) %{_sbindir}/ovs-bugtool +%attr(755,root,root) %{_sbindir}/ovs-vlan-bug-workaround +%attr(755,root,root) %{_sbindir}/ovs-vswitchd +%attr(755,root,root) %{_sbindir}/ovsdb-server +%{_mandir}/man1/ovs-benchmark.1* +%{_mandir}/man1/ovs-pcap.1* +%{_mandir}/man1/ovs-tcpundump.1* +%{_mandir}/man1/ovsdb-client.1* +%{_mandir}/man1/ovsdb-server.1* +%{_mandir}/man1/ovsdb-tool.1* +%{_mandir}/man5/ovs-vswitchd.conf.db.5* +%{_mandir}/man8/ovs-appctl.8* +%{_mandir}/man8/ovs-brcompatd.8* +%{_mandir}/man8/ovs-bugtool.8* +%{_mandir}/man8/ovs-controller.8* +%{_mandir}/man8/ovs-ctl.8* +%{_mandir}/man8/ovs-dpctl.8* +%{_mandir}/man8/ovs-ofctl.8* +%{_mandir}/man8/ovs-parse-leaks.8* +%{_mandir}/man8/ovs-pki.8* +%{_mandir}/man8/ovs-vlan-bug-workaround.8* +%{_mandir}/man8/ovs-vlan-test.8* +%{_mandir}/man8/ovs-vsctl.8* +%{_mandir}/man8/ovs-vswitchd.8* <<Diff was trimmed, longer than 597 lines>> _______________________________________________ pld-cvs-commit mailing list [email protected] http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit
