]> git.ipfire.org Git - thirdparty/dracut.git/commit
network: dhcp before parsing specified dns through cmdline
authorHarald Hoyer <harald@redhat.com>
Wed, 29 Jun 2016 15:26:17 +0000 (17:26 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 29 Jun 2016 15:26:17 +0000 (17:26 +0200)
commit5bc318633fdf2c5bfea88bf2cf03e5aac2e78a1d
treeefc6d427ec06235c35136f4fb92e93d3675a5593
parent53310e44c9b785641d4889b1dab350b562df5ed9
network: dhcp before parsing specified dns through cmdline

I met a problem when passing kdump dns to dracut via "nameserver=x.x.x.x",
the dns I provided didn't appear in the "/etc/resolv.conf".

After some debugging, found that when setup dhcp DNS, in setup_interface()
and setup_interface6(), it has:
    echo "search $search $domain" > /tmp/net.$netif.resolv.conf

So if "$search $domain" isn't NULL(this is ture in my kdump environment),
the dns contents(that is, dns1, dns2, nameserver) in "ifup" before dhcp
will be discarded.

This patch addresses it by handling dhcp first. In fact this is also the
way the NetworkManager in 1st kernel works.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
cherry-pick of commit cf376023e6d0d4abd9816fa954bb917fc2557713
modules.d/40network/ifup.sh