mirror of
https://git.proxmox.com/git/ifupdown2
synced 2025-08-09 16:59:36 +00:00
patch : postinst/postrm : convert network config for compatibility
This commit is contained in:
parent
bf9a532c42
commit
849ae55de6
85
debian/patches/pve/0010-postinst-rm-update-network-config-compatibility.patch
vendored
Normal file
85
debian/patches/pve/0010-postinst-rm-update-network-config-compatibility.patch
vendored
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
From e93b858e2c6d46f3c7166f8b980518457e7f2e65 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(+)
|
||||||
|
|
||||||
|
diff --git a/debian/ifupdown2.postinst b/debian/ifupdown2.postinst
|
||||||
|
index 3689256..4b628e1 100644
|
||||||
|
--- a/debian/ifupdown2.postinst
|
||||||
|
+++ b/debian/ifupdown2.postinst
|
||||||
|
@@ -85,6 +85,24 @@ postinst_remove_diverts()
|
||||||
|
_postinst_remove_diverts "/usr/share/man/man5/interfaces.5.gz"
|
||||||
|
}
|
||||||
|
|
||||||
|
+proxmox_compatibility()
|
||||||
|
+{
|
||||||
|
+ perl -e '
|
||||||
|
+ use PVE::INotify;
|
||||||
|
+ my $config = PVE::INotify::read_file('interfaces', 1);
|
||||||
|
+ my $configdata = $config->{data};
|
||||||
|
+
|
||||||
|
+ PVE::INotify::write_file('interfaces', $configdata);
|
||||||
|
+
|
||||||
|
+ my $config = PVE::INotify::read_file('interfaces', 1);
|
||||||
|
+
|
||||||
|
+ if(defined($config->{changes})) {
|
||||||
|
+ print $config->{changes};
|
||||||
|
+ print "network config changes has been detected for ifupdown2 compatibility and generated in /etc/network/interfaces.new\n";
|
||||||
|
+ }
|
||||||
|
+ '
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
case "$1" in
|
||||||
|
configure)
|
||||||
|
fix_dhclient_file_with_space
|
||||||
|
@@ -92,6 +110,7 @@ case "$1" in
|
||||||
|
process_udev
|
||||||
|
chmod +x /usr/share/ifupdown2/__main__.py
|
||||||
|
postinst_remove_diverts
|
||||||
|
+ proxmox_compatibility
|
||||||
|
;;
|
||||||
|
|
||||||
|
abort-upgrade|abort-remove|abort-deconfigure)
|
||||||
|
diff --git a/debian/ifupdown2.postrm b/debian/ifupdown2.postrm
|
||||||
|
index 5d90b21..bab3dd0 100644
|
||||||
|
--- a/debian/ifupdown2.postrm
|
||||||
|
+++ b/debian/ifupdown2.postrm
|
||||||
|
@@ -25,10 +25,29 @@ process_udev()
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
+proxmox_compatibility()
|
||||||
|
+{
|
||||||
|
+ perl -e '
|
||||||
|
+ use PVE::INotify;
|
||||||
|
+ my $config = PVE::INotify::read_file('interfaces', 1);
|
||||||
|
+ my $configdata = $config->{data};
|
||||||
|
+
|
||||||
|
+ PVE::INotify::write_file('interfaces', $configdata);
|
||||||
|
+
|
||||||
|
+ my $config = PVE::INotify::read_file('interfaces', 1);
|
||||||
|
+
|
||||||
|
+ if(defined($config->{changes})) {
|
||||||
|
+ print $config->{changes};
|
||||||
|
+ print "network config changes has been detected for ifupdown1 compatibility and generated in /etc/network/interfaces.new\n";
|
||||||
|
+ }
|
||||||
|
+ '
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
case "$1" in
|
||||||
|
purge|remove|abort-install|disappear)
|
||||||
|
process_state_file
|
||||||
|
process_udev
|
||||||
|
+ proxmox_compatibility
|
||||||
|
;;
|
||||||
|
|
||||||
|
upgrade|failed-upgrade|abort-upgrade|disappear)
|
||||||
|
--
|
||||||
|
2.20.1
|
||||||
|
|
1
debian/patches/series
vendored
1
debian/patches/series
vendored
@ -9,3 +9,4 @@ pve/0006-config-tuning.patch
|
|||||||
pve/0007-networking.service-fix-dependencies-and-ordering.patch
|
pve/0007-networking.service-fix-dependencies-and-ordering.patch
|
||||||
pve/0008-add-openvswitch-addon.patch
|
pve/0008-add-openvswitch-addon.patch
|
||||||
pve/0009-networking.service-ifup-ifdown-allow-ovs-on-start-st.patch
|
pve/0009-networking.service-ifup-ifdown-allow-ovs-on-start-st.patch
|
||||||
|
pve/0010-postinst-rm-update-network-config-compatibility.patch
|
||||||
|
Loading…
Reference in New Issue
Block a user