From 69f4e7cdc3f7da24e40496b0b2f0f5022cc3376d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= Date: Wed, 28 Apr 2021 15:11:46 +0000 Subject: [PATCH] fix(udev-rules): remove sourcing of network link files Removing sourcing of network link files from the udev-rules module. What always should be included should be placed in the systemd-network module and other modules that provide/require spesific link files should add them, themselves via their relevant include section. --- modules.d/35network-legacy/module-setup.sh | 7 +++++++ modules.d/35network-manager/module-setup.sh | 4 ++++ modules.d/95udev-rules/module-setup.sh | 5 ----- test/TEST-30-ISCSI/test.sh | 4 +--- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/modules.d/35network-legacy/module-setup.sh b/modules.d/35network-legacy/module-setup.sh index 9b90aaaa..aea7c432 100755 --- a/modules.d/35network-legacy/module-setup.sh +++ b/modules.d/35network-legacy/module-setup.sh @@ -21,6 +21,13 @@ installkernel() { # called by dracut install() { local _arch + + #Adding default link + if dracut_module_included "systemd"; then + inst_multiple -o "${systemdutildir}/network/99-default.link" + [[ $hostonly ]] && inst_multiple -H -o "${systemdsystemconfdir}/network/*.link" + fi + inst_multiple ip dhclient sed awk grep pgrep tr inst_multiple -o arping arping2 diff --git a/modules.d/35network-manager/module-setup.sh b/modules.d/35network-manager/module-setup.sh index b08688ee..9a89b9fd 100755 --- a/modules.d/35network-manager/module-setup.sh +++ b/modules.d/35network-manager/module-setup.sh @@ -45,6 +45,10 @@ install() { inst_simple "$moddir"/nm-initrd.service "$systemdsystemunitdir"/nm-initrd.service inst_simple "$moddir"/nm-wait-online-initrd.service "$systemdsystemunitdir"/nm-wait-online-initrd.service + # Adding default link + inst_multiple -o "${systemdutildir}/network/99-default.link" + [[ $hostonly ]] && inst_multiple -H -o "${systemdsystemconfdir}/network/*.link" + $SYSTEMCTL -q --root "$initdir" enable nm-initrd.service fi diff --git a/modules.d/95udev-rules/module-setup.sh b/modules.d/95udev-rules/module-setup.sh index c500fc6d..a136eed8 100755 --- a/modules.d/95udev-rules/module-setup.sh +++ b/modules.d/95udev-rules/module-setup.sh @@ -57,11 +57,6 @@ install() { # legacy persistent network device name rules [[ $hostonly ]] && inst_rules 70-persistent-net.rules - if dracut_module_included "systemd"; then - inst_multiple -o "${systemdutildir}/network/*.link" - [[ $hostonly ]] && inst_multiple -H -o "/etc/systemd/network/*.link" - fi - { for i in cdrom tape dialout floppy; do if ! grep -q "^$i:" "$initdir"/etc/group 2> /dev/null; then diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh index d72d67e9..5f218f16 100755 --- a/test/TEST-30-ISCSI/test.sh +++ b/test/TEST-30-ISCSI/test.sh @@ -242,8 +242,7 @@ test_setup() { ) inst /etc/passwd /etc/passwd inst_multiple sh ls shutdown poweroff stty cat ps ln ip \ - dmesg mkdir cp ping \ - modprobe tcpdump setsid \ + dmesg mkdir cp ping modprobe tcpdump setsid \ /etc/services sleep mount chmod pidof inst_multiple tgtd tgtadm for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do @@ -314,7 +313,6 @@ test_setup() { inst_multiple poweroff shutdown inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh - inst_simple ./99-default.link /etc/systemd/network/99-default.link ) # Make server's dracut image