[neon/extras/calamares/Neon/release] debian/patches: emergency patch to revert change which causes crash https://github.com/calamares/calamares/issues/2294

Jonathan Riddell null at kde.org
Tue Feb 27 19:21:36 GMT 2024


Git commit c26edd0d50827ff3204b396cc0bd6043fe2d9a8a by Jonathan Riddell.
Committed on 27/02/2024 at 19:21.
Pushed by jriddell into branch 'Neon/release'.

emergency patch to revert change which causes crash https://github.com/calamares/calamares/issues/2294

A  +45   -0    debian/patches/network-config.diff
A  +45   -0    debian/patches/series

https://invent.kde.org/neon/extras/calamares/-/commit/c26edd0d50827ff3204b396cc0bd6043fe2d9a8a

diff --git a/debian/patches/network-config.diff b/debian/patches/network-config.diff
new file mode 100644
index 0000000..ff687ab
--- /dev/null
+++ b/debian/patches/network-config.diff
@@ -0,0 +1,45 @@
+commit 562cae387c73b4818c36aff7a956e70b6bd4c4af
+Author: Lukas Märdian <slyon at ubuntu.com>
+Date:   Tue Feb 13 16:13:29 2024 +0100
+
+    networkcfg: Configure NetworkManager to be the default renderer
+    
+    When Netplan is installed in the target system:
+    In case NM is not yet set to be the default Netplan renderer (e.g. through a
+    /usr/lib/netplan/00-network-manager-all.yaml file shipped by an installed
+    package), create the /etc/netplan/01-network-manager-all.yaml configuration
+    and copy over all other Netplan configuration from the installer system.
+
+diff --git b/src/modules/networkcfg/main.py a/src/modules/networkcfg/main.py
+index 9c8965f85..ed130c33a 100644
+--- b/src/modules/networkcfg/main.py
++++ a/src/modules/networkcfg/main.py
+@@ -138,27 +138,7 @@ def run():
+     target_netplan = os.path.join(root_mount_point, source_netplan.lstrip('/'))
+ 
+     if os.path.exists(source_netplan) and os.path.exists(target_netplan):
+-        # Set NetworkManager to be the default renderer if Netplan is installed
+-        # TODO: We might rather do that inside the network-manager package, see:
+-        # https://bugs.launchpad.net/ubuntu/+source/ubuntu-settings/+bug/2020110
+-        default_renderer = os.path.join(root_mount_point, "usr/lib/netplan",
+-                                        "00-network-manager-all.yaml")
+-        if not os.path.exists(default_renderer):
+-            renderer_file = os.path.join(target_netplan,
+-                                         "01-network-manager-all.yaml")
+-            nm_renderer = """# This file was written by calamares.
+-# Let NetworkManager manage all devices on this system.
+-# For more information, see netplan(5).
+-network:
+-  version: 2
+-  renderer: NetworkManager
+-"""
+-            with open(renderer_file, 'w') as f:
+-                f.writelines(nm_renderer)
+-                os.chmod(f, 0o600)
+-
+-        # Copy existing Netplan configuration
+-        for cfg in glob.glob(os.path.join(source_netplan, "*.yaml")):
++        for cfg in glob.glob(os.path.join(source_netplan, "90-NM-*")):
+             source_cfg = os.path.join(source_netplan, cfg)
+             target_cfg = os.path.join(target_netplan, os.path.basename(cfg))
+ 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..ff687ab
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,45 @@
+commit 562cae387c73b4818c36aff7a956e70b6bd4c4af
+Author: Lukas Märdian <slyon at ubuntu.com>
+Date:   Tue Feb 13 16:13:29 2024 +0100
+
+    networkcfg: Configure NetworkManager to be the default renderer
+    
+    When Netplan is installed in the target system:
+    In case NM is not yet set to be the default Netplan renderer (e.g. through a
+    /usr/lib/netplan/00-network-manager-all.yaml file shipped by an installed
+    package), create the /etc/netplan/01-network-manager-all.yaml configuration
+    and copy over all other Netplan configuration from the installer system.
+
+diff --git b/src/modules/networkcfg/main.py a/src/modules/networkcfg/main.py
+index 9c8965f85..ed130c33a 100644
+--- b/src/modules/networkcfg/main.py
++++ a/src/modules/networkcfg/main.py
+@@ -138,27 +138,7 @@ def run():
+     target_netplan = os.path.join(root_mount_point, source_netplan.lstrip('/'))
+ 
+     if os.path.exists(source_netplan) and os.path.exists(target_netplan):
+-        # Set NetworkManager to be the default renderer if Netplan is installed
+-        # TODO: We might rather do that inside the network-manager package, see:
+-        # https://bugs.launchpad.net/ubuntu/+source/ubuntu-settings/+bug/2020110
+-        default_renderer = os.path.join(root_mount_point, "usr/lib/netplan",
+-                                        "00-network-manager-all.yaml")
+-        if not os.path.exists(default_renderer):
+-            renderer_file = os.path.join(target_netplan,
+-                                         "01-network-manager-all.yaml")
+-            nm_renderer = """# This file was written by calamares.
+-# Let NetworkManager manage all devices on this system.
+-# For more information, see netplan(5).
+-network:
+-  version: 2
+-  renderer: NetworkManager
+-"""
+-            with open(renderer_file, 'w') as f:
+-                f.writelines(nm_renderer)
+-                os.chmod(f, 0o600)
+-
+-        # Copy existing Netplan configuration
+-        for cfg in glob.glob(os.path.join(source_netplan, "*.yaml")):
++        for cfg in glob.glob(os.path.join(source_netplan, "90-NM-*")):
+             source_cfg = os.path.join(source_netplan, cfg)
+             target_cfg = os.path.join(target_netplan, os.path.basename(cfg))
+ 


More information about the Neon-commits mailing list