Skip to content

Commit

Permalink
fix(udev-rules): remove sourcing of network link files
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
johannbg authored and haraldh committed May 3, 2021
1 parent fd883a5 commit 69f4e7c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
7 changes: 7 additions & 0 deletions modules.d/35network-legacy/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions modules.d/35network-manager/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 0 additions & 5 deletions modules.d/95udev-rules/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions test/TEST-30-ISCSI/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 69f4e7c

Please sign in to comment.