rpm: include an informational file in ifcfg files directory

This commit is contained in:
Ana Cabral 2022-05-27 17:57:17 +02:00
parent 53393c4b58
commit 136952f729
2 changed files with 45 additions and 3 deletions

View File

@ -157,6 +157,12 @@
%global split_ifcfg_rh 0 %global split_ifcfg_rh 0
%endif %endif
%if 0%{?rhel} > 8 || 0%{?fedora} > 35
%global ifcfg_warning 1
%else
%global ifcfg_warning 0
%endif
%if 0%{?fedora} %if 0%{?fedora}
# Although eBPF would be available on Fedora's kernel, it seems # Although eBPF would be available on Fedora's kernel, it seems
# we often get SELinux denials (rh#1651654). But even aside them, # we often get SELinux denials (rh#1651654). But even aside them,
@ -190,6 +196,7 @@ Source2: 00-server.conf
Source4: 20-connectivity-fedora.conf Source4: 20-connectivity-fedora.conf
Source5: 20-connectivity-redhat.conf Source5: 20-connectivity-redhat.conf
Source6: 70-nm-connectivity.conf Source6: 70-nm-connectivity.conf
Source7: readme-ifcfg-rh.txt
#Patch1: 0001-some.patch #Patch1: 0001-some.patch
@ -891,6 +898,10 @@ mkdir -p %{buildroot}%{_sysctldir}
cp %{SOURCE6} %{buildroot}%{_sysctldir} cp %{SOURCE6} %{buildroot}%{_sysctldir}
%endif %endif
%if 0%{?ifcfg_warning}
cp %{SOURCE7} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts
%endif
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/
@ -1066,9 +1077,7 @@ fi
%{_mandir}/man8/NetworkManager-dispatcher.8.gz %{_mandir}/man8/NetworkManager-dispatcher.8.gz
%{_mandir}/man8/NetworkManager-wait-online.service.8.gz %{_mandir}/man8/NetworkManager-wait-online.service.8.gz
%dir %{_localstatedir}/lib/NetworkManager %dir %{_localstatedir}/lib/NetworkManager
%if 0%{?split_ifcfg_rh} == 0
%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
@ -1076,6 +1085,9 @@ fi
%if %{with firewalld_zone} %if %{with firewalld_zone}
%{_prefix}/lib/firewalld/zones/nm-shared.xml %{_prefix}/lib/firewalld/zones/nm-shared.xml
%endif %endif
%if 0%{?ifcfg_warning}
%{_sysconfdir}/sysconfig/network-scripts/readme-ifcfg-rh.txt
%endif
# systemd stuff # systemd stuff
%{_unitdir}/NetworkManager.service %{_unitdir}/NetworkManager.service
%{_unitdir}/NetworkManager-wait-online.service %{_unitdir}/NetworkManager-wait-online.service
@ -1198,7 +1210,6 @@ fi
%if 0%{?split_ifcfg_rh} %if 0%{?split_ifcfg_rh}
%files initscripts-ifcfg-rh %files initscripts-ifcfg-rh
%dir %{_sysconfdir}/sysconfig/network-scripts
%{nmplugindir}/libnm-settings-plugin-ifcfg-rh.so %{nmplugindir}/libnm-settings-plugin-ifcfg-rh.so
%{dbus_sys_dir}/nm-ifcfg-rh.conf %{dbus_sys_dir}/nm-ifcfg-rh.conf
%endif %endif

31
readme-ifcfg-rh.txt Normal file
View File

@ -0,0 +1,31 @@
NetworkManager stores new network profiles in keyfile format in the
/etc/NetworkManager/system-connections/ directory.
Previously, NetworkManager stored network profiles in ifcfg format
in this directory (/etc/sysconfig/network-scripts/). However, the ifcfg
format is deprecated. By default, NetworkManager no longer creates
new profiles in this format.
Connection profiles in keyfile format have many benefits. For example,
this format is INI file-based and can easily be parsed and generated.
Each section in NetworkManager keyfiles corresponds to a NetworkManager
setting name as described in the nm-settings(5) and nm-settings-keyfile(5)
man pages. Each key-value-pair in a section is one of the properties
listed in the settings specification of the man page.
If you still use network profiles in ifcfg format, consider migrating
them to keyfile format. To migrate all profiles at once, enter:
# nmcli connection migrate
This command migrates all profiles from ifcfg format to keyfile
format and stores them in /etc/NetworkManager/system-connections/.
Alternatively, to migrate only a specific profile, enter:
# nmcli connection migrate <profile_name|UUID|D-Bus_path>
For further details, see:
* nm-settings-keyfile(5)
* nmcli(1)