Search
j0ke.net Open Build Service
>
Projects
>
internetx
:
kiwi
:
Appliance
>
dracut
> 0069-network-net-lib.sh-delete-duplicated-DNS-items-from-.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File 0069-network-net-lib.sh-delete-duplicated-DNS-items-from-.patch of Package dracut
From 2704fffbc735ab18444859e9729d98105b27ee9e Mon Sep 17 00:00:00 2001 From: Xunlei Pang <xlpang@redhat.com> Date: Tue, 26 Apr 2016 18:05:11 +0800 Subject: [PATCH] network/net-lib.sh: delete duplicated DNS items from "/etc/resolv.conf" Users can pass the DNS information throught "nameserver=" cmdline, there maybe duplicated inputs. "/etc/resolv.conf" have some restrictions on the number of DNS items effective, so make sure that this file contains no duplicated items. We achieve this by simply making the file have no duplicated lines. Signed-off-by: Xunlei Pang <xlpang@redhat.com> --- modules.d/40network/module-setup.sh | 2 +- modules.d/40network/net-lib.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh index 4bf93cc6..53b4b60b 100755 --- a/modules.d/40network/module-setup.sh +++ b/modules.d/40network/module-setup.sh @@ -23,7 +23,7 @@ installkernel() { # called by dracut install() { local _arch _i _dir - inst_multiple ip arping dhclient sed + inst_multiple ip arping dhclient sed awk inst_multiple -o ping ping6 inst_multiple -o brctl inst_multiple -o teamd teamdctl teamnl diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh index 31f1a567..005ad1bb 100755 --- a/modules.d/40network/net-lib.sh +++ b/modules.d/40network/net-lib.sh @@ -120,7 +120,7 @@ setup_net() { [ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts # set up resolv.conf [ -e /tmp/net.$netif.resolv.conf ] && \ - cp -f /tmp/net.$netif.resolv.conf /etc/resolv.conf + awk '!array[$0]++' /tmp/net.$netif.resolv.conf > /etc/resolv.conf [ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw # add static route