Compare commits

..

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
a0250d34cb
!57 [sync] PR-53: sync some patches from upstream
From: @openeuler-sync-bot 
Reviewed-by: @jiangheng12 
Signed-off-by: @jiangheng12
2025-02-14 01:02:46 +00:00
xh
d511d2bf1c fix memory leak
(cherry picked from commit d42ffe069ae3ebacc67484cfdafcc2d8f55d948f)
2025-02-13 16:20:10 +08:00
openeuler-ci-bot
a84eb033b2
!49 update to 10.19
From: @tmacbb 
Reviewed-by: @robertxw 
Signed-off-by: @robertxw
2024-02-05 03:43:20 +00:00
tmacbb
4432fe7833 update to 10.19 2024-02-04 17:25:36 +08:00
openeuler-ci-bot
b00ce6e6fa
!42 remove unnecessary patches
From: @robertxw 
Reviewed-by: @gebidelidaye 
Signed-off-by: @gebidelidaye
2023-06-15 11:17:27 +00:00
gaoxingwang
6415904b64 remove unnecessary patches because the first introduced problem doesn't make much sense to fix 2023-06-15 17:17:15 +08:00
openeuler-ci-bot
1345e7ff17
!40 支持指定 CC 编译
From: @jammyjellyfish 
Reviewed-by: @zengwefeng 
Signed-off-by: @zengwefeng
2023-04-26 08:14:42 +00:00
jammyjellyfish
0d4104d692 Support specify CC 2023-04-24 14:02:14 +08:00
openeuler-ci-bot
a11b72d111
!37 delete Requires:dbus-tools
From: @eaglegai 
Reviewed-by: @seuzw 
Signed-off-by: @seuzw
2023-02-20 07:03:42 +00:00
eaglegai
c0cb18d340 delete Requires:dbus-tools 2023-02-20 02:06:41 +00:00
8 changed files with 85 additions and 133 deletions

View File

@ -0,0 +1,32 @@
From 2b185d6bb1eda7e5bdd885afc88bf404d2c1f861 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Fri, 1 Mar 2024 14:36:45 +0100
Subject: [PATCH] rename_device: free path after it is used
Conflict: NA
Reference: https://github.com/fedora-sysv/initscripts/commit/2b185d6bb1eda7e5bdd885afc88bf404d2c1f861
---
src/rename_device.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/rename_device.c b/src/rename_device.c
index 0d29f64d..e6b09f45 100644
--- a/src/rename_device.c
+++ b/src/rename_device.c
@@ -180,7 +180,7 @@ struct netdev *get_configs() {
return ret;
}
for (x = 0; x < ncfgs; x++ ) {
- char *path;
+ char *path = NULL;
char *devname, *hwaddr;
int vlan;
gchar *contents, **lines;
@@ -193,6 +193,7 @@ struct netdev *get_configs() {
cfgs[x]->d_name) == -1)
continue;
g_file_get_contents(path, &contents, NULL, NULL);
+ free(path);
if (!contents)
continue;
lines = g_strsplit(contents,"\n", 0);

View File

@ -1,25 +0,0 @@
From 76a5f892c132eed05a6cbffbdba3306e50b6a672 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
Date: Thu, 5 Oct 2017 12:40:38 -0400
Subject: [PATCH 7/9] WRS: Patch10-run-ifdown-on-all-interfaces.patch
---
etc/rc.d/init.d/network | 3 +++
1 file changed, 3 insertions(+)
diff --git a/etc/rc.d/init.d/network b/etc/rc.d/init.d/network
index a8deed3..852ef94 100755
--- a/etc/rc.d/init.d/network
+++ b/etc/rc.d/init.d/network
@@ -235,6 +235,9 @@ stop)
if ! check_device_down $DEVICE; then
action $"Shutting down interface $i: " ./ifdown $i boot
[ $? -ne 0 ] && rc=1
+ else
+ action $"Shutting down non-UP interface $i: " ./ifdown $i boot
+ logger $"Running ifdown on non-UP interface $i"
fi
)
done
--
1.9.1

View File

@ -1,62 +0,0 @@
From 18a9b144be17afca1a5bdb9d1142e6dbf201d8a7 Mon Sep 17 00:00:00 2001
From: zhangqiang <zhangqiang@kylinos.cn>
Date: Mon, 7 Nov 2022 07:14:11 +0800
Subject: [PATCH] Incorrect processing of empty files for resolv.conf When
resolv.conf is empty or does not exist,ifup-post backup files that do not
match expectations.
---
network-scripts/ifup | 2 ++
network-scripts/network-functions | 23 +++++++++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/network-scripts/ifup b/network-scripts/ifup
index a053077..8871526 100755
--- a/network-scripts/ifup
+++ b/network-scripts/ifup
@@ -50,6 +50,8 @@ if [ ${UID} != 0 ]; then
exit 1
fi
+init_resolv_conf
+
source_config
if ! is_true ${DEPRECATION_WARNING_ISSUED}; then
diff --git a/network-scripts/network-functions b/network-scripts/network-functions
index eed3c91..83e4bea 100644
--- a/network-scripts/network-functions
+++ b/network-scripts/network-functions
@@ -633,6 +633,29 @@ is_bonding_device ()
[ -f "/sys/class/net/$1/bonding/slaves" ]
}
+# Initialize /etc/resolv.conf when the network service starts
+init_resolv_conf ()
+{
+ title="# Generated by network"
+ if [ ! -f /etc/resolv.conf ];then
+ echo ${title} > /etc/resolv.conf
+ return 0
+ fi
+ #If the file exists and the content is empty or there are empty lines, the ifup-post condition will be judged wrongly,
+ #and the backup process will be started. Add a comment at the first line here to solve the problem
+ if ! grep -E -q "${title}" /etc/resolv.conf;then
+ if tmp_file=$(mktemp);then
+ echo ${title} > ${tmp_file}
+ cat /etc/resolv.conf >> ${tmp_file}
+ cp -rf ${tmp_file} /etc/resolv.conf
+ /usr/bin/logger -p local7.notice -t "NET" -i "$0 : updated ${title} to /etc/resolv.conf"
+ rm -rf ${tmp_file}
+ else
+ /usr/bin/logger -p local7.err -t "NET" -i "$0 : /etc/resolv.conf was not updated ${title}: failed to create temporary file"
+ fi
+ fi
+}
+
# Invoke this when /etc/resolv.conf has changed:
change_resolv_conf ()
{
--
2.27.0

View File

@ -1,37 +0,0 @@
From a2cb13d3de5219f9ff0341f5c58fe50830a9de81 Mon Sep 17 00:00:00 2001
From: zhouxudong <zhouxudong8@huawei.com>
Date: Sun, 15 Sep 2019 18:39:20 +0800
Subject: [PATCH] fix
---
etc/rc.d/init.d/network | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/etc/rc.d/init.d/network b/etc/rc.d/init.d/network
index 58fbc4c..4de4a9c 100755
--- a/etc/rc.d/init.d/network
+++ b/etc/rc.d/init.d/network
@@ -227,6 +227,7 @@ stop)
remaining="$remaining $i"
done
+ bondlist=`cat /proc/net/bonding/* 2> /dev/null | grep "Slave Inter" | awk '{print $3}'`
for i in $vpninterfaces $xdslinterfaces $bridgeinterfaces $vlaninterfaces $remaining; do
unset DEVICE TYPE
(. ./ifcfg-$i
@@ -236,8 +237,10 @@ stop)
action $"Shutting down interface $i: " ./ifdown $i boot
[ $? -ne 0 ] && rc=1
else
- action $"Shutting down non-UP interface $i: " ./ifdown $i boot
- logger $"Running ifdown on non-UP interface $i"
+ if ! echo "$bondlist" | grep -qw $DEVICE ; then
+ action $"Shutting down non-UP interface $i: " ./ifdown $i boot
+ logger $"Running ifdown on non-UP interface $i"
+ fi
fi
)
done
--
2.19.1

Binary file not shown.

BIN
initscripts-10.19.tar.gz Normal file

Binary file not shown.

View File

@ -19,10 +19,10 @@ Requires: gawk \
Name: initscripts
Summary: Basic support for legacy System V init scripts
Version: 10.17
Version: 10.19
Release: 2
License: GPLv2
License: GPL-2.0-only
URL: https://github.com/fedora-sysv/initscripts
Source: https://github.com/fedora-sysv/initscripts/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
@ -81,18 +81,17 @@ Obsoletes: %{name} < 9.82-2
# Patches to be removed -- deprecated functionality which shall be removed at
# --------------------- some point in the future:
Patch0: backport-run-ifdown-on-all-interfaces.patch
Patch0: backport-rename_device-free-path-after-it-is-used.patch
Patch9000: bugfix-initscripts-add-udev-wait-dependency-for-network.patch
Patch9001: bugfix-mod-network-function-when-NM-unmanage-devices.patch
Patch9002: bugfix-initscripts-set-PERSISTENT_DHCLIENT-default-to-yes.patch
Patch9003: bugfix-network-need-chkconfig-on.patch
Patch9004: bugfix-restart-network-warning.patch
Patch9005: new-network-fork-to-start-dhcp.patch
Patch9006: exec-udevadm-settle-when-network-start.patch
Patch9007: remove-rename_device_lock-when-process-does-not-exis.patch
Patch9008: bugfix-Incorrect-processing-of-empty-files-for-resolv.conf.patch
Patch9004: new-network-fork-to-start-dhcp.patch
Patch9005: exec-udevadm-settle-when-network-start.patch
Patch9006: remove-rename_device_lock-when-process-does-not-exis.patch
Patch9007: support-specify-cc.patch
%description
This package provides basic support for legacy System V init scripts, and some
@ -124,7 +123,6 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: bc
Requires: dbus
Requires: dbus-tools
Requires: gawk
Requires: grep
Requires: hostname
@ -389,6 +387,37 @@ fi
# =============================================================================
%changelog
* Thu Feb 13 2025 xinghe <xinghe2@h-partners.com> - 10.19-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:rename_device: free path after it is used
* Thu Feb 1 2024 liubo <liubo335@huawei.com> - 10.19-1
- Type: requirement
- ID: NA
- SUG: NA
- DESC: update to version 10.19
* Thu Jun 15 gaoxingwang <gaoxingwang1@huawei.com> - 10.17-5
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:remove unnecessary patches because the first introduced problem doesn't make much sense to fix
* Fri Apr 14 2023 jammyjellyfish <jammyjellyfish255@outlook.com> - 10.17-4
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:Support specify CC
* Mon Feb 20 2023 gaihuiying <eaglegai@163.com> - 10.17-3
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:delete Requires:dbus-tools
* Mon Nov 07 2022 zhangqiang <zhangqiang@kylinos.cn> - 10.17-2
- Type:bugfix
- ID:NA

15
support-specify-cc.patch Normal file
View File

@ -0,0 +1,15 @@
From: jammyjellyfish <jammyjellyfish255@outlook.com>
Date: Mon Apr 17 01:49:49 PM CST 2023
Subject: Support specify CC
diff -up initscripts-10.17/src/Makefile.orig2 initscripts-10.17/src/Makefile
--- initscripts-10.17/src/Makefile.orig2 2023-04-14 22:39:35.308829467 +0800
+++ initscripts-10.17/src/Makefile 2023-04-14 22:39:49.296867265 +0800
@@ -17,7 +17,7 @@ bindir = $(prefix)/bin
sbindir = $(prefix)/sbin
libdir = $(prefix)/lib
-CC = gcc
+CC ?= gcc
CFLAGS += $(RPM_OPT_FLAGS) -Wall -D_GNU_SOURCE -fPIE
LDFLAGS += $(RPM_LD_FLAGS) -pie -z relro -z now