git.iko.soy/typeable/nixpkgs
on master help sign in
openvswitch: 2.5.4 -> 2.12.0

Openvswitch was upgraded to the latest stable version (currenty 2.12.0). This remove ovs-monitor-ipsec commands. LTS version is still available using `config.virtualisation.vswitch.package = pkgs.openvswitch-lts` it has been upgraded to 2.5.6. This commit is a split from the original PR #35127.

commite8e980e0e77a3c0e8398e9c009c27558e0ba22b3 authorNetix (Espinet François) <dev.espinetfrancois@gmail.com> dateSat 29 Dec 2018, 11:10 (8 years ago) parent7d5375e
4 files changed+97−21
nixos/modules/virtualisation/openvswitch.nix+11−2 pkgs/os-specific/linux/openvswitch/default.nix+7−19 pkgs/os-specific/linux/openvswitch/lts.nix+77 pkgs/top-level/all-packages.nix+2
nixos/modules/virtualisation/openvswitch.nix+11−2
@@ -42,6 +42,9 @@ in {
4242 default = false;
4343 description = ''
4444 Whether to start racoon service for openvswitch.
45+ Supported only if openvswitch version is less than 2.6.0.
46+ Use <literal>virtualisation.vswitch.package = pkgs.openvswitch-lts</literal>
47+ for a version that supports ipsec over GRE.
4548 '';
4649 };
4750 };
@@ -89,6 +92,13 @@ in {
8992 "${cfg.package}/share/openvswitch/vswitch.ovsschema"
9093 fi
9194 chmod -R +w /var/db/openvswitch
95+ if ${cfg.package}/bin/ovsdb-tool needs-conversion /var/db/openvswitch/conf.db | grep -q "yes"
96+ then
97+ echo "Performing database upgrade"
98+ ${cfg.package}/bin/ovsdb-tool convert /var/db/openvswitch/conf.db
99+ else
100+ echo "Database already up to date"
101+ fi
92102 '';
93103 serviceConfig = {
94104 ExecStart =
@@ -133,7 +143,7 @@ in {
133143 };
134144
135145 }
136− (mkIf cfg.ipsec {
146+ (mkIf (cfg.ipsec && (versionOlder cfg.package.version "2.6.0")) {
137147 services.racoon.enable = true;
138148 services.racoon.configPath = "${runDir}/ipsec/etc/racoon/racoon.conf";
139149
@@ -172,5 +182,4 @@ in {
172182 '';
173183 };
174184 })]));
175−
176185}
pkgs/os-specific/linux/openvswitch/default.nix+7−19
@@ -6,19 +6,20 @@ with stdenv.lib;
66
77let
88 _kernel = kernel;
9+ python = python27.withPackages (ps: with ps; [ six ]);
910in stdenv.mkDerivation rec {
10− version = "2.5.4";
11+ version = "2.12.0";
1112 pname = "openvswitch";
1213
1314 src = fetchurl {
1415 url = "http://openvswitch.org/releases/${pname}-${version}.tar.gz";
15− sha256 = "1lji87wg953lqcdf02f1zv2m54vhd2x9jd03bb91lnlb4qlhifiv";
16+ sha256 = "1y78ix5inhhcvicbvyy2ij38am1215nr55vydhab3d4065q45z8k";
1617 };
1718
1819 kernel = optional (_kernel != null) _kernel.dev;
1920
2021 nativeBuildInputs = [ pkgconfig ];
21− buildInputs = [ makeWrapper utillinux openssl libcap_ng python27
22+ buildInputs = [ makeWrapper utillinux openssl libcap_ng python
2223 perl procps which ];
2324
2425 configureFlags = [
@@ -36,27 +37,13 @@ in stdenv.mkDerivation rec {
3637
3738 postBuild = ''
3839 # fix tests
39− substituteInPlace xenserver/opt_xensource_libexec_interface-reconfigure --replace '/usr/bin/env python' '${python27.interpreter}'
40− substituteInPlace vtep/ovs-vtep --replace '/usr/bin/env python' '${python27.interpreter}'
40+ substituteInPlace xenserver/opt_xensource_libexec_interface-reconfigure --replace '/usr/bin/env python' '${python.interpreter}'
41+ substituteInPlace vtep/ovs-vtep --replace '/usr/bin/env python' '${python.interpreter}'
4142 '';
4243
4344 enableParallelBuilding = true;
4445 doCheck = false; # bash-completion test fails with "compgen: command not found"
4546
46− postInstall = ''
47− cp debian/ovs-monitor-ipsec $out/share/openvswitch/scripts
48− makeWrapper \
49− $out/share/openvswitch/scripts/ovs-monitor-ipsec \
50− $out/bin/ovs-monitor-ipsec \
51− --prefix PYTHONPATH : "$out/share/openvswitch/python"
52− substituteInPlace $out/share/openvswitch/scripts/ovs-monitor-ipsec \
53− --replace "UnixctlServer.create(None)" "UnixctlServer.create(os.environ['UNIXCTLPATH'])"
54− substituteInPlace $out/share/openvswitch/scripts/ovs-monitor-ipsec \
55− --replace "self.psk_file" "root_prefix + self.psk_file"
56− substituteInPlace $out/share/openvswitch/scripts/ovs-monitor-ipsec \
57− --replace "self.cert_dir" "root_prefix + self.cert_dir"
58− '';
59−
6047 meta = with stdenv.lib; {
6148 platforms = platforms.linux;
6249 description = "A multilayer virtual switch";
@@ -73,5 +60,6 @@ in stdenv.mkDerivation rec {
7360 '';
7461 homepage = http://openvswitch.org/;
7562 license = licenses.asl20;
63+ maintainers = [ maintainers.netixx ];
7664 };
7765}
pkgs/os-specific/linux/openvswitch/lts.nixnew file+77
@@ -0,0 +1,77 @@
1+{ stdenv, fetchurl, makeWrapper, pkgconfig, utillinux, which
2+, procps, libcap_ng, openssl, python27, iproute , perl
3+, kernel ? null }:
4+
5+with stdenv.lib;
6+
7+let
8+ _kernel = kernel;
9+in stdenv.mkDerivation rec {
10+ version = "2.5.6";
11+ pname = "openvswitch";
12+
13+ src = fetchurl {
14+ url = "http://openvswitch.org/releases/${pname}-${version}.tar.gz";
15+ sha256 = "14zjcd0ddjv90rwb24l3cac6psd34a9r04jjghn1av0kf6b76zj4";
16+ };
17+
18+ kernel = optional (_kernel != null) _kernel.dev;
19+
20+ nativeBuildInputs = [ pkgconfig ];
21+ buildInputs = [ makeWrapper utillinux openssl libcap_ng python27
22+ perl procps which ];
23+
24+ configureFlags = [
25+ "--localstatedir=/var"
26+ "--sharedstatedir=/var"
27+ "--sbindir=$(out)/bin"
28+ ] ++ (optionals (_kernel != null) ["--with-linux"]);
29+
30+ # Leave /var out of this!
31+ installFlags = [
32+ "LOGDIR=$(TMPDIR)/dummy"
33+ "RUNDIR=$(TMPDIR)/dummy"
34+ "PKIDIR=$(TMPDIR)/dummy"
35+ ];
36+
37+ postBuild = ''
38+ # fix tests
39+ substituteInPlace xenserver/opt_xensource_libexec_interface-reconfigure --replace '/usr/bin/env python' '${python27.interpreter}'
40+ substituteInPlace vtep/ovs-vtep --replace '/usr/bin/env python' '${python27.interpreter}'
41+ '';
42+
43+ enableParallelBuilding = true;
44+ doCheck = false; # bash-completion test fails with "compgen: command not found"
45+
46+ postInstall = ''
47+ cp debian/ovs-monitor-ipsec $out/share/openvswitch/scripts
48+ makeWrapper \
49+ $out/share/openvswitch/scripts/ovs-monitor-ipsec \
50+ $out/bin/ovs-monitor-ipsec \
51+ --prefix PYTHONPATH : "$out/share/openvswitch/python"
52+ substituteInPlace $out/share/openvswitch/scripts/ovs-monitor-ipsec \
53+ --replace "UnixctlServer.create(None)" "UnixctlServer.create(os.environ['UNIXCTLPATH'])"
54+ substituteInPlace $out/share/openvswitch/scripts/ovs-monitor-ipsec \
55+ --replace "self.psk_file" "root_prefix + self.psk_file"
56+ substituteInPlace $out/share/openvswitch/scripts/ovs-monitor-ipsec \
57+ --replace "self.cert_dir" "root_prefix + self.cert_dir"
58+ '';
59+
60+ meta = with stdenv.lib; {
61+ platforms = platforms.linux;
62+ description = "A multilayer virtual switch";
63+ longDescription =
64+ ''
65+ Open vSwitch is a production quality, multilayer virtual switch
66+ licensed under the open source Apache 2.0 license. It is
67+ designed to enable massive network automation through
68+ programmatic extension, while still supporting standard
69+ management interfaces and protocols (e.g. NetFlow, sFlow, SPAN,
70+ RSPAN, CLI, LACP, 802.1ag). In addition, it is designed to
71+ support distribution across multiple physical servers similar
72+ to VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V.
73+ '';
74+ homepage = http://openvswitch.org/;
75+ license = licenses.asl20;
76+ };
77+}
pkgs/top-level/all-packages.nix+2
@@ -5273,6 +5273,8 @@ in
52735273 openssl = openssl_1_0_2;
52745274 };
52755275
5276+ openvswitch-lts = callPackage ../os-specific/linux/openvswitch/lts.nix { };
5277+
52765278 optipng = callPackage ../tools/graphics/optipng {
52775279 libpng = libpng12;
52785280 };