1 Star 0 Fork 32

wangyuhang/dracut

forked from src-openEuler/dracut 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
revert-fix-systemd-networkd-make-systemd-networkd.patch 6.60 KB
一键复制 编辑 原始数据 按行查看 历史
chenjiayi 提交于 2023-01-17 18:38 . Update to 059 and fix some bugs in spec
From 594e8e187ab98f913c1abe60b7dd9c03c1bd3e9e Mon Sep 17 00:00:00 2001
From: openEuler Buildteam <buildteam@openeuler.org>
Date: Tue, 17 Jan 2023 17:22:09 +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 | 93 ++++++++------------
modules.d/40network/module-setup.sh | 4 +-
2 files changed, 39 insertions(+), 58 deletions(-)
diff --git a/modules.d/01systemd-networkd/module-setup.sh b/modules.d/01systemd-networkd/module-setup.sh
index 27d9010..c0a970f 100755
--- a/modules.d/01systemd-networkd/module-setup.sh
+++ b/modules.d/01systemd-networkd/module-setup.sh
@@ -1,81 +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 \
- "$systemdnetwork"/80-container-host0.network \
- "$systemdnetwork"/80-container-ve.network \
- "$systemdnetwork"/80-container-vz.network \
- "$systemdnetwork"/80-vm-vt.network \
- "$systemdnetwork"/80-wifi-adhoc.network \
- "$systemdnetwork"/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 \
- "$sysusers"/systemd-network.conf \
+ "$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" \
- "$systemdnetworkconfdir/*" \
- "$systemdsystemconfdir"/systemd-networkd.service \
- "$systemdsystemconfdir/systemd-networkd.service/*.conf" \
- "$systemdsystemconfdir"/systemd-networkd.socket \
- "$systemdsystemconfdir/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" \
- "$sysusersconfdir"/systemd-network.conf
- fi
}
diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
index 1ab13ef..49b45f3 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 connman network-manager network-legacy systemd-networkd; do
+ for module in network-wicked connman network-manager network-legacy; do
if dracut_module_included "$module"; then
network_handler="$module"
break
@@ -23,8 +23,6 @@ depends() {
network_handler="connman"
elif [[ -x $dracutsysrootdir/usr/libexec/nm-initrd-generator ]] || [[ -x $dracutsysrootdir/usr/lib/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
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wangyuhang27/dracut.git
git@gitee.com:wangyuhang27/dracut.git
wangyuhang27
dracut
dracut
master

搜索帮助