flush ip addresses after copy to RAM

We received an IP address from DHCP server and configure it statically.
This is required if we continue to use network connectivity to access
the root device (for example via NBD or NFS).

The lease is not updated, though. This can cause trouble in networks
with low lease times. So let's flush the addresses if root filesystem
has been copied to RAM. A dhcp client in main system can handle the
network connectivity then.

Signed-off-by: Christian Hesse <mail@eworm.de>
This commit is contained in:
Christian Hesse 2015-06-15 00:05:03 +02:00 committed by Gerardo Exequiel Pozzi
parent dc845b3f13
commit f21da59e81

View File

@ -49,7 +49,9 @@ run_hook () {
run_latehook () {
[[ -z "${copy_resolvconf}" ]] && copy_resolvconf="y"
if [[ "${copy_resolvconf}" != "n" && -f /etc/resolv.conf ]]; then
if [[ "${copytoram}" == "y" ]]; then
ip address flush scope global
elif [[ "${copy_resolvconf}" != "n" && -f /etc/resolv.conf ]]; then
cp /etc/resolv.conf /new_root/etc/resolv.conf
fi
}