1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
From 03d8f6a99e9fbc73836982c84fda9fb74be8cda9 Mon Sep 17 00:00:00 2001
From: openEuler Buildteam <buildteam@openeuler.org>
Date: Wed, 25 Aug 2021 10:00:16 +0800
Subject: [PATCH] revert "fix(systemd-networkd): make systemd-networkd a
proper network provider"
This reverts commit ea779750c371102c04252b48f1b7d9c7ece7cf93 to make
network-legacy to be the network provider.
---
modules.d/01systemd-networkd/module-setup.sh | 91 ++++++++++++----------------
modules.d/40network/module-setup.sh | 4 +-
2 files changed, 39 insertions(+), 56 deletions(-)
diff --git a/modules.d/01systemd-networkd/module-setup.sh b/modules.d/01systemd-networkd/module-setup.sh
index 2f1ecb8..c0a970f 100755
--- a/modules.d/01systemd-networkd/module-setup.sh
+++ b/modules.d/01systemd-networkd/module-setup.sh
@@ -1,79 +1,64 @@
#!/bin/bash
-# This file is part of dracut.
-# SPDX-License-Identifier: GPL-2.0-or-later
-# Prerequisite check(s) for module.
+# called by dracut
check() {
[[ $mount_needs ]] && return 1
- # If the binary(s) requirements are not fulfilled the module can't be installed
- require_binaries ip networkctl \
- "$systemdutildir"/systemd-networkd \
- "$systemdutildir"/systemd-network-generator \
- "$systemdutildir"/systemd-networkd-wait-online \
- || return 1
-
- # Return 255 to only include the module, if another module requires it.
return 255
-
}
-# Module dependency requirements.
+# called by dracut
depends() {
+ echo "systemd kernel-network-modules"
+}
- # This module has external dependency on other module(s).
- echo dbus kernel-network-modules systemd-sysusers
- # Return 0 to include the dependent module(s) in the initramfs.
+installkernel() {
return 0
-
}
-# Install the required file(s) and directories for the module in the initramfs.
+# called by dracut
install() {
-
inst_multiple -o \
- "$dbussystem"/org.freedesktop.network1.conf \
- "$dbussystemservices"/org.freedesktop.network1.service \
- "$systemdutildir"/networkd.conf \
- "$systemdutildir/networkd.conf.d/*.conf" \
"$systemdutildir"/systemd-networkd \
- "$systemdutildir"/systemd-network-generator \
"$systemdutildir"/systemd-networkd-wait-online \
- "$systemdutildir"/network/80-container-host0.network \
- "$systemdutildir"/network/80-container-ve.network \
- "$systemdutildir"/network/80-container-vz.network \
- "$systemdutildir"/network/80-vm-vt.network \
- "$systemdutildir"/network/80-wifi-adhoc.network \
- "$systemdutildir"/network/99-default.link \
+ "$systemdsystemunitdir"/systemd-networkd-wait-online.service \
"$systemdsystemunitdir"/systemd-networkd.service \
"$systemdsystemunitdir"/systemd-networkd.socket \
- "$systemdsystemunitdir"/systemd-network-generator.service \
- "$systemdsystemunitdir"/systemd-networkd-wait-online.service \
- "$systemdsystemunitdir"/systemd-network-generator.service \
+ "$systemdutildir"/network/99-default.link \
networkctl ip
- # Enable systemd type units
+ #hostnamectl timedatectl
+ # $systemdutildir/systemd-timesyncd \
+ # $systemdutildir/systemd-timedated \
+ # $systemdutildir/systemd-hostnamed \
+ # $systemdutildir/systemd-resolvd \
+ # $systemdutildir/systemd-resolve-host \
+ # $systemdsystemunitdir/systemd-resolved.service \
+ # $systemdsystemunitdir/systemd-hostnamed.service \
+ # $systemdsystemunitdir/systemd-timesyncd.service \
+ # $systemdsystemunitdir/systemd-timedated.service \
+ # $systemdsystemunitdir/time-sync.target \
+ # /etc/systemd/resolved.conf \
+
+ # inst_dir /var/lib/systemd/clock
+
+ grep '^systemd-network:' "$dracutsysrootdir"/etc/passwd 2> /dev/null >> "$initdir/etc/passwd"
+ grep '^systemd-network:' "$dracutsysrootdir"/etc/group >> "$initdir/etc/group"
+ # grep '^systemd-timesync:' "$dracutsysrootdir"/etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
+ # grep '^systemd-timesync:' "$dracutsysrootdir"/etc/group >> "$initdir/etc/group"
+
+ _arch=${DRACUT_ARCH:-$(uname -m)}
+ inst_libdir_file \
+ {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \
+ {"tls/$_arch/",tls/,"$_arch/",}"libnss_mdns4_minimal.so.*" \
+ {"tls/$_arch/",tls/,"$_arch/",}"libnss_myhostname.so.*" \
+ {"tls/$_arch/",tls/,"$_arch/",}"libnss_resolve.so.*"
+
+ # systemd-timesyncd.service
for i in \
+ systemd-networkd-wait-online.service \
systemd-networkd.service \
- systemd-networkd.socket \
- systemd-network-generator.service \
- systemd-networkd-wait-online.service; do
+ systemd-networkd.socket; do
$SYSTEMCTL -q --root "$initdir" enable "$i"
done
-
- # Install the hosts local user configurations if enabled.
- if [[ $hostonly ]]; then
- inst_multiple -H -o \
- "$systemdutilconfdir"/networkd.conf \
- "$systemdutilconfdir/networkd.conf.d/*.conf" \
- "$systemdutilconfdir/network/*" \
- "$systemdsystemconfdir"/systemd-networkd.service \
- "$systemdsystemconfdir/systemd-networkd.service/*.conf" \
- "$systemdsystemunitdir"/systemd-networkd.socket \
- "$systemdsystemunitdir/systemd-networkd.socket/*.conf" \
- "$systemdsystemconfdir"/systemd-network-generator.service \
- "$systemdsystemconfdir/systemd-network-generator.service/*.conf" \
- "$systemdsystemconfdir"/systemd-networkd-wait-online.service \
- "$systemdsystemconfdir/systemd-networkd-wait-online.service/*.conf"
- fi
}
diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
index 60824da..cbb5b70 100755
--- a/modules.d/40network/module-setup.sh
+++ b/modules.d/40network/module-setup.sh
@@ -9,7 +9,7 @@ check() {
depends() {
is_qemu_virtualized && echo -n "qemu-net "
- for module in network-wicked network-manager network-legacy systemd-networkd; do
+ for module in network-wicked network-manager network-legacy; do
if dracut_module_included "$module"; then
network_handler="$module"
break
@@ -21,8 +21,6 @@ depends() {
network_handler="network-wicked"
elif [[ -x $dracutsysrootdir/usr/libexec/nm-initrd-generator ]]; then
network_handler="network-manager"
- elif [[ -x $dracutsysrootdir$systemdutildir/systemd-networkd ]]; then
- network_handler="systemd-networkd"
else
network_handler="network-legacy"
fi
--
1.8.3.1
|