Drop ifcfg-rh support in RHEL10

Related: RHEL-24693
This commit is contained in:
Stanislas FAYE 2024-04-24 14:05:57 +02:00
parent 2d2f70f74f
commit 0a387cee26

View File

@ -153,13 +153,18 @@
%global config_plugins_default_ifcfg_rh 1 %global config_plugins_default_ifcfg_rh 1
%endif %endif
%if 0%{?fedora} >= 36 || 0%{?rhel} >= 10 %if 0%{?rhel} >= 10
%global with_ifcfg_rh 0
%global split_ifcfg_rh 0
%elif 0%{?fedora} >= 36
%global with_ifcfg_rh 1
%global split_ifcfg_rh 1 %global split_ifcfg_rh 1
%else %else
%global with_ifcfg_rh 1
%global split_ifcfg_rh 0 %global split_ifcfg_rh 0
%endif %endif
%if (0%{?fedora} >= 36 && 0%{?fedora} < 39) || 0%{?rhel} >= 9 %if (0%{?fedora} >= 36 && 0%{?fedora} < 39) || 0%{?rhel} == 9
%global ifcfg_warning 1 %global ifcfg_warning 1
%else %else
%global ifcfg_warning 0 %global ifcfg_warning 0
@ -533,6 +538,7 @@ This package is intended to be installed by default for server
deployments. deployments.
%if %{?with_ifcfg_rh}
%package dispatcher-routing-rules %package dispatcher-routing-rules
Summary: NetworkManager dispatcher file for advanced routing rules Summary: NetworkManager dispatcher file for advanced routing rules
Group: System Environment/Base Group: System Environment/Base
@ -547,6 +553,7 @@ Obsoletes: %{name}-config-routing-rules < 1:1.31.0
This adds a NetworkManager dispatcher file to support networking This adds a NetworkManager dispatcher file to support networking
configurations using "/etc/sysconfig/network-scripts/rule-NAME" files configurations using "/etc/sysconfig/network-scripts/rule-NAME" files
(eg, to do policy-based routing). (eg, to do policy-based routing).
%endif
%if %{with nmtui} %if %{with nmtui}
@ -590,6 +597,7 @@ like Aliyun, Azure, EC2, GCP are supported.
%endif %endif
%if %{?with_ifcfg_rh}
%package initscripts-updown %package initscripts-updown
Summary: Legacy ifup/ifdown scripts for NetworkManager that replace initscripts (network-scripts) Summary: Legacy ifup/ifdown scripts for NetworkManager that replace initscripts (network-scripts)
Group: System Environment/Base Group: System Environment/Base
@ -602,7 +610,7 @@ Obsoletes: NetworkManager < %{obsoletes_initscripts_updown}
Installs alternative ifup/ifdown scripts that talk to NetworkManager. Installs alternative ifup/ifdown scripts that talk to NetworkManager.
This is only for backward compatibility with initscripts (network-scripts). This is only for backward compatibility with initscripts (network-scripts).
Preferably use nmcli instead. Preferably use nmcli instead.
%endif
%prep %prep
%autosetup -p1 -n NetworkManager-%{real_version} %autosetup -p1 -n NetworkManager-%{real_version}
@ -716,7 +724,11 @@ Preferably use nmcli instead.
-Ddbus_conf_dir=%{dbus_sys_dir} \ -Ddbus_conf_dir=%{dbus_sys_dir} \
-Dtests=yes \ -Dtests=yes \
-Dvalgrind=no \ -Dvalgrind=no \
%if %{?with_ifcfg_rh}
-Difcfg_rh=true \ -Difcfg_rh=true \
%else
-Difcfg_rh=false \
%endif
-Difupdown=false \ -Difupdown=false \
%if %{with ppp} %if %{with ppp}
-Dppp=true \ -Dppp=true \
@ -864,7 +876,11 @@ autoreconf --install --force
--enable-more-warnings=yes \ --enable-more-warnings=yes \
%endif %endif
--with-valgrind=no \ --with-valgrind=no \
%if %{?with_ifcfg_rh}
--enable-ifcfg-rh=yes \ --enable-ifcfg-rh=yes \
%else
--enable-ifcfg-rh=no \
%endif
--enable-ifupdown=no \ --enable-ifupdown=no \
%if %{with ppp} %if %{with ppp}
--enable-ppp=yes \ --enable-ppp=yes \
@ -922,9 +938,11 @@ cp %{SOURCE7} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts
cp %{SOURCE8} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/readme-ifcfg-rh.txt cp %{SOURCE8} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/readme-ifcfg-rh.txt
%endif %endif
%if %{?with_ifcfg_rh}
cp examples/dispatcher/10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/ cp examples/dispatcher/10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/
ln -s ../no-wait.d/10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/pre-up.d/ ln -s ../no-wait.d/10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/pre-up.d/
ln -s ../10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/no-wait.d/ ln -s ../10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/no-wait.d/
%endif
%find_lang %{name} %find_lang %{name}
@ -940,9 +958,10 @@ mkdir -p %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version}
cp valgrind.suppressions %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version} cp valgrind.suppressions %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version}
%endif %endif
%if %{?with_ifcfg_rh}
touch %{buildroot}%{_sbindir}/ifup touch %{buildroot}%{_sbindir}/ifup
touch %{buildroot}%{_sbindir}/ifdown touch %{buildroot}%{_sbindir}/ifdown
%endif
%check %check
%if %{with meson} %if %{with meson}
@ -985,6 +1004,7 @@ fi
%systemd_post %{systemd_units} %systemd_post %{systemd_units}
%if %{?with_ifcfg_rh}
%post initscripts-updown %post initscripts-updown
if [ -f %{_sbindir}/ifup -a ! -L %{_sbindir}/ifup ]; then if [ -f %{_sbindir}/ifup -a ! -L %{_sbindir}/ifup ]; then
# initscripts package too old, won't let us set an alternative # initscripts package too old, won't let us set an alternative
@ -993,6 +1013,7 @@ else
/usr/sbin/update-alternatives --install %{_sbindir}/ifup ifup %{_libexecdir}/nm-ifup 50 \ /usr/sbin/update-alternatives --install %{_sbindir}/ifup ifup %{_libexecdir}/nm-ifup 50 \
--slave %{_sbindir}/ifdown ifdown %{_libexecdir}/nm-ifdown --slave %{_sbindir}/ifdown ifdown %{_libexecdir}/nm-ifdown
fi fi
%endif
%if %{with nm_cloud_setup} %if %{with nm_cloud_setup}
@ -1012,10 +1033,12 @@ fi
%systemd_preun NetworkManager-wait-online.service NetworkManager-dispatcher.service nm-priv-helper.service %systemd_preun NetworkManager-wait-online.service NetworkManager-dispatcher.service nm-priv-helper.service
%if %{?with_ifcfg_rh}
%preun initscripts-updown %preun initscripts-updown
if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
/usr/sbin/update-alternatives --remove ifup %{_libexecdir}/nm-ifup >/dev/null 2>&1 || : /usr/sbin/update-alternatives --remove ifup %{_libexecdir}/nm-ifup >/dev/null 2>&1 || :
fi fi
%endif
%if %{with nm_cloud_setup} %if %{with nm_cloud_setup}
@ -1050,7 +1073,7 @@ fi
%{dbus_sys_dir}/org.freedesktop.NetworkManager.conf %{dbus_sys_dir}/org.freedesktop.NetworkManager.conf
%{dbus_sys_dir}/nm-dispatcher.conf %{dbus_sys_dir}/nm-dispatcher.conf
%{dbus_sys_dir}/nm-priv-helper.conf %{dbus_sys_dir}/nm-priv-helper.conf
%if 0%{?split_ifcfg_rh} == 0 %if %{?with_ifcfg_rh} && 0%{?split_ifcfg_rh} == 0
%{dbus_sys_dir}/nm-ifcfg-rh.conf %{dbus_sys_dir}/nm-ifcfg-rh.conf
%endif %endif
%{_sbindir}/%{name} %{_sbindir}/%{name}
@ -1075,7 +1098,7 @@ fi
%{_libexecdir}/nm-priv-helper %{_libexecdir}/nm-priv-helper
%dir %{_libdir}/%{name} %dir %{_libdir}/%{name}
%dir %{nmplugindir} %dir %{nmplugindir}
%if 0%{?split_ifcfg_rh} == 0 %if %{?with_ifcfg_rh} && 0%{?split_ifcfg_rh} == 0
%{nmplugindir}/libnm-settings-plugin-ifcfg-rh.so %{nmplugindir}/libnm-settings-plugin-ifcfg-rh.so
%endif %endif
%if %{with nmtui} %if %{with nmtui}
@ -1097,7 +1120,9 @@ fi
%{_mandir}/man8/NetworkManager-dispatcher.8* %{_mandir}/man8/NetworkManager-dispatcher.8*
%{_mandir}/man8/NetworkManager-wait-online.service.8* %{_mandir}/man8/NetworkManager-wait-online.service.8*
%dir %{_localstatedir}/lib/NetworkManager %dir %{_localstatedir}/lib/NetworkManager
%if %{?with_ifcfg_rh}
%dir %{_sysconfdir}/sysconfig/network-scripts %dir %{_sysconfdir}/sysconfig/network-scripts
%endif
%{_datadir}/dbus-1/system-services/org.freedesktop.nm_dispatcher.service %{_datadir}/dbus-1/system-services/org.freedesktop.nm_dispatcher.service
%{_datadir}/dbus-1/system-services/org.freedesktop.nm_priv_helper.service %{_datadir}/dbus-1/system-services/org.freedesktop.nm_priv_helper.service
%{_datadir}/polkit-1/actions/*.policy %{_datadir}/polkit-1/actions/*.policy
@ -1212,11 +1237,12 @@ fi
%{nmlibdir}/conf.d/00-server.conf %{nmlibdir}/conf.d/00-server.conf
%if %{?with_ifcfg_rh}
%files dispatcher-routing-rules %files dispatcher-routing-rules
%{nmlibdir}/dispatcher.d/10-ifcfg-rh-routes.sh %{nmlibdir}/dispatcher.d/10-ifcfg-rh-routes.sh
%{nmlibdir}/dispatcher.d/no-wait.d/10-ifcfg-rh-routes.sh %{nmlibdir}/dispatcher.d/no-wait.d/10-ifcfg-rh-routes.sh
%{nmlibdir}/dispatcher.d/pre-up.d/10-ifcfg-rh-routes.sh %{nmlibdir}/dispatcher.d/pre-up.d/10-ifcfg-rh-routes.sh
%endif
%if %{with nmtui} %if %{with nmtui}
%files tui %files tui
@ -1247,14 +1273,19 @@ fi
%endif %endif
%if %{?with_ifcfg_rh}
%files initscripts-updown %files initscripts-updown
%{_libexecdir}/nm-ifup %{_libexecdir}/nm-ifup
%ghost %attr(755, root, root) %{_sbindir}/ifup %ghost %attr(755, root, root) %{_sbindir}/ifup
%{_libexecdir}/nm-ifdown %{_libexecdir}/nm-ifdown
%ghost %attr(755, root, root) %{_sbindir}/ifdown %ghost %attr(755, root, root) %{_sbindir}/ifdown
%endif
%changelog %changelog
* Tue Apr 24 2024 Stanislas Faye <sfaye@redhat.com> - 1:1.47.5-2
- Disable deprecated features (team, ifcfg-rh) on future RHEL versions
* Fri Apr 10 2024 Íñigo Huguet <ihuguet@redhat.com> - 1:1.47.4-1 * Fri Apr 10 2024 Íñigo Huguet <ihuguet@redhat.com> - 1:1.47.4-1
- Upgrade to 1.47.5 (development) - Upgrade to 1.47.5 (development)