Package init

This commit is contained in:
overweight 2019-09-30 11:09:43 -04:00
commit 70b0177343
8 changed files with 709 additions and 0 deletions

14
00-server.conf Normal file
View File

@ -0,0 +1,14 @@
# This configuration file changes NetworkManager's behavior to
# what's expected on "traditional UNIX server" type deployments.
#
# See "man NetworkManager.conf" for more information about these
# and other keys.
[main]
# Do not do automatic (DHCP/SLAAC) configuration on ethernet devices
# with no other matching connections.
no-auto-default=*
# Ignore the carrier (cable plugged in) state when attempting to
# activate static-IP connections.
ignore-carrier=*

Binary file not shown.

50
NetworkManager.conf Normal file
View File

@ -0,0 +1,50 @@
# Configuration file for NetworkManager.
#
# See "man 5 NetworkManager.conf" for details.
#
# The directories /usr/lib/NetworkManager/conf.d/ and /var/run/NetworkManager/conf.d/
# can contain additional configuration snippets installed by packages. These files are
# read before NetworkManager.conf and have thus lowest priority.
# The directory /etc/NetworkManager/conf.d/ can contain additional configuration
# snippets. Those snippets are merged last and overwrite the settings from this main
# file.
#
# The files within one conf.d/ directory are read in asciibetical order.
#
# If /etc/NetworkManager/conf.d/ contains a file with the same name as
# /usr/lib/NetworkManager/conf.d/, the latter file is shadowed and thus ignored.
# Hence, to disable loading a file from /usr/lib/NetworkManager/conf.d/ you can
# put an empty file to /etc with the same name. The same applies with respect
# to the directory /var/run/NetworkManager/conf.d where files in /var/run shadow
# /usr/lib and are themselves shadowed by files under /etc.
#
# If two files define the same key, the one that is read afterwards will overwrite
# the previous one.
[main]
#plugins=ifcfg-rh,ibft
[logging]
# When debugging NetworkManager, enabling debug logging is of great help.
#
# Logfiles contain no passwords and little sensitive information. But please
# check before posting the file online. You can also personally hand over the
# logfile to a NM developer to treat it confidential. Meet us on #nm on freenode.
# Please post full logfiles except minimal modifications of private data.
#
# You can also change the log-level at runtime via
# $ nmcli general logging level TRACE domains ALL
# However, usually it's cleaner to enable debug logging
# in the configuration and restart NetworkManager so that
# debug logging is enabled from the start.
#
# You will find the logfiles in syslog, for example via
# $ journalctl -u NetworkManager
#
# Note that debug logging of NetworkManager can be quite verbose. Some messages
# might be rate-limited by the logging daemon (see RateLimitIntervalSec, RateLimitBurst
# in man journald.conf).
#
#level=TRACE
#domains=ALL

418
NetworkManager.spec Normal file
View File

@ -0,0 +1,418 @@
%global dbus_glib_version 0.100
%global wireless_tools_version 1:28-0pre9
%global wpa_supplicant_version 1:1.1
%global ppp_version %(sed -n 's/^#define\\s*VERSION\\s*"\\([^\\s]*\\)"$/\\1/p' %{_includedir}/pppd/patchlevel.h 2>/dev/null | grep . || echo bad)
%global glib2_version %(pkg-config --modversion glib-2.0 2>/dev/null || echo bad)
%global real_version 1.16.0
%global snapshot %{nil}
%global git_sha %{nil}
%global obsoletes_device_plugins 1:0.9.9.95-1
%global obsoletes_ppp_plugin 1:1.5.3
%global systemd_dir %{_prefix}/lib/systemd/system
%if "x%{?snapshot}" != x
%global snapshot_dot .%{snapshot}
%endif
%if "x%{?git_sha}" != x
%global git_sha_dot .%{git_sha}
%endif
%global snap %{?snapshot_dot}%{?git_sha_dot}
%global real_version_major %(printf '%s' '%{real_version}' | sed -n 's/^\\([1-9][0-9]*\\.[1-9][0-9]*\\)\\.[1-9][0-9]*$/\\1/p')
%bcond_without adsl
%bcond_without bluetooth
%bcond_without wwan
%bcond_without team
%bcond_without wifi
%bcond_with iwd
%bcond_without ovs
%bcond_without ppp
%bcond_without nmtui
%bcond_without regen_docs
%bcond_with debug
%bcond_with test
%bcond_with lto
%bcond_with sanitizer
%bcond_with libnm_glib
%bcond_without crypto_gnutls
%global dbus_version 1.1
%global dbus_sys_dir %{_sysconfdir}/dbus-1/system.d
%global with_modem_manager_1 1
%global dhcp_default dhclient
Name: NetworkManager
Version: 1.16.0
Epoch: 1
Release: 4
Summary: Network Link Manager and User Applications
License: GPLv2+
URL: https://www.gnome.org/projects/NetworkManager/
Source: https://download.gnome.org/sources/NetworkManager/%{real_version_major}/%{name}-%{real_version}.tar.xz
Source1: NetworkManager.conf
Source2: 00-server.conf
# PATCH-FEATURE-FIX fix-wants-and-add-requires.patch --fix wants and add requires in the file of NetworkManager.service.in
Patch9000: fix-wants-and-add-requires.patch
Patch9001: bugfix-NetworkManager-tui-solve-bond-module.patch
Patch9002: bugfix-NetworkManager-tui-bond-page-when-modify.patch
Patch9003: bugfix-NetworkManager-tui-solve-team-page-problem-when-use-json.patch
BuildRequires: gcc libtool pkgconfig automake autoconf intltool gettext-devel ppp-devel gnutls-devel
BuildRequires: dbus-devel dbus-glib-devel glib2-devel gobject-introspection-devel jansson-devel
BuildRequires: dhclient readline-devel audit-libs-devel gtk-doc libudev-devel libuuid-devel /usr/bin/valac polkit-devel
BuildRequires: iptables libxslt bluez-libs-devel systemd systemd-devel libcurl-devel libndp-devel pygobject3-base teamd-devel
BuildRequires: ModemManager-glib-devel newt-devel /usr/bin/dbus-launch python3 python3-dbus libselinux-devel python-dbus
Requires(post): systemd
Requires(post): /usr/sbin/update-alternatives
Requires(preun): systemd
Requires(preun): /usr/sbin/update-alternatives
Requires(postun): systemd
Requires: dbus glib2 wpa_supplicant bluez
Requires: %{name}-libnm = %{epoch}:%{version}-%{release}
Obsoletes: NetworkManager < %{obsoletes_device_plugins} NetworkManager < %{obsoletes_ppp_plugin}
Obsoletes: dhcdbd NetworkManager < 1.0.0
Obsoletes: NetworkManager-wimax < 1.2
Obsoletes: NetworkManager-bt NetworkManager-atm
Conflicts: NetworkManager-vpnc < 1:0.7.0.99-1 NetworkManager-openvpn < 1:0.7.0.99-1
Conflicts: NetworkManager-pptp < 1:0.7.0.99-1 NetworkManager-openconnect < 0:0.7.0.99-1
Conflicts: kde-plasma-networkmanagement < 1:0.9-0.49.20110527git.nm09
Provides: %{name}-dispatcher-routing-rules
Obsoletes: %{name}-dispatcher-routing-rules
Provides: %{name}-config-routing-rules = %{epoch}:%{version}-%{release}
Obsoletes: %{name}-config-routing-rules < %{epoch}:%{version}-%{release}
Provides: %{name}-ppp
Obsoletes: %{name}-ppp
Provides: %{name}-wifi
Obsoletes: %{name}-wifi
Provides: %{name}-team
Obsoletes: %{name}-team
Provides: %{name}-ovs
Obsoletes: %{name}-ovs
Provides: %{name}-bluetooth
Obsoletes: %{name}-bluetooth
Provides: %{name}-tui
Obsoletes: %{name}-tui
Provides: %{name}-adsl
Obsoletes: %{name}-adsl
%description
NetworkManager attempts to keep an active network connection available
at all times. The point of NetworkManager is to make networking
configuration and setup as painless and automatic as possible. If
using DHCP, NetworkManager is intended to replace default routes,
obtain IP addresses from a DHCP server, and change name servers
whenever it sees fit.
%package wwan
Summary: Mobile broadband device plugin for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: ModemManager
Obsoletes: NetworkManager < %{obsoletes_device_plugins}
%description wwan
This package contains NetworkManager support for mobile broadband (WWAN)
devices.
%package libnm
Summary: Libraries for adding NetworkManager support to applications (new API).
Conflicts: NetworkManager-glib < %{epoch}:%{version}-%{release}
%description libnm
This package contains the libraries that add NetworkManager support to applications (new API).
%package libnm-devel
Summary: Header files and Development files for adding NetworkManager support to applications (new API).
Requires: %{name}-libnm = %{epoch}:%{version}-%{release} pkgconfig glib2-devel
%description libnm-devel
This package contains the header and development files for
developing applications that use %{name}-libnm.
%package config-server
Summary: NetworkManager config file for "server-like" defaults
BuildArch: noarch
%description config-server
This adds a NetworkManager configuration file to make it behave more
like the old "network" service. In particular, it stops NetworkManager
from automatically running DHCP on unconfigured ethernet devices, and
allows connections with static IP addresses to be brought up even on
ethernet devices with no carrier.
%package_help
%prep
%autosetup -p1 -n NetworkManager-%{real_version}
%build
%if %{with regen_docs}
gtkdocize
%endif
autoreconf --install --force
intltoolize --automake --copy --force
%configure \
--disable-silent-rules \
--with-dhclient=yes \
--with-dhcpcd=no \
--with-dhcpcanon=no \
--with-config-dhcp-default=%{dhcp_default} \
%if %{with crypto_gnutls}
--with-crypto=gnutls \
%else
--with-crypto=nss \
%endif
%if %{with sanitizer}
--with-address-sanitizer=exec \
%else
--with-address-sanitizer=no \
--disable-undefined-sanitizer \
%endif
%if %{with debug}
--enable-more-logging \
--with-more-asserts=10000 \
%else
--disable-more-logging \
--without-more-asserts \
%endif
--enable-ld-gc \
%if %{with lto}
--enable-lto \
%else
--disable-lto \
%endif
--with-libaudit=yes-disabled-by-default \
%if 0%{?with_modem_manager_1}
--with-modem-manager-1=yes \
%else
--with-modem-manager-1=no \
%endif
%if %{with wifi}
--enable-wifi=yes \
--with-wext=no \
%else
--enable-wifi=no \
%endif
%if %{with iwd}
--with-iwd=yes \
%else
--with-iwd=no \
%endif
--enable-vala=yes \
--enable-introspection \
%if %{with regen_docs}
--enable-gtk-doc \
%else
--disable-gtk-doc \
%endif
%if %{with team}
--enable-teamdctl=yes \
%else
--enable-teamdctl=no \
%endif
%if %{with ovs}
--enable-ovs=yes \
%else
--enable-ovs=no \
%endif
--with-selinux=yes \
--enable-polkit=yes \
--enable-polkit-agent \
--enable-modify-system=yes \
--enable-concheck \
--without-libpsl \
--without-ebpf \
--with-session-tracking=systemd \
--with-suspend-resume=systemd \
--with-systemdsystemunitdir=%{systemd_dir} \
--with-system-ca-path=/etc/pki/tls/cert.pem \
--with-dbus-sys-dir=%{dbus_sys_dir} \
--with-tests=yes \
%if %{with test}
--enable-more-warnings=error \
%else
--enable-more-warnings=yes \
%endif
--with-valgrind=no \
--enable-ifcfg-rh=yes \
%if %{with ppp}
--with-pppd-plugin-dir=%{_libdir}/pppd/%{ppp_version} \
--enable-ppp=yes \
%endif
--with-dist-version=%{version}-%{release} \
--with-config-plugins-default='ifcfg-rh' \
--with-config-dns-rc-manager-default=symlink \
--with-config-logging-backend-default=journal \
--enable-json-validation \
%if %{with libnm_glib}
--with-libnm-glib
%else
--without-libnm-glib
%endif
make
%install
make install DESTDIR=%{buildroot}
cp %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}/
cp %{SOURCE2} %{buildroot}%{_prefix}/lib/%{name}/conf.d/
cp examples/dispatcher/10-ifcfg-rh-routes.sh %{buildroot}%{_sysconfdir}/%{name}/dispatcher.d/
ln -s ../no-wait.d/10-ifcfg-rh-routes.sh %{buildroot}%{_sysconfdir}/%{name}/dispatcher.d/pre-up.d/
ln -s ../10-ifcfg-rh-routes.sh %{buildroot}%{_sysconfdir}/%{name}/dispatcher.d/no-wait.d/
%find_lang %{name}
%delete_la_and_a
find %{buildroot}%{_datadir}/gtk-doc -exec touch --reference configure.ac '{}' \+
%if 0%{?__debug_package}
mkdir -p %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version}
cp valgrind.suppressions %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version}
%endif
touch %{buildroot}%{_sbindir}/ifup %{buildroot}%{_sbindir}/ifdown
%check
make %{?_smp_mflags} check
%pre
if [ -f "%{systemd_dir}/network-online.target.wants/NetworkManager-wait-online.service" ] ; then
systemctl enable NetworkManager-wait-online.service || :
fi
%post
/usr/bin/udevadm control --reload-rules || :
/usr/bin/udevadm trigger --subsystem-match=net || :
%systemd_post NetworkManager.service NetworkManager-wait-online.service NetworkManager-dispatcher.service
%triggerin -- initscripts
if [ -f %{_sbindir}/ifup -a ! -L %{_sbindir}/ifup ]; then
/usr/sbin/update-alternatives --remove ifup %{_libexecdir}/nm-ifup >/dev/null 2>&1 || :
else
/usr/sbin/update-alternatives --install %{_sbindir}/ifup ifup %{_libexecdir}/nm-ifup 50 \
--slave %{_sbindir}/ifdown ifdown %{_libexecdir}/nm-ifdown
fi
%preun
if [ $1 -eq 0 ]; then
/bin/systemctl --no-reload disable NetworkManager.service >/dev/null 2>&1 || :
/usr/sbin/update-alternatives --remove ifup %{_libexecdir}/nm-ifup >/dev/null 2>&1 || :
fi
%systemd_preun NetworkManager-wait-online.service NetworkManager-dispatcher.service
%postun
/usr/bin/udevadm control --reload-rules || :
/usr/bin/udevadm trigger --subsystem-match=net || :
%systemd_postun
%ldconfig_scriptlets glib
%ldconfig_scriptlets libnm
%files
%defattr(-,root,root)
%doc AUTHORS
%license COPYING
%{_datadir}/doc/NetworkManager/examples/server.conf
%{_bindir}/nmcli
%{_bindir}/nm-online
%{_sbindir}/NetworkManager
%exclude %{_libexecdir}/nm-initrd-generator
%ghost %attr(755, root, root) %{_sbindir}/ifdown
%ghost %attr(755, root, root) %{_sbindir}/ifup
%dir %{_prefix}/lib/NetworkManager/conf.d
%dir %{_prefix}/lib/NetworkManager/VPN
%{systemd_dir}/NetworkManager.service
%{systemd_dir}/NetworkManager-wait-online.service
%{systemd_dir}/NetworkManager-dispatcher.service
%{_prefix}/lib/udev/rules.d/*.rules
%{_libdir}/%{name}/%{version}-%{release}/*.so
%{_libexecdir}/nm-if*
%{_libexecdir}/nm-dhcp-helper
%{_libexecdir}/nm-dispatcher
%{_datadir}/bash-completion/completions/nmcli
%{dbus_sys_dir}/*.conf
%{_datadir}/dbus-1/system-services/*.service
%{_datadir}/polkit-1/actions/*.policy
%dir %{_sysconfdir}/NetworkManager/conf.d
%dir %{_sysconfdir}/NetworkManager/dispatcher.d/pre-down.d
%dir %{_sysconfdir}/NetworkManager/dnsmasq.d
%dir %{_sysconfdir}/NetworkManager/dnsmasq-shared.d
%dir %{_sysconfdir}/NetworkManager/system-connections
%dir %{_sysconfdir}/sysconfig/network-scripts
%{_sysconfdir}/NetworkManager/NetworkManager.conf
%dir %{_localstatedir}/lib/%{name}
%{_sysconfdir}/%{name}/dispatcher.d/10-ifcfg-rh-routes.sh
%{_sysconfdir}/%{name}/dispatcher.d/no-wait.d/10-ifcfg-rh-routes.sh
%{_sysconfdir}/%{name}/dispatcher.d/pre-up.d/10-ifcfg-rh-routes.sh
%{_libdir}/pppd/2.4.7/nm-pppd-plugin.so
%{_libdir}/%{name}/%{version}-%{release}/libnm-device-plugin-wifi.so
%{_libdir}/%{name}/%{version}-%{release}/libnm-device-plugin-team.so
%{_libdir}/%{name}/%{version}-%{release}/libnm-device-plugin-ovs.so
%{systemd_dir}/NetworkManager.service.d/NetworkManager-ovs.conf
%{_libdir}/%{name}/%{version}-%{release}/libnm-ppp-plugin.so
%{_libdir}/%{name}/%{version}-%{release}/libnm-device-plugin-bluetooth.so
%{_bindir}/nmtui*
%{_libdir}/%{name}/%{version}-%{release}/libnm-device-plugin-adsl.so
%files wwan
%defattr(-,root,root)
%{_libdir}/%{name}/%{version}-%{release}/libnm-device-plugin-wwan.so
%{_libdir}/%{name}/%{version}-%{release}/libnm-wwan.so
%files libnm -f %{name}.lang
%defattr(-,root,root)
%{_libdir}/libnm.so.0*
%{_libdir}/girepository-1.0/*.typelib
%files libnm-devel
%defattr(-,root,root)
%{_includedir}/libnm/*.h
%{_libdir}/pkgconfig/*.pc
%{_libdir}/libnm.so
%{_datadir}/gir-1.0/NM-1.0.gir
%{_datadir}/vala/vapi/libnm*
%{_datadir}/dbus-1/interfaces/*.xml
%files config-server
%{_prefix}/lib/%{name}/conf.d/00-server.conf
%files help
%defattr(-,root,root)
%doc CONTRIBUTING NEWS README TODO
%{_mandir}/man1/nmcli.1.gz
%{_mandir}/man1/nm-online.1.gz
%{_mandir}/man5/*.5.gz
%{_mandir}/man7/nmcli-examples.7.gz
%{_mandir}/man8/*.8.gz
%{_mandir}/man7/nm-openvswitch.7.gz
%{_mandir}/man1/nmtui*.1.gz
%{_datadir}/gtk-doc/html/libnm/*
%{_datadir}/gtk-doc/html/NetworkManager/*
%changelog
* Fri Sep 27 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.16.0-4
- Type:bugfix
- ID:NA
- SUG:NA
DESC:the Sub-package of config-server fallback
* Thu Sep 26 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.16.0-3
- Type:bugfix
- ID:NA
- SUG:NA
DESC:version fallback
* Wed Sep 25 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.16.0-2
- Type:bugfix
- ID:NA
- SUG:NA
DESC:bugfix nmtui problem team module
* Sat Sep 21 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.16.0-1
- Package init

View File

@ -0,0 +1,57 @@
From 06742d70c395be910894f116e9ef3d89d9b2da19 Mon Sep 17 00:00:00 2001
From: peulerosci <zhangyao65@huawei.com>
Date: Wed, 25 Sep 2019 17:41:10 +0800
Subject: [PATCH] NetworkManager-tui: solve bond page problem when editing
---
clients/tui/nmt-page-bond.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/clients/tui/nmt-page-bond.c b/clients/tui/nmt-page-bond.c
index 1629c8b..0dc1b1d 100644
--- a/clients/tui/nmt-page-bond.c
+++ b/clients/tui/nmt-page-bond.c
@@ -226,6 +226,20 @@ WIDGET_CHANGED_FUNC (updelay, nmt_newt_entry_get_text, NM_SETTING_BOND_OPTION_UP
WIDGET_CHANGED_FUNC (downdelay, nmt_newt_entry_get_text, NM_SETTING_BOND_OPTION_DOWNDELAY)
WIDGET_CHANGED_FUNC (arp_interval, nmt_newt_entry_get_text, NM_SETTING_BOND_OPTION_ARP_INTERVAL)
+static void
+refresh_page_option_by_mode(NmtPageBondPrivate *priv)
+{
+ const char *mode;
+ mode = nmt_newt_popup_get_active_id (priv->mode);
+ if (!strcmp (mode, "balance-tlb") || !strcmp (mode, "balance-alb")
+ || !strcmp (mode, "802.3ad")) {
+ nmt_newt_popup_set_active (priv->monitoring, NMT_PAGE_BOND_MONITORING_MII);
+ nmt_newt_component_set_sensitive (NMT_NEWT_COMPONENT (priv->monitoring), FALSE);
+ } else
+ nmt_newt_component_set_sensitive (NMT_NEWT_COMPONENT (priv->monitoring), TRUE);
+}
+
+
static void
mode_widget_changed (GObject *object,
GParamSpec *pspec,
@@ -236,14 +250,17 @@ mode_widget_changed (GObject *object,
const char *mode;
if (priv->updating)
- return;
+ {
+ refresh_page_option_by_mode(priv);
+ return;
+ }
mode = nmt_newt_popup_get_active_id (priv->mode);
priv->updating = TRUE;
nm_setting_bond_add_option (priv->s_bond, NM_SETTING_BOND_OPTION_MODE, mode);
priv->updating = FALSE;
- if (!strcmp (mode, "balance-tlb") || !strcmp (mode, "balance-alb")) {
+ if (!strcmp (mode, "balance-tlb") || !strcmp (mode, "balance-alb") || !strcmp (mode, "802.3ad")) {
nmt_newt_popup_set_active (priv->monitoring, NMT_PAGE_BOND_MONITORING_MII);
nmt_newt_component_set_sensitive (NMT_NEWT_COMPONENT (priv->monitoring), FALSE);
} else
--
1.8.3.1

View File

@ -0,0 +1,113 @@
From 600ac34d381425f715ceff4cbaead751fae69430 Mon Sep 17 00:00:00 2001
From: peulerosci <zhangyao65@huawei.com>
Date: Wed, 25 Sep 2019 17:33:40 +0800
Subject: [PATCH] NetworkManager-tui: solve bond module
---
.../libnm-core/nm-core-internal.h | 1 +
NetworkManager-1.16.0/libnm-core/nm-setting-bond.c | 29 ++++++++++++++++++++--
.../libnm-core/tests/test-setting.c | 2 +-
3 files changed, 29 insertions(+), 3 deletions(-)
diff --git NetworkManager-1.16.0/libnm-core/nm-core-internal.h NetworkManager-1.16.0/libnm-core/nm-core-internal.h
index f2332f7..64d7f65 100644
--- NetworkManager-1.16.0/libnm-core/nm-core-internal.h
+++ NetworkManager-1.16.0/libnm-core/nm-core-internal.h
@@ -461,6 +461,7 @@ typedef enum {
NM_BOND_OPTION_TYPE_IP,
NM_BOND_OPTION_TYPE_MAC,
NM_BOND_OPTION_TYPE_IFNAME,
+ NM_BOND_OPTION_TYPE_PRIMARY_SLAVE,
} NMBondOptionType;
NMBondOptionType
diff --git NetworkManager-1.16.0/libnm-core/nm-setting-bond.c NetworkManager-1.16.0/libnm-core/nm-setting-bond.c
index 51ce2de..5b60435 100644
--- NetworkManager-1.16.0/libnm-core/nm-setting-bond.c
+++ NetworkManager-1.16.0/libnm-core/nm-setting-bond.c
@@ -79,8 +79,8 @@ static const BondDefault defaults[] = {
{ NM_SETTING_BOND_OPTION_ARP_IP_TARGET, "", NM_BOND_OPTION_TYPE_IP },
{ NM_SETTING_BOND_OPTION_ARP_VALIDATE, "none", NM_BOND_OPTION_TYPE_BOTH, 0, 3,
{ "none", "active", "backup", "all", NULL } },
- { NM_SETTING_BOND_OPTION_PRIMARY, "", NM_BOND_OPTION_TYPE_IFNAME },
- { NM_SETTING_BOND_OPTION_PRIMARY_RESELECT, "always", NM_BOND_OPTION_TYPE_BOTH, 0, 2,
+ { NM_SETTING_BOND_OPTION_PRIMARY, "", NM_BOND_OPTION_TYPE_PRIMARY_SLAVE },
+ { NM_SETTING_BOND_OPTION_PRIMARY_RESELECT, "always", NM_BOND_OPTION_TYPE_BOTH, 0, 2,
{ "always", "better", "failure", NULL } },
{ NM_SETTING_BOND_OPTION_FAIL_OVER_MAC, "none", NM_BOND_OPTION_TYPE_BOTH, 0, 2,
{ "none", "active", "follow", NULL } },
@@ -234,7 +234,16 @@ validate_ip (const char *name, const char *value)
}
return TRUE;
}
+static gboolean
+nm_check_primary_slave (const char *value)
+{
+ if (!value || !value[0]) {
+ return TRUE;
+ }
+
+ return nm_utils_is_valid_iface_name (value, NULL);
+}
static gboolean
validate_ifname (const char *name, const char *value)
{
@@ -282,6 +291,8 @@ nm_setting_bond_validate_option (const char *name,
return nm_utils_hwaddr_valid (value, ETH_ALEN);
case NM_BOND_OPTION_TYPE_IFNAME:
return validate_ifname (name, value);
+ case NM_BOND_OPTION_TYPE_PRIMARY_SLAVE:
+ return nm_check_primary_slave (value);
}
return FALSE;
}
@@ -335,6 +346,9 @@ nm_setting_bond_add_option (NMSettingBond *setting,
const char *value)
{
NMSettingBondPrivate *priv;
+ const char *init_updelay = "0";
+ const char *init_downdelay = "0";
+ const char *tmp = NULL;
g_return_val_if_fail (NM_IS_SETTING_BOND (setting), FALSE);
@@ -350,11 +364,22 @@ nm_setting_bond_add_option (NMSettingBond *setting,
&& strcmp (value, "0") != 0) {
g_hash_table_remove (priv->options, NM_SETTING_BOND_OPTION_ARP_INTERVAL);
g_hash_table_remove (priv->options, NM_SETTING_BOND_OPTION_ARP_IP_TARGET);
+
+ tmp = g_hash_table_lookup (NM_SETTING_BOND_GET_PRIVATE (setting)->options, NM_SETTING_BOND_OPTION_DOWNDELAY);
+ if (!tmp) {
+ g_hash_table_insert (priv->options, g_strdup (NM_SETTING_BOND_OPTION_DOWNDELAY), g_strdup (init_downdelay));
+ }
+ tmp = g_hash_table_lookup (NM_SETTING_BOND_GET_PRIVATE (setting)->options, NM_SETTING_BOND_OPTION_UPDELAY);
+ if (!tmp) {
+ g_hash_table_insert (priv->options, g_strdup (NM_SETTING_BOND_OPTION_UPDELAY), g_strdup (init_updelay));
+ }
} else if ( !strcmp (name, NM_SETTING_BOND_OPTION_ARP_INTERVAL)
&& strcmp (value, "0") != 0) {
g_hash_table_remove (priv->options, NM_SETTING_BOND_OPTION_MIIMON);
g_hash_table_remove (priv->options, NM_SETTING_BOND_OPTION_DOWNDELAY);
g_hash_table_remove (priv->options, NM_SETTING_BOND_OPTION_UPDELAY);
+ } else if ( !strcmp (name, NM_SETTING_BOND_OPTION_PRIMARY) && !strcmp (value, "") ) {
+ g_hash_table_remove (priv->options, NM_SETTING_BOND_OPTION_PRIMARY);
}
_notify (setting, PROP_OPTIONS);
diff --git NetworkManager-1.16.0/libnm-core/tests/test-setting.c NetworkManager-1.16.0/libnm-core/tests/test-setting.c
index 2011273..4c72d02 100644
--- NetworkManager-1.16.0/libnm-core/tests/test-setting.c
+++ NetworkManager-1.16.0/libnm-core/tests/test-setting.c
@@ -678,7 +678,7 @@ test_bond_normalize (void)
((const char *[]){ "mode", "802.3ad", "ad_actor_system", "00:02:03:04:05:06", NULL }));
test_bond_normalize_options (
((const char *[]){ "mode", "1", "miimon", "1", NULL }),
- ((const char *[]){ "mode", "active-backup", "miimon", "1", NULL }));
+ ((const char *[]){ "mode", "active-backup", "miimon", "1", NM_SETTING_BOND_OPTION_DOWNDELAY, "0", NM_SETTING_BOND_OPTION_UPDELAY, "0", NULL }));
test_bond_normalize_options (
((const char *[]){ "mode", "balance-alb", "tlb_dynamic_lb", "1", NULL }),
((const char *[]){ "mode", "balance-alb", NULL }));
--
1.8.3.1

View File

@ -0,0 +1,26 @@
From 4ad2335f5b798046e530fa1c670d0f0ffdea200a Mon Sep 17 00:00:00 2001
From: peulerosci <zhangyao65@huawei.com>
Date: Wed, 25 Sep 2019 17:45:01 +0800
Subject: [PATCH] NetworkManager-tui: solve team page problem when use json
---
NetworkManager-1.16.0/clients/tui/newt/nmt-newt-utils.c | 2 --
1 file changed, 2 deletions(-)
diff --git NetworkManager-1.16.0/clients/tui/newt/nmt-newt-utils.c NetworkManager-1.16.0/clients/tui/newt/nmt-newt-utils.c
index 475faf7..8a14f68 100644
--- NetworkManager-1.16.0/clients/tui/newt/nmt-newt-utils.c
+++ NetworkManager-1.16.0/clients/tui/newt/nmt-newt-utils.c
@@ -102,9 +102,7 @@ nmt_newt_basic_g_log_handler (const char *log_domain,
const char *message,
gpointer user_data)
{
- newtSuspend ();
g_log_default_handler (log_domain, log_level, message, NULL);
- newtResume ();
}
static void
--
1.8.3.1

View File

@ -0,0 +1,31 @@
From e6167c45784b8ff741f69b39b2d7438762d25772 Mon Sep 17 00:00:00 2001
From: <sunyun9@huawei.com>
Date: Sat, 21 Sep 2019 15:09:55 +0800
Subject: [PATCH] NetworkManager: openEuler Debranding
Change-Id: Ice3d6ce0f781719e57f8a8bde8ed958e933e53f5
Signed-off-by: <sunyun9@huawei.com>
---
NetworkManager-1.16.0/data/NetworkManager.service.in | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git NetworkManager-1.16.0/data/NetworkManager.service.in NetworkManager-1.16.0/data/NetworkManager.service.in
index ff90456..9d9b755 100644
--- NetworkManager-1.16.0/data/NetworkManager.service.in
+++ NetworkManager-1.16.0/data/NetworkManager.service.in
@@ -1,9 +1,10 @@
[Unit]
Description=Network Manager
Documentation=man:NetworkManager(8)
-Wants=network.target
-After=network-pre.target dbus.service
+Wants=network.target dbus.socket
+After=network-pre.target dbus.service dbus.socket
Before=network.target @DISTRO_NETWORK_SERVICE@
+Requires=dbus.service
[Service]
Type=dbus
--
2.19.1