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).
master
Lubomir Rintel 2018-09-18 11:17:54 +02:00 committed by Harald Hoyer
parent 24f3463bff
commit 0454dc247a
1 changed files with 6 additions and 0 deletions

View File

@ -41,6 +41,12 @@ do_dhcp() {
return 1 return 1
fi 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 while [ $_COUNT -lt $_DHCPRETRY ]; do
info "Starting dhcp for interface $netif" info "Starting dhcp for interface $netif"
dhclient "$@" \ dhclient "$@" \