Package init

This commit is contained in:
overweight 2019-09-30 10:53:14 -04:00
commit 9fdbc3642a
11 changed files with 4220 additions and 0 deletions

View File

@ -0,0 +1,34 @@
From 6f77c3059cb9aceea5ed9fc6f434577214716476 Mon Sep 17 00:00:00 2001
From: Hui Wang <john.wanghui@huawei.com>
Date: Wed, 19 Oct 2016 19:50:29 +0800
Subject: [PATCH] initscripts: add udev-wait dependency for network
We changed systemd so that ethernet interface can be renamed successfully
even though the name has be taken, but rename operations will take some
seconds. Systemd start service concurrent, while systemd-udevd is renaming
ethernet interfaces, network service start to configure them, once ip was
set, the rename operation will fail with the error 'Device or resource busy'
So network service should start after ethernet rename finished, that means
all uevents are be done.
udev-wait.service will be added to customize packages, such as config-os-XX.
---
rc.d/init.d/network | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/etc/rc.d/init.d/network b/etc/rc.d/init.d/network
index 2b8c191..91a8043 100755
--- a/etc/rc.d/init.d/network
+++ b/etc/rc.d/init.d/network
@@ -8,7 +8,7 @@
#
### BEGIN INIT INFO
# Provides: $network
-# Should-Start: iptables ip6tables NetworkManager-wait-online NetworkManager $network-pre
+# Should-Start: iptables ip6tables NetworkManager-wait-online NetworkManager udev-wait $network-pre
# Short-Description: Bring up/down networking
# Description: Bring up/down networking
### END INIT INFO
--
1.8.3.1

View File

@ -0,0 +1,32 @@
From 2f5a4318ac00a12d2c8c5ecae391917166af6933 Mon Sep 17 00:00:00 2001
From: Chunmei Xu <xuchunmei@huawei.com>
Date: Wed, 18 Jul 2018 04:21:01 -0400
Subject: [PATCH] initscripts: set PERSISTENT_DHCLIENT default to yes for
dhclient args
Signed-off-by: Chunmei Xu <xuchunmei@huawei.com>
---
network-scripts/ifup-eth | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/network-scripts/ifup-eth b/network-scripts/ifup-eth
index 3da5c16..93e8348 100755
--- a/network-scripts/ifup-eth
+++ b/network-scripts/ifup-eth
@@ -195,10 +195,10 @@ if [ -n "${BRIDGE}" ] && [ -x /usr/sbin/brctl ]; then
fi
if [ -n "${DYNCONFIG}" ] && [ -x /sbin/dhclient ]; then
- if is_true "${PERSISTENT_DHCLIENT}"; then
- ONESHOT="";
+ if is_false "${PERSISTENT_DHCLIENT}"; then
+ ONESHOT="-1";
else
- ONESHOT="-1";
+ ONESHOT="";
fi;
generate_config_file_name
generate_lease_file_name
--
1.8.3.1

View File

@ -0,0 +1,28 @@
From: wangxiao <wangxiao65@huawei.com>
Subject: [PATCH] initscripts: maintain permissions set umask in case resolvconf doesn't exist
reason: maintain permissions set umask in case resolvconf doesn't exist
diff --git a/network-scripts/network-functions b/network-scripts/network-functions
index 7f5dfb0..8deda57 100644
--- a/network-scripts/network-functions
+++ b/network-scripts/network-functions
@@ -619,6 +619,11 @@
# Invoke this when /etc/resolv.conf has changed:
change_resolv_conf ()
{
+ # maintain permissions
+ # but set umask in case it doesn't exist!
+ oldumask=$(umask)
+ umask 022
+
s=$(/bin/grep '^[\ \ ]*option' /etc/resolv.conf 2>/dev/null)
if [ $# -gt 1 ]; then
if [ "x$s" != "x" ]; then
@@ -654,6 +659,8 @@
/usr/bin/logger -p local7.notice -t "NET" -i "$0 : updated /etc/resolv.conf"
[ -e /run/nscd/socket ] && /usr/sbin/nscd -i hosts # invalidate cache
fi
+
+ umask $oldumask
return $r
}

View File

@ -0,0 +1,29 @@
From 482d36652a2f14ae7c2216e019d747a28c521d52 Mon Sep 17 00:00:00 2001
From: Lijie Yu <yulijie@huawei.com>
Date: Wed, 7 Mar 2018 16:56:50 +0800
Subject: [PATCH] initscripts: mod network-function for network when NM
unmanaged devices
[Changelog]:mod network-function for network when NM unmanaged devices
[Author]:yulijie
---
network-scripts/network-functions | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/network-scripts/network-functions b/network-scripts/network-functions
index 8deda57..00d5bdc 100644
--- a/network-scripts/network-functions
+++ b/network-scripts/network-functions
@@ -179,7 +179,9 @@ source_config ()
nm_con_load "$CONFIG"
if ! is_false $NM_CONTROLLED; then
UUID=$(get_uuid_by_config $CONFIG)
- [ -n "$UUID" ] && _use_nm=true
+ managed_strings=`nmcli dev show $DEVICE | grep STATE | grep unmanaged`
+ [ -z "$managed_strings" ] && is_device_managed=true
+ [ -n "$UUID" ] && [ "$is_device_managed"x = "true"x ] && _use_nm=true
fi
fi
}
--
1.8.3.1

View File

@ -0,0 +1,25 @@
From 62acdd3b572ab6d97ddc1457ba6e21187bde0e70 Mon Sep 17 00:00:00 2001
From: Li Shang <shangli1@huawei.com>
Date: Tue, 9 Apr 2019 09:03:38 -0400
Subject: [PATCH] network need start
---
etc/rc.d/init.d/network | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/etc/rc.d/init.d/network b/etc/rc.d/init.d/network
index ade227e..3805f65 100755
--- a/etc/rc.d/init.d/network
+++ b/etc/rc.d/init.d/network
@@ -2,7 +2,7 @@
#
# network Bring up/down networking
#
-# chkconfig: - 10 90
+# chkconfig: 2345 10 90
# description: Activates/Deactivates all network interfaces configured to \
# start at boot time.
#
--
1.8.3.1

View File

@ -0,0 +1,37 @@
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

View File

@ -0,0 +1,80 @@
From d6af590090a2a8ffd45e273bdbd46a3fefc8debb Mon Sep 17 00:00:00 2001
From: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Date: Mon, 22 Jul 2019 13:38:55 +0800
Subject: [PATCH] ifup/ifdown: print DEPRECATION_WARNING_ISSUED waring info
after source_config
In ifup/ifdown scripts, move deprecation waring info after
source_config, so users can config DEPRECATION_WARNING_ISSUED in
ifcfg-** file to decide whether show deprecation waring info when
calling ifup/ifdown.
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
---
network-scripts/ifdown | 12 ++++++------
network-scripts/ifup | 12 ++++++------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/network-scripts/ifdown b/network-scripts/ifdown
index aa8fce7..ec05891 100755
--- a/network-scripts/ifdown
+++ b/network-scripts/ifdown
@@ -16,12 +16,6 @@ CONFIG=$1
exit 1
}
-if ! is_true ${DEPRECATION_WARNING_ISSUED}; then
- net_log $"You are using 'ifdown' script provided by 'network-scripts', which are now deprecated." warning ifdown >&2
- net_log $"'network-scripts' will be removed from distribution in near future." warning ifdown >&2
- net_log $"It is advised to switch to 'NetworkManager' instead - it provides 'ifup/ifdown' scripts as well." warning ifdown >&2
-fi
-
need_config "${CONFIG}"
[ -f "$CONFIG" ] || {
@@ -42,6 +36,12 @@ fi
source_config
+if ! is_true ${DEPRECATION_WARNING_ISSUED}; then
+ net_log $"You are using 'ifdown' script provided by 'network-scripts', which are now deprecated." warning ifdown >&2
+ net_log $"'network-scripts' will be removed from distribution in near future." warning ifdown >&2
+ net_log $"It is advised to switch to 'NetworkManager' instead - it provides 'ifup/ifdown' scripts as well." warning ifdown >&2
+fi
+
if [ -n "$IN_HOTPLUG" ] && [ "${HOTPLUG}" = "no" -o "${HOTPLUG}" = "NO" ]
then
exit 0
diff --git a/network-scripts/ifup b/network-scripts/ifup
index 435c317..397dd93 100755
--- a/network-scripts/ifup
+++ b/network-scripts/ifup
@@ -31,12 +31,6 @@ CONFIG=${1}
exit 1
}
-if ! is_true ${DEPRECATION_WARNING_ISSUED}; then
- net_log $"You are using 'ifup' script provided by 'network-scripts', which are now deprecated." warning ifup >&2
- net_log $"'network-scripts' will be removed from distribution in near future." warning ifup >&2
- net_log $"It is advised to switch to 'NetworkManager' instead - it provides 'ifup/ifdown' scripts as well." warning ifup >&2
-fi
-
need_config "${CONFIG}"
[ -f "${CONFIG}" ] || {
@@ -58,6 +52,12 @@ fi
source_config
+if ! is_true ${DEPRECATION_WARNING_ISSUED}; then
+ net_log $"You are using 'ifup' script provided by 'network-scripts', which are now deprecated." warning ifup >&2
+ net_log $"'network-scripts' will be removed from distribution in near future." warning ifup >&2
+ net_log $"It is advised to switch to 'NetworkManager' instead - it provides 'ifup/ifdown' scripts as well." warning ifup >&2
+fi
+
if [ "foo$2" = "fooboot" ] && [ "${ONBOOT}" = "no" -o "${ONBOOT}" = "NO" ]
then
exit 0
--
2.6.1.windows.1

View File

@ -0,0 +1,32 @@
From bf6a9d7d1f708077bfaad8ea109ad8b4eeb69556 Mon Sep 17 00:00:00 2001
From: "David Kaspar [Dee'Kej]" <dkaspar@redhat.com>
Date: Mon, 20 Aug 2018 14:31:56 +0200
Subject: [PATCH 3/4] ifup-post: fix incorrect condition for RESOLV_MODS
This was causing the /etc/resolv.conf file to be always updated when
RESOLV_MODS was not set...
Before the commit 5d6156454bf8f6dab4a5fdd7e1bf6 we were not updating
the /etc/resolv.conf file if the RESOLV_MODS was empty.
See https://bugzilla.redhat.com/show_bug.cgi?id=1610411 for more info.
---
network-scripts/ifup-post | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/network-scripts/ifup-post b/network-scripts/ifup-post
index 5a89cbf3..4cb986f8 100755
--- a/network-scripts/ifup-post
+++ b/network-scripts/ifup-post
@@ -28,7 +28,7 @@ if ! is_true "$NOROUTESET"; then
fi
-if ! is_false "${PEERDNS}" || ! is_false "${RESOLV_MODS}"; then
+if ! is_false "${PEERDNS}" || is_true "${RESOLV_MODS}"; then
# Obtain the DNS entries when using PPP if necessary:
[ -n "${MS_DNS1}" ] && DNS1="${MS_DNS1}"
[ -n "${MS_DNS2}" ] && DNS2="${MS_DNS2}"
--
2.19.1

BIN
initscripts-10.01.tar.gz Normal file

Binary file not shown.

3898
initscripts.spec Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,25 @@
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