From: Lubomir Rintel Date: Tue, 18 Sep 2018 09:17:54 +0000 (+0200) Subject: network: configure NetworkManager to use dhclient X-Git-Tag: 049~11 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fdracut.git;a=commitdiff_plain;h=0454dc247a146fabd66232c26536514dca1f6044 network: configure NetworkManager to use dhclient If the network module obtained a lease using dhclient, NetworkManager must be configured to use it too, otherwise it would obtain a different lease (and could potentially break a connection to the network volume). --- diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh index 54981386c..ea2a67ff0 100755 --- a/modules.d/40network/ifup.sh +++ b/modules.d/40network/ifup.sh @@ -41,6 +41,12 @@ do_dhcp() { return 1 fi + if [ ! -e /run/NetworkManager/conf.d/10-dracut-dhclient.conf ]; then + mkdir -p /run/NetworkManager/conf.d + echo '[main]' > /run/NetworkManager/conf.d/10-dracut-dhclient.conf + echo 'dhcp=dhclient' >>/run/NetworkManager/conf.d/10-dracut-dhclient.conf + fi + while [ $_COUNT -lt $_DHCPRETRY ]; do info "Starting dhcp for interface $netif" dhclient "$@" \