]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
feat(network-manager): remove support for ifcfg-rh
authorJo Zzsi <jozzsicsataban@gmail.com>
Sat, 28 Jun 2025 17:41:28 +0000 (13:41 -0400)
committerLaszlo <laszlo.gombos@gmail.com>
Wed, 6 Aug 2025 10:17:23 +0000 (06:17 -0400)
This commit removes the dracut module for the NetworkManager fcfg-rh
plugin (`nm-fcfg-rh`), effectively discontinuing its support within dracut.

The `fcfg-rh` plugin for NetworkManager provides backward compatibility
with the legacy `ifcfg` network configuration format.
This format, traditionally found in `/etc/sysconfig/network-scripts/`,
was the standard method for configuring network interfaces on Red Hat-based
distributions for many years. It relies on a collection of shell-script-like
files to define network connections.

While functional for basic configurations, the `ifcfg` format has several
limitations in the context of modern networking and the capabilities of NetworkManager.

The removal of the `nm-fcfg-rh` support from dracut is a forward-looking change
that aligns with the broader trend in the Linux ecosystem to modernize network configuration.
The key reasons for this decision are as follows:

* **Deprecation by Upstream and Distributions:**
The `fcfg-rh` plugin is considered deprecated by the NetworkManager project
and major Linux distributions, such as Fedora and its derivatives.
These distributions are actively migrating users away from the legacy `ifcfg` format
in favor of the more robust `keyfile` format.

See https://networkmanager.dev/docs/api/latest/nm-settings-ifcfg-rh.html.

modules.d/35network-manager/module-setup.sh
modules.d/35network-manager/nm-initrd.service
modules.d/35network-manager/nm-lib.sh
modules.d/35network-manager/nm-run.sh

index 03a805750c93331db883d0843090083feb5ce7b6..c6e3fd2e01a59d622303109c794e2b04e34810a2 100755 (executable)
@@ -98,10 +98,6 @@ install() {
         echo "${UUID//-/}" > "$initdir/etc/machine-id"
     fi
 
-    # We don't install the ifcfg files from the host automatically.
-    # But the user might choose to include them, so we pull in the machinery to read them.
-    inst_libdir_file "NetworkManager/$_nm_version/libnm-settings-plugin-ifcfg-rh.so"
-
     _arch=${DRACUT_ARCH:-$(uname -m)}
 
     inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \
index dbd8caa74399c8496bd269f62d833935c5000c4c..88a7d5d521ef4adc07bfa391f2e5734847a9f645 100644 (file)
@@ -10,7 +10,6 @@ ConditionPathExists=/run/NetworkManager/initrd/neednet
 ConditionPathExistsGlob=|/usr/lib/NetworkManager/system-connections/*
 ConditionPathExistsGlob=|/run/NetworkManager/system-connections/*
 ConditionPathExistsGlob=|/etc/NetworkManager/system-connections/*
-ConditionPathExistsGlob=|/etc/sysconfig/network-scripts/ifcfg-*
 
 [Service]
 Type=dbus
index db63c3bbea7f41c3f8b439dd7c2bbae7c5f632b3..c33354963b2efc5841b271c4e4d061e770fda47b 100755 (executable)
@@ -20,8 +20,7 @@ nm_generate_connections() {
         if getargbool 0 rd.neednet; then
             for i in /usr/lib/NetworkManager/system-connections/* \
                 /run/NetworkManager/system-connections/* \
-                /etc/NetworkManager/system-connections/* \
-                /etc/sysconfig/network-scripts/ifcfg-*; do
+                /etc/NetworkManager/system-connections/*; do
                 [ -f "$i" ] || continue
                 echo '[ -f /tmp/nm.done ]' > "$hookdir"/initqueue/finished/nm.sh
                 mkdir -p /run/NetworkManager/initrd
index ef4db2e83b211fce870ab01c992372c5c76919cb..5d447fc39903c50bdf3809919863252f7d8a10c8 100755 (executable)
@@ -7,8 +7,7 @@ if [ -z "${DRACUT_SYSTEMD-}" ]; then
     if [ -e /run/NetworkManager/initrd/neednet ]; then
         for i in /usr/lib/NetworkManager/system-connections/* \
             /run/NetworkManager/system-connections/* \
-            /etc/NetworkManager/system-connections/* \
-            /etc/sysconfig/network-scripts/ifcfg-*; do
+            /etc/NetworkManager/system-connections/*; do
             [ -f "$i" ] || continue
             /usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon
             break