public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH ifupdown2 0/3] update to last master + fixes
@ 2020-09-21 16:51 Alexandre Derumier
  2020-09-21 16:51 ` [pve-devel] [PATCH ifupdown2 1/3] remove patch 0009-address-don-t-process_mtu-if-ovs-mtu-is-defined.patch Alexandre Derumier
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Alexandre Derumier @ 2020-09-21 16:51 UTC (permalink / raw)
  To: pve-devel

Hi,

can you update the ifupdown2 mirror to last master ?

I have reworked the postinst/preinst to only generate /etc/network/interfaces.new
at first install of ifupdown2 only. 

I have added a small patch to allow vlan inside vxlan tunnel,
and removed an old ovs patch now upstream.


Alexandre Derumier (3):
  remove patch
    0009-address-don-t-process_mtu-if-ovs-mtu-is-defined.patch
  patch: allow vlan tag inside vxlan tunnel
  update patch10: only rewrite config on first ifupdown2

 ...-t-process_mtu-if-ovs-mtu-is-defined.patch | 32 -------------
 ...9-allow-vlan-tag-inside-vxlan-tunnel.patch | 31 ++++++++++++
 ...-update-network-config-compatibility.patch | 47 +++++++++++++++----
 debian/patches/series                         |  2 +-
 4 files changed, 71 insertions(+), 41 deletions(-)
 delete mode 100644 debian/patches/pve/0009-address-don-t-process_mtu-if-ovs-mtu-is-defined.patch
 create mode 100644 debian/patches/pve/0009-allow-vlan-tag-inside-vxlan-tunnel.patch

-- 
2.20.1




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH ifupdown2 1/3] remove patch 0009-address-don-t-process_mtu-if-ovs-mtu-is-defined.patch
  2020-09-21 16:51 [pve-devel] [PATCH ifupdown2 0/3] update to last master + fixes Alexandre Derumier
@ 2020-09-21 16:51 ` Alexandre Derumier
  2020-09-21 16:51 ` [pve-devel] [PATCH ifupdown2 2/3] patch: allow vlan tag inside vxlan tunnel Alexandre Derumier
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Alexandre Derumier @ 2020-09-21 16:51 UTC (permalink / raw)
  To: pve-devel

upstream : https://github.com/CumulusNetworks/ifupdown2/commit/8994bdd39af6014c6de02cb0d9eb15535af2123e#diff-1481ea1b5d4c5d73242f448fc8412b21
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 ...-t-process_mtu-if-ovs-mtu-is-defined.patch | 32 -------------------
 debian/patches/series                         |  1 -
 2 files changed, 33 deletions(-)
 delete mode 100644 debian/patches/pve/0009-address-don-t-process_mtu-if-ovs-mtu-is-defined.patch

diff --git a/debian/patches/pve/0009-address-don-t-process_mtu-if-ovs-mtu-is-defined.patch b/debian/patches/pve/0009-address-don-t-process_mtu-if-ovs-mtu-is-defined.patch
deleted file mode 100644
index d12a6ed..0000000
--- a/debian/patches/pve/0009-address-don-t-process_mtu-if-ovs-mtu-is-defined.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 54dbee161aa2fd281046386c10123222b790ebfc Mon Sep 17 00:00:00 2001
-From: Alexandre Derumier <aderumier@odiso.com>
-Date: Wed, 3 Jun 2020 13:06:14 +0200
-Subject: [PATCH] address: don't process_mtu if ovs-mtu is defined
-
-Openvswitch already manage mtu if ovs-mtu is defined.
-(Ovs manage mtu in userland, and sync mtu for some interfaces in kernel).
-
-Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
----
- ifupdown2/addons/address.py | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/ifupdown2/addons/address.py b/ifupdown2/addons/address.py
-index 6578ebb..9a20c9e 100644
---- a/ifupdown2/addons/address.py
-+++ b/ifupdown2/addons/address.py
-@@ -881,6 +881,11 @@ class address(Addon, moduleBase):
- 
-     def process_mtu(self, ifaceobj, ifaceobj_getfunc):
-         mtu_str = ifaceobj.get_attr_value_first('mtu')
-+
-+        ovs_mtu = ifaceobj.get_attr_value_first('ovs-mtu')
-+        if ovs_mtu:
-+            return
-+
-         mtu_from_policy = False
- 
-         if not mtu_str:
--- 
-2.20.1
-
diff --git a/debian/patches/series b/debian/patches/series
index b454408..a83e94e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,5 +6,4 @@ pve/0005-ifreload-down-up-vxlan-interfaces-when-ifreload_down.patch
 pve/0006-config-tuning.patch
 pve/0007-networking.service-fix-dependencies-and-ordering.patch
 pve/0008-openvswitch-ovs-ports-condone-regex-exclude-tap-veth.patch
-pve/0009-address-don-t-process_mtu-if-ovs-mtu-is-defined.patch
 pve/0010-postinst-rm-update-network-config-compatibility.patch
-- 
2.20.1




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH ifupdown2 2/3] patch: allow vlan tag inside vxlan tunnel
  2020-09-21 16:51 [pve-devel] [PATCH ifupdown2 0/3] update to last master + fixes Alexandre Derumier
  2020-09-21 16:51 ` [pve-devel] [PATCH ifupdown2 1/3] remove patch 0009-address-don-t-process_mtu-if-ovs-mtu-is-defined.patch Alexandre Derumier
@ 2020-09-21 16:51 ` Alexandre Derumier
  2020-09-21 16:51 ` [pve-devel] [PATCH ifupdown2 3/3] update patch10: only rewrite config on first ifupdown2 Alexandre Derumier
  2020-09-25  7:30 ` [pve-devel] applied: [PATCH ifupdown2 0/3] update to last master + fixes Thomas Lamprecht
  3 siblings, 0 replies; 5+ messages in thread
From: Alexandre Derumier @ 2020-09-21 16:51 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 ...9-allow-vlan-tag-inside-vxlan-tunnel.patch | 31 +++++++++++++++++++
 debian/patches/series                         |  1 +
 2 files changed, 32 insertions(+)
 create mode 100644 debian/patches/pve/0009-allow-vlan-tag-inside-vxlan-tunnel.patch

diff --git a/debian/patches/pve/0009-allow-vlan-tag-inside-vxlan-tunnel.patch b/debian/patches/pve/0009-allow-vlan-tag-inside-vxlan-tunnel.patch
new file mode 100644
index 0000000..7d0cecd
--- /dev/null
+++ b/debian/patches/pve/0009-allow-vlan-tag-inside-vxlan-tunnel.patch
@@ -0,0 +1,31 @@
+From a53022b71d98abf1cc34bf380309853fbb18b443 Mon Sep 17 00:00:00 2001
+From: Alexandre Derumier <aderumier@odiso.com>
+Date: Mon, 21 Sep 2020 08:47:25 +0200
+Subject: [PATCH] allow vlan tag inside vxlan tunnel
+
+Cumulus forbid it, but it's totally valid.
+
+Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
+---
+ ifupdown2/addons/bridge.py | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/ifupdown2/addons/bridge.py b/ifupdown2/addons/bridge.py
+index 2b9ea84..b835ac2 100644
+--- a/ifupdown2/addons/bridge.py
++++ b/ifupdown2/addons/bridge.py
+@@ -1557,11 +1557,6 @@ class bridge(Addon, moduleBase):
+             because kernel does honor vid info flags during deletes.
+ 
+         """
+-        if not isbridge and (bportifaceobj.link_kind & ifaceLinkKind.VXLAN and not bportifaceobj.link_privflags & ifaceLinkPrivFlags.SINGLE_VXLAN):
+-            if not vids or not pvid or len(vids) > 1 or vids[0] != pvid:
+-                self._error_vxlan_in_vlan_aware_br(bportifaceobj,
+-                                                   bportifaceobj.upperifaces[0])
+-                return
+ 
+         vids_int =  self._ranges_to_ints(vids)
+         try:
+-- 
+2.20.1
+
diff --git a/debian/patches/series b/debian/patches/series
index a83e94e..1bea610 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,4 +6,5 @@ pve/0005-ifreload-down-up-vxlan-interfaces-when-ifreload_down.patch
 pve/0006-config-tuning.patch
 pve/0007-networking.service-fix-dependencies-and-ordering.patch
 pve/0008-openvswitch-ovs-ports-condone-regex-exclude-tap-veth.patch
+pve/0009-allow-vlan-tag-inside-vxlan-tunnel.patch
 pve/0010-postinst-rm-update-network-config-compatibility.patch
-- 
2.20.1




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH ifupdown2 3/3] update patch10: only rewrite config on first ifupdown2
  2020-09-21 16:51 [pve-devel] [PATCH ifupdown2 0/3] update to last master + fixes Alexandre Derumier
  2020-09-21 16:51 ` [pve-devel] [PATCH ifupdown2 1/3] remove patch 0009-address-don-t-process_mtu-if-ovs-mtu-is-defined.patch Alexandre Derumier
  2020-09-21 16:51 ` [pve-devel] [PATCH ifupdown2 2/3] patch: allow vlan tag inside vxlan tunnel Alexandre Derumier
@ 2020-09-21 16:51 ` Alexandre Derumier
  2020-09-25  7:30 ` [pve-devel] applied: [PATCH ifupdown2 0/3] update to last master + fixes Thomas Lamprecht
  3 siblings, 0 replies; 5+ messages in thread
From: Alexandre Derumier @ 2020-09-21 16:51 UTC (permalink / raw)
  To: pve-devel

we don't want to update config at each upgrade.

postinst can't detect upgrade vs install, it need to be done in preinst.

so I create a tmp file in preinst for first install, and detect this file
in postinst.
(as we need to have ifupdown2 installed first, to have the config rewrite working)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 ...-update-network-config-compatibility.patch | 47 +++++++++++++++----
 1 file changed, 39 insertions(+), 8 deletions(-)

diff --git a/debian/patches/pve/0010-postinst-rm-update-network-config-compatibility.patch b/debian/patches/pve/0010-postinst-rm-update-network-config-compatibility.patch
index ad7c662..226728f 100644
--- a/debian/patches/pve/0010-postinst-rm-update-network-config-compatibility.patch
+++ b/debian/patches/pve/0010-postinst-rm-update-network-config-compatibility.patch
@@ -1,16 +1,18 @@
-From e93b858e2c6d46f3c7166f8b980518457e7f2e65 Mon Sep 17 00:00:00 2001
+From 723bfd8e3ed7a6140a411260a4881ed886efc829 Mon Sep 17 00:00:00 2001
 From: Alexandre Derumier <aderumier@odiso.com>
 Date: Fri, 21 Feb 2020 10:01:59 +0100
 Subject: [PATCH] postinst/rm : update network config compatibility
 
 Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
 ---
- debian/ifupdown2.postinst | 19 +++++++++++++++++++
- debian/ifupdown2.postrm   | 19 +++++++++++++++++++
- 2 files changed, 38 insertions(+)
+ debian/ifupdown2.postinst | 23 +++++++++++++++++++++++
+ debian/ifupdown2.postrm   | 20 ++++++++++++++++++++
+ debian/ifupdown2.preinst  | 20 ++++++++++++++++++++
+ 3 files changed, 63 insertions(+)
+ create mode 100644 debian/ifupdown2.preinst
 
 diff --git a/debian/ifupdown2.postinst b/debian/ifupdown2.postinst
-index 3689256..4b628e1 100644
+index 3689256..5162109 100644
 --- a/debian/ifupdown2.postinst
 +++ b/debian/ifupdown2.postinst
 @@ -85,6 +85,25 @@ postinst_remove_diverts()
@@ -39,16 +41,19 @@ index 3689256..4b628e1 100644
  case "$1" in
      configure)
          fix_dhclient_file_with_space
-@@ -92,6 +110,7 @@ case "$1" in
+@@ -92,6 +111,10 @@ case "$1" in
          process_udev
          chmod +x /usr/share/ifupdown2/__main__.py
          postinst_remove_diverts
-+        proxmox_compatibility
++        if [ -f "/tmp/.ifupdown2-first-install" ]; then
++            proxmox_compatibility
++            rm  /tmp/.ifupdown2-first-install
++        fi
      ;;
  
      abort-upgrade|abort-remove|abort-deconfigure)
 diff --git a/debian/ifupdown2.postrm b/debian/ifupdown2.postrm
-index 5d90b21..bab3dd0 100644
+index 5d90b21..fd62294 100644
 --- a/debian/ifupdown2.postrm
 +++ b/debian/ifupdown2.postrm
 @@ -25,10 +25,30 @@ process_udev()
@@ -82,6 +87,32 @@ index 5d90b21..bab3dd0 100644
      ;;
  
      upgrade|failed-upgrade|abort-upgrade|disappear)
+diff --git a/debian/ifupdown2.preinst b/debian/ifupdown2.preinst
+new file mode 100644
+index 0000000..aa8653e
+--- /dev/null
++++ b/debian/ifupdown2.preinst
+@@ -0,0 +1,20 @@
++#!/bin/sh
++set -e
++
++case "$1" in
++    install)
++        touch /tmp/.ifupdown2-first-install
++        ;;
++
++    upgrade|abort-upgrade)
++        ;;
++
++    *)
++        echo "postinst called with unknown argument \`$1'" >&2
++        exit 0
++        ;;
++esac
++
++#DEBHELPER#
++
++exit 0
 -- 
 2.20.1
 
-- 
2.20.1




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] applied: [PATCH ifupdown2 0/3] update to last master + fixes
  2020-09-21 16:51 [pve-devel] [PATCH ifupdown2 0/3] update to last master + fixes Alexandre Derumier
                   ` (2 preceding siblings ...)
  2020-09-21 16:51 ` [pve-devel] [PATCH ifupdown2 3/3] update patch10: only rewrite config on first ifupdown2 Alexandre Derumier
@ 2020-09-25  7:30 ` Thomas Lamprecht
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Lamprecht @ 2020-09-25  7:30 UTC (permalink / raw)
  To: Proxmox VE development discussion, Alexandre Derumier

Hi,

On 21.09.20 18:51, Alexandre Derumier wrote:
> can you update the ifupdown2 mirror to last master ?> 
> I have reworked the postinst/preinst to only generate /etc/network/interfaces.new
> at first install of ifupdown2 only. 
> 
> I have added a small patch to allow vlan inside vxlan tunnel,
> and removed an old ovs patch now upstream.

applied series and update to current master, thanks!




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-25  7:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-21 16:51 [pve-devel] [PATCH ifupdown2 0/3] update to last master + fixes Alexandre Derumier
2020-09-21 16:51 ` [pve-devel] [PATCH ifupdown2 1/3] remove patch 0009-address-don-t-process_mtu-if-ovs-mtu-is-defined.patch Alexandre Derumier
2020-09-21 16:51 ` [pve-devel] [PATCH ifupdown2 2/3] patch: allow vlan tag inside vxlan tunnel Alexandre Derumier
2020-09-21 16:51 ` [pve-devel] [PATCH ifupdown2 3/3] update patch10: only rewrite config on first ifupdown2 Alexandre Derumier
2020-09-25  7:30 ` [pve-devel] applied: [PATCH ifupdown2 0/3] update to last master + fixes Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal