From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 31275633BB for ; Mon, 21 Sep 2020 18:51:25 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2CD452772F for ; Mon, 21 Sep 2020 18:51:25 +0200 (CEST) Received: from kvmformation1.odiso.net (globalOdiso.M6Lille.odiso.net [89.248.211.242]) by firstgate.proxmox.com (Proxmox) with ESMTP id EFD9C27707 for ; Mon, 21 Sep 2020 18:51:22 +0200 (CEST) Received: by kvmformation1.odiso.net (Postfix, from userid 0) id 87E65D5269; Mon, 21 Sep 2020 18:51:16 +0200 (CEST) From: Alexandre Derumier To: pve-devel@lists.proxmox.com Date: Mon, 21 Sep 2020 18:51:15 +0200 Message-Id: <20200921165115.2930386-4-aderumier@odiso.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200921165115.2930386-1-aderumier@odiso.com> References: <20200921165115.2930386-1-aderumier@odiso.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 1 AWL -1.166 Adjusted score from AWL reputation of From: address HEADER_FROM_DIFFERENT_DOMAINS 0.249 From and EnvelopeFrom 2nd level mail domains are different KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods KAM_NUMSUBJECT 0.5 Subject ends in numbers excluding current years KHOP_HELO_FCRDNS 0.4 Relay HELO differs from its IP's reverse DNS NO_DNS_FOR_FROM 0.379 Envelope sender has no MX or A DNS records SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Subject: [pve-devel] [PATCH ifupdown2 3/3] update patch10: only rewrite config on first ifupdown2 X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2020 16:51:25 -0000 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 --- ...-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 Date: Fri, 21 Feb 2020 10:01:59 +0100 Subject: [PATCH] postinst/rm : update network config compatibility Signed-off-by: Alexandre Derumier --- - 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