]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(udev-rules): remove sourcing of network link files
authorJóhann B. Guðmundsson <johannbg@gmail.com>
Wed, 28 Apr 2021 15:11:46 +0000 (15:11 +0000)
committerHarald Hoyer <harald@hoyer.xyz>
Mon, 3 May 2021 08:07:48 +0000 (10:07 +0200)
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
modules.d/35network-manager/module-setup.sh
modules.d/95udev-rules/module-setup.sh
test/TEST-30-ISCSI/test.sh

index 9b90aaaa0ce0cb8ce391074d21c0b1e927806a9a..aea7c4322ae80869afbd4db2a55ca098aa6c6931 100755 (executable)
@@ -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
index b08688ee67a834b50af7e32d6e20d32168fc4723..9a89b9fd6d14279b7962746910d011089dcb5e34 100755 (executable)
@@ -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
 
index c500fc6db4b2d683f5adb09df99401c8e44332b3..a136eed82b46468632dda60790f8871eb41038d2 100755 (executable)
@@ -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
index d72d67e9494db0774c19e9dc4cbf87e40e6e4bfc..5f218f166d4d3d39d5880d62cd76dad6a6ae4c21 100755 (executable)
@@ -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