Now Kdump will ingore the DNS config in /etc/resolv.conf, when it generates the initram. And most users do not concern about this issue, because they never use deployment tools to configure machines environment, like puppet.
It is more convenient to add the DNS config to /etc/resolv.conf for people who use deployment tools to configure machines concurrently.
Signed-off-by: Minfei Huang mhuang@redhat.com --- v1: - check the file existence firstly, then print the file content --- dracut-module-setup.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 228fae2..957e53e 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -64,10 +64,25 @@ kdump_is_vlan() {
# $1: netdev name kdump_setup_dns() { - _dnsfile=${initdir}/etc/cmdline.d/42dns.conf + local _nameserver _dns + local _dnsfile=${initdir}/etc/cmdline.d/42dns.conf . /etc/sysconfig/network-scripts/ifcfg-$1 + [ -n "$DNS1" ] && echo "nameserver=$DNS1" > "$_dnsfile" [ -n "$DNS2" ] && echo "nameserver=$DNS2" >> "$_dnsfile" + + while read content; + do + _nameserver=$(echo $content | grep ^nameserver) + [ -z "$_nameserver" ] && continue + + _dns=$(echo $_nameserver | cut -d' ' -f2) + [ -z "$_dns" ] && continue + + if [ ! -f $_dnsfile ] || [ ! $(cat $_dnsfile | grep -q $_dns) ]; then + echo "nameserver=$_dns" >> "$_dnsfile" + fi + done < "/etc/resolv.conf" }
#$1: netdev name
On 06/30/15 at 05:45pm, Minfei Huang wrote:
Now Kdump will ingore the DNS config in /etc/resolv.conf, when it generates the initram. And most users do not concern about this issue, because they never use deployment tools to configure machines environment, like puppet.
It is more convenient to add the DNS config to /etc/resolv.conf for people who use deployment tools to configure machines concurrently.
Signed-off-by: Minfei Huang mhuang@redhat.com
v1:
- check the file existence firstly, then print the file content
dracut-module-setup.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 228fae2..957e53e 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -64,10 +64,25 @@ kdump_is_vlan() {
# $1: netdev name kdump_setup_dns() {
- _dnsfile=${initdir}/etc/cmdline.d/42dns.conf
- local _nameserver _dns
- local _dnsfile=${initdir}/etc/cmdline.d/42dns.conf . /etc/sysconfig/network-scripts/ifcfg-$1
- [ -n "$DNS1" ] && echo "nameserver=$DNS1" > "$_dnsfile" [ -n "$DNS2" ] && echo "nameserver=$DNS2" >> "$_dnsfile"
- while read content;
- do
_nameserver=$(echo $content | grep ^nameserver)
[ -z "$_nameserver" ] && continue
_dns=$(echo $_nameserver | cut -d' ' -f2)
[ -z "$_dns" ] && continue
if [ ! -f $_dnsfile ] || [ ! $(cat $_dnsfile | grep -q $_dns) ]; then
echo "nameserver=$_dns" >> "$_dnsfile"
fi
- done < "/etc/resolv.conf"
}
#$1: netdev name
2.1.0
Acked-by: Dave Young dyoung@redhat.com
Thanks Dave
Hi Minfei,
This patch looks good to me. Ack it. One concern about the git log as below, you can adjust it when merge.
Acked-by: Baoquan He bhe@redhat.com
On 06/30/15 at 05:45pm, Minfei Huang wrote:
Now Kdump will ingore the DNS config in /etc/resolv.conf, when it generates the initram. And most users do not concern about this issue, because they never use deployment tools to configure machines environment, like puppet.
because they never use deployment tools like puppet to configure machines environment.
It is more convenient to add the DNS config to /etc/resolv.conf for people who use deployment tools to configure machines concurrently.
Remove concurrently.
Signed-off-by: Minfei Huang mhuang@redhat.com
v1:
- check the file existence firstly, then print the file content
dracut-module-setup.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 228fae2..957e53e 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -64,10 +64,25 @@ kdump_is_vlan() {
# $1: netdev name kdump_setup_dns() {
- _dnsfile=${initdir}/etc/cmdline.d/42dns.conf
- local _nameserver _dns
- local _dnsfile=${initdir}/etc/cmdline.d/42dns.conf . /etc/sysconfig/network-scripts/ifcfg-$1
- [ -n "$DNS1" ] && echo "nameserver=$DNS1" > "$_dnsfile" [ -n "$DNS2" ] && echo "nameserver=$DNS2" >> "$_dnsfile"
- while read content;
- do
_nameserver=$(echo $content | grep ^nameserver)
[ -z "$_nameserver" ] && continue
_dns=$(echo $_nameserver | cut -d' ' -f2)
[ -z "$_dns" ] && continue
if [ ! -f $_dnsfile ] || [ ! $(cat $_dnsfile | grep -q $_dns) ]; then
echo "nameserver=$_dns" >> "$_dnsfile"
fi
- done < "/etc/resolv.conf"
}
#$1: netdev name
2.1.0
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec