kiran-control-panel/0001-feature-network-Add-the-conf-file-to-overwrite-the-o.patch
luoqing fd13947a9a fix(network):fix the problem of network and details corresponding error,Add error prompt box when saving configuration,fix invalid configuration created for the first time,fix crash and wireless network disable function defects
- 保存配置时,增加错误提示框
  修复网络详情页面中网络与详情对应错误
  修复初次创建配置失效的问题
  修复无线网络禁用的缺陷
2022-08-23 17:40:19 +08:00

60 lines
2.6 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From ebd20e32e3f0c0944aebdad0cd5a347694b033e4 Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Fri, 12 Aug 2022 17:27:50 +0800
Subject: [PATCH 1/7] feature(network):Add the conf file to overwrite the
original configuration of NetworkManager
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 添加conf文件以覆盖NetworkManager原先的配置
---
plugins/network/CMakeLists.txt | 4 ++++
plugins/network/data/00-server.conf.in | 18 ++++++++++++++++++
2 files changed, 22 insertions(+)
create mode 100644 plugins/network/data/00-server.conf.in
diff --git a/plugins/network/CMakeLists.txt b/plugins/network/CMakeLists.txt
index 0bdf4f8..02dbe3a 100644
--- a/plugins/network/CMakeLists.txt
+++ b/plugins/network/CMakeLists.txt
@@ -115,6 +115,10 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kiran-network-status-icon.desktop DEST
SET(link_source ${PLUGIN_DESKTOP_INSTALL_DIR}/${TARGET_NAME}.desktop)
SET(link_target ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}-link.desktop)
+set(NETWORK_SERVER_CONF /etc/NetworkManager/conf.d)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/00-server.conf.in ${CMAKE_CURRENT_BINARY_DIR}/00-server.conf @ONLY)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/00-server.conf DESTINATION ${NETWORK_SERVER_CONF}/)
+
#安装插件和二进制文件
install(TARGETS ${TARGET_NAME} DESTINATION ${PLUGIN_LIBS_INSTALL_DIR}/)
install(TARGETS ${TRAY_PROCESS} DESTINATION ${INSTALL_BINDIR})
diff --git a/plugins/network/data/00-server.conf.in b/plugins/network/data/00-server.conf.in
new file mode 100644
index 0000000..e3202b8
--- /dev/null
+++ b/plugins/network/data/00-server.conf.in
@@ -0,0 +1,18 @@
+# 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.
+
+#NetworkManager会先读取/etc/NetworkManager/NetworkManager.conf然后是/usr/lib/NetworkManager/conf.d/下的配置
+#最后读取/etc/NetworkManager/conf.d后读取的文件将覆盖先读取的同名文件配置
+#在/etc/NetworkManager/conf.d目录添加该文件用以覆盖/usr/lib/NetworkManager/conf.d下的同名文件的配置
+#https://gitee.com/src-openeuler/kiran-desktop/issues/I5I0AA
+[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=*
\ No newline at end of file
--
2.33.0