Skip to content

Commit

Permalink
fix(network-legacy): do not require pgrep when using wicked (bsc#1236…
Browse files Browse the repository at this point in the history
…982)

`pgrep` is required by `dhcp-multi.sh`, i.e., the script spawned to perform DHCP
in parallel on all available interfaces using the `ip=single-dhcp` kernel
command line option. And `dhcp-multi.sh` only calls `dhclient` internally, so it
will not work when using wicked as DHCP backend.
  • Loading branch information
aafeijoo-suse committed Feb 20, 2025
1 parent e9a1760 commit 1c28b3a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
4 changes: 4 additions & 0 deletions modules.d/35network-legacy/ifup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,10 @@ for p in $(getargs ip=); do
do_dhcp -4
;;
single-dhcp)
if command -v wicked > /dev/null; then
warn "DHCP in parallel on all available interfaces not available with wicked."
exit 1
fi
do_dhcp_parallel -4
exit 0
;;
Expand Down
16 changes: 10 additions & 6 deletions modules.d/35network-legacy/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# called by dracut
check() {
require_binaries ip sed awk grep pgrep tr expr || return 1
require_binaries ip sed awk grep tr expr || return 1

require_any_binary arping arping2 wicked || return 1
require_any_binary dhclient wicked || return 1
Expand Down Expand Up @@ -34,22 +34,26 @@ install() {
[[ $hostonly ]] && inst_multiple -H -o "${systemdnetworkconfdir}/*.link"
fi

inst_multiple ip sed awk grep pgrep tr expr
inst -o dhclient
inst_multiple ip sed awk grep tr expr
if command -v wicked > /dev/null; then
inst wicked
else
inst_multiple dhclient pgrep
inst_simple -H "/etc/dhclient.conf"
cat "$moddir/dhclient.conf" >> "${initdir}/etc/dhclient.conf"
fi

inst_multiple -o arping arping2
if command -v arping > /dev/null; then
strstr "$(arping 2>&1)" "ARPing 2" && mv "$initdir/bin/arping" "$initdir/bin/arping2"
fi
inst_multiple -o wicked

inst_multiple -o ping ping6
inst_multiple -o teamd teamdctl teamnl
inst_simple /etc/libnl/classid
inst_script "$moddir/ifup.sh" "/sbin/ifup"
inst_script "$moddir/dhcp-multi.sh" "/sbin/dhcp-multi.sh"
inst_script "$moddir/dhclient-script.sh" "/sbin/dhclient-script"
inst_simple -H "/etc/dhclient.conf"
cat "$moddir/dhclient.conf" >> "${initdir}/etc/dhclient.conf"
inst_hook pre-udev 60 "$moddir/net-genrules.sh"
inst_hook cmdline 92 "$moddir/parse-ibft.sh"
inst_hook cmdline 95 "$moddir/parse-vlan.sh"
Expand Down
3 changes: 2 additions & 1 deletion modules.d/40network/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# called by dracut
check() {
require_binaries ip sed awk grep || return 1
return 255
}

Expand Down Expand Up @@ -42,7 +43,7 @@ install() {
inst_simple "$moddir/net-lib.sh" "/lib/net-lib.sh"
inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
inst_multiple ip sed awk grep pgrep tr
inst_multiple ip sed awk grep
inst_multiple -o arping arping2
dracut_need_initqueue
}

0 comments on commit 1c28b3a

Please sign in to comment.