mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-15 04:24:32 +00:00
rpm: include a warning message for network configuration on /etc/sysconfig/network-scripts directory
NetworkManager now does not support network configuration through ifcfg files by default anymore, it is provided in a separated package: https://fedoramagazine.org/converting-networkmanager-from-ifcfg-to-keyfiles/ This commits include a file in rpm packages located in ifcfg scripts directory, /etc/sysconfig/network-scripts/, to inform the user of the new location of network configuration files. https://bugzilla.redhat.com/show_bug.cgi?id=2074020
This commit is contained in:
parent
0415d904cb
commit
96d7362613
|
@ -161,8 +161,10 @@
|
|||
|
||||
%if 0%{?rhel} > 9 || 0%{?fedora} > 35
|
||||
%global split_ifcfg_rh 1
|
||||
%global ifcfg_warning 1
|
||||
%else
|
||||
%global split_ifcfg_rh 0
|
||||
%global ifcfg_warning 0
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora}
|
||||
|
@ -199,6 +201,7 @@ Source2: 00-server.conf
|
|||
Source4: 20-connectivity-fedora.conf
|
||||
Source5: 20-connectivity-redhat.conf
|
||||
Source6: 70-nm-connectivity.conf
|
||||
Source7: readme-ifcfg-rh.txt
|
||||
|
||||
#Patch1: 0001-some.patch
|
||||
|
||||
|
@ -900,6 +903,10 @@ mkdir -p %{buildroot}%{_sysctldir}
|
|||
cp %{SOURCE6} %{buildroot}%{_sysctldir}
|
||||
%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/
|
||||
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/
|
||||
|
@ -1090,6 +1097,9 @@ fi
|
|||
%{_unitdir}/nm-priv-helper.service
|
||||
%dir %{_datadir}/doc/NetworkManager/examples
|
||||
%{_datadir}/doc/NetworkManager/examples/server.conf
|
||||
%if 0%{?ifcfg_warning}
|
||||
%{_sysconfdir}/sysconfig/network-scripts/readme-ifcfg-rh.txt
|
||||
%endif
|
||||
%doc NEWS AUTHORS README.md CONTRIBUTING.md
|
||||
%license COPYING
|
||||
%license COPYING.LGPL
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
# SOURCE_CONFIG_CONNECTIVITY_FEDORA=
|
||||
# SOURCE_CONFIG_CONNECTIVITY_REDHAT=
|
||||
# SOURCE_SYSCTL_RP_FILTER_REDHAT=
|
||||
# SOURCE_README_IFCFG_FILES=
|
||||
# SIGN_SOURCE=
|
||||
# DO_RELEASE=
|
||||
# BCOND_DEFAULT_DEBUG=
|
||||
|
@ -140,6 +141,7 @@ SOURCE_CONFIG_SERVER="$(abs_path "$SOURCE_CONFIG_SERVER" "$SCRIPTDIR/00-server.c
|
|||
SOURCE_CONFIG_CONNECTIVITY_FEDORA="$(abs_path "$SOURCE_CONFIG_CONNECTIVITY_FEDORA" "$SCRIPTDIR/20-connectivity-fedora.conf")" || die "invalid \$SOURCE_CONFIG_CONNECTIVITY_FEDORA argument"
|
||||
SOURCE_CONFIG_CONNECTIVITY_REDHAT="$(abs_path "$SOURCE_CONFIG_CONNECTIVITY_REDHAT" "$SCRIPTDIR/20-connectivity-redhat.conf")" || die "invalid \$SOURCE_CONFIG_CONNECTIVITY_REDHAT argument"
|
||||
SOURCE_SYSCTL_RP_FILTER_REDHAT="$(abs_path "$SOURCE_SYSCTL_RP_FILTER_REDHAT" "$SCRIPTDIR/70-nm-connectivity.conf")" || die "invalid \$SOURCE_SYSCTL_RP_FILTER_REDHAT argument"
|
||||
SOURCE_README_IFCFG_FILES="$(abs_path "$SOURCE_README_IFCFG_FILES" "$SCRIPTDIR/readme-ifcfg-rh.txt")" || die "invalid \$SOURCE_README_IFCFG_FILES argument"
|
||||
|
||||
TEMP="$(mktemp -d "$SCRIPTDIR/NetworkManager.$DATE.XXXXXX")"
|
||||
TEMPBASE="$(basename "$TEMP")"
|
||||
|
@ -166,6 +168,7 @@ LOG "SOURCE_CONFIG_SERVER=$SOURCE_CONFIG_SERVER"
|
|||
LOG "SOURCE_CONFIG_CONNECTIVITY_FEDORA=$SOURCE_CONFIG_CONNECTIVITY_FEDORA"
|
||||
LOG "SOURCE_CONFIG_CONNECTIVITY_REDHAT=$SOURCE_CONFIG_CONNECTIVITY_REDHAT"
|
||||
LOG "SOURCE_SYSCTL_RP_FILTER_REDHAT=$SOURCE_SYSCTL_RP_FILTER_REDHAT"
|
||||
LOG "SOURCE_README_IFCFG_FILES=$SOURCE_README_IFCFG_FILES"
|
||||
LOG "BUILDTYPE=$BUILDTYPE"
|
||||
LOG "NM_RPMBUILD_ARGS=$NM_RPMBUILD_ARGS"
|
||||
LOG "BCOND_DEFAULT_DEBUG=$BCOND_DEFAULT_DEBUG"
|
||||
|
@ -192,6 +195,7 @@ cp "$SOURCE_CONFIG_SERVER" "$TEMP/SOURCES/00-server.conf" || die "Could not copy
|
|||
cp "$SOURCE_CONFIG_CONNECTIVITY_FEDORA" "$TEMP/SOURCES/20-connectivity-fedora.conf" || die "Could not copy source $SOURCE_CONFIG_CONNECTIVITY_FEDORA to $TEMP/SOURCES"
|
||||
cp "$SOURCE_CONFIG_CONNECTIVITY_REDHAT" "$TEMP/SOURCES/20-connectivity-redhat.conf" || die "Could not copy source $SOURCE_CONFIG_CONNECTIVITY_REDHAT to $TEMP/SOURCES"
|
||||
cp "$SOURCE_SYSCTL_RP_FILTER_REDHAT" "$TEMP/SOURCES/70-nm-connectivity.conf" || die "Could not copy source $SOURCE_SYSCTL_RP_FILTER_REDHAT to $TEMP/SOURCES"
|
||||
cp "$SOURCE_README_IFCFG_FILES" "$TEMP/SOURCES/readme-ifcfg-rh.txt" || die "Could not copy source $SOURCE_README_IFCFG_FILES to $TEMP/SOURCES"
|
||||
|
||||
write_changelog
|
||||
|
||||
|
|
31
contrib/fedora/rpm/readme-ifcfg-rh.txt
Normal file
31
contrib/fedora/rpm/readme-ifcfg-rh.txt
Normal 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)
|
Loading…
Reference in a new issue